Re: DLIL filtering on NKE
Re: DLIL filtering on NKE
- Subject: Re: DLIL filtering on NKE
- From: Josh Graessley <email@hidden>
- Date: Tue, 8 Mar 2005 15:48:14 -0800
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden