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