Am Samstag den, 9. Mdrz 2002, um 18:40, schrieb Samuel Lellouche: Hi.. Has anyone managed to use the if_set_bpf_tap function documented in Network Kernel Extension ? What documentation?... But the 'if_set_bpf_tap' is a structure element name int the ifnet structure, found in, '/usr/include/net/if_var.h' on my Mac OS X 10.1.3, and in 'bsd/net/if_var.h' in the xnu hierarchy. In anycase, the 'usage' would be something to the effect of, (Don't blame me if this really dosn't compile as it is just to show the idea of what needs to be done...) #include <net/if_var.h> (and include any other required includes .... ) extern int MyBpfTap( struct ifnet *ifp, int mode, int (*bpf_callback)(struct ifnet *, struct mbuf *)); dev_attach() { allocate an instance of an ifnet structure, say 'ifp'. .... other attach functions .... ifp->if_set_bpf_tap = MyBpfTap; /* MyBpfTap is the function that you would write to do whatever it is you want to tap for */ .... other attach functions... } As a note, this is using BSD style net driver. the IOKit version would be different, as the ifnet structure is somewhat hidden from the driver for the most part. Layers above the driver would set of the 'real ifnet' structure on your behalf... and as the Outer Limits program says, 'do not attempt to adjust your structure, we are in control'. _______________________________________________ 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)
-
John Clark