Kernel Panic at register_sockfilter() call
Hi Folks, Few days ago I started working on NKEs and now I am stuck at the very first step. I started with the tutorial code VMSIfy.c provided by Apple in developer documentation and I am unable to register my NKE using register_sockfilter() kernel panic occurs at this function call. I tried with a most simple NFDescriptor structure such as this one but with no success and only panic: *********************************************************************** /* Dispatch vectors when VMSIfy has pulled out */ struct sockif VIsockif_null; struct sockutil VIsockutil_null; #define VMSIFY_HANDLE 0xfacefeed struct NFDescriptor VMSIfy ={ {NULL, NULL}, {NULL, NULL}, VMSIFY_HANDLE, NFD_GLOBAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; kern_return_t test_start (kmod_info_t * ki, void * d) { int retval; struct protosw *pp; /* Find the protosw we want to sidle up to */ pp = pffindproto(AF_INET, IPPROTO_TCP, SOCK_STREAM); if ( pp == NULL ) return(EPFNOSUPPORT); VMSIfy.nf_soif = &VIsockif_null; VMSIfy.nf_soutil = &VIsockutil_null; /* Register the filter */ retval = register_sockfilter(&VMSIfy, NULL, pp, NFF_AFTER); return KERN_SUCCESS; } *********************************************************************** Please excuse my naiveti if I am doing anything silly and help me get out of this. Also in the tutorial one header file is included named #include <mach/kernel_extension.h> But there is no such file on the system. I am using Mac OS 10.1. Any reasons for this please? Thanks and Regards, Davinder Pal Singh. TCS. _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Davinder P Singh