site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Thread-index: AcUkOVFI8lBV1FOQTNy4FvcUatsHMwAnbz1A Thread-topic: DLIL filtering on NKE Josh- Thanks for the definition to the apis. But I am still not a hundred percent sure which path to follow and/or which api's to call in what order.
From your email below are you saying call:
(dlil_attach_interface_filter) (dlil_attach_protocol_filter) dlil_reg_if_modules in that order or can you or someone else recommend the list of api's to call from the examples I gave below. Thanks Carl -----Original Message----- From: darwin-kernel-bounces+csmith=fortresstech.com@lists.apple.com [mailto:darwin-kernel-bounces+csmith=fortresstech.com@lists.apple.com] On Behalf Of Josh Graessley Sent: Tuesday, March 08, 2005 6:48 PM To: darwinKernel Dev Subject: Re: DLIL filtering on NKE You can attach an interface filter to an interface (dlil_attach_interface_filter) and you will get all packets on that interface. You can attach a protocol filter to an interface (dlil_attach_protocol_filter) and you will receive packets for that protocol on that interface. dlil_reg_if_modules is used to register an interface module for an interface family that hasn't been registered yet. dlil_reg_proto_module is for registering a function to attach a protocol to an interface. Unless you are support a new protocol over an existing interface family or an existing protocol over a new interface family, you don't need this. -josh On Mar 8, 2005, at 3:28 PM, Carl Smith wrote:
After some research I have come up, from some other examples, three ways to do filtering via a NKE.
What I want to do is be a DNKE between the interface family and the Network Driver layer.
The first method that I can extract is from SharedIP, which goes something like
// for filter type 1
dlil_find_dltag()
dlil_attach_protocol_filter()
// for filter type 2
dlil_find_dltag();
dlil_attach_protocol_filter()
dlil_inject_pr_input()
In the above I was thinking maybe I would want to use dlil_attach_interface_filter in place of the dlil_attach_protocol_filter to get myself wedged in the correct spot.
Another method I found was:
dlil_reg_if_modules()
The above function inputs functions pointers to:
my_add_proto()
my_del_proto()
dlil_reg_proto_module()
The above function has function pointers to:
my _inet_attach
dlil_attach_protocol()
my_inet_detach
dlil_detach_protocol()
And the final approach I was thinking of was:
// get an interface structure
dlil_if_acquire()
// register the interface
dlil_if_attach()
// attach the protocol
dlil_plumb_protocol() // a little fuzzy on what this function does
dlil_if_detach()
dlil_if_release()
This final approach I happened to notice was a similar approach that the object IOEthernetInterface uses.
So my question to all, what is the consensus as to what might be the best path to approach for my particular need?
Thanks
da _______________________________________________ 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/ jgraessley%40apple.com
This email sent to jgraessley@apple.com
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... This email sent to site_archiver@lists.apple.com