Re: NKE failing on ctl_register call
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com What version of Mac OS X is this happening on? Vincent On Feb 14, 2005, at 8:59 AM, Carl Smith wrote: here on this forum along with some code from the tcplog example. this NKE of mine it is failing, with an errno of 1. this means anything. my NKE. "kern_return_t ClientKern103_start (kmod_info_t * ki, void * d) { int nReturn = 0; struct kern_ctl_reg AFctl_reg; bzero(&AFctl_reg, sizeof(AFctl_reg)); AFctl_reg.ctl_id = AFMAC_KERN_ID; AFctl_reg.ctl_unit = 0; AFctl_reg.ctl_flags = CTL_FLAG_PRIVILEGED; AFctl_reg.ctl_sendsize = 0; AFctl_reg.ctl_recvsize = 0; // Dispatch functions // ================== AFctl_reg.ctl_connect = AFKernConnect; AFctl_reg.ctl_disconnect = AFKernDisconnect; AFctl_reg.ctl_write = AFClientKernXWrite; AFctl_reg.ctl_set = NULL; AFctl_reg.ctl_get = AFKernGet; nReturn = ctl_register(&AFctl_reg, 0, &ctlref); if(nReturn != 0) { if(nReturn == EINVAL) printf("Kernel Register failed"); else } return KERN_SUCCESS; } " going between my NKE and my client. Any help/suggestions/example code would greatly be appreciated. Thank You --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.853 / Virus Database: 581 - Release Date: 2/1/2005 _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I am writing a NKE following some of the example/text given in the 'About Network Kernel Extensions' document, along with following some code from an example I found My problem is that on the call 'ctl_register' I am getting a return value of (22) from the ctl_register call and according to the documentation ctl_register should return a 0 on success. And in turn from my client app when I try to 'connect' to So I am assuming something is wrong with my ctl_register call. I load my kext using 'sudo kextload -v mynke.kext'. I am originally signed in as 'admin'. Not sure if Below is a portion of the code, from my NKE, that I am using to try and register Does the ctl_id have anything to do with it? I did register it but do I have to do anything special with/to the kernel? I am also using the same ID in my client side. static kern_ctl_ref ctlref = 0; /* Reference of the kernel controller */ printf("Kernel Register failed with the error (%d)\n", nReturn); I am not looking to anything fancy, yet, I am just trying to get the communication _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/vlubet% 40apple.com This email sent to vlubet@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Vincent Lubet