Re: Interface filtering
Re: Interface filtering
- Subject: Re: Interface filtering
- From: Justin Walker <email@hidden>
- Date: Mon, 11 Apr 2005 16:49:30 -0700
On Apr 11, 2005, at 16:23, Carl Smith wrote:
I have my Ethernet interface filtering in place and am trapping the
packets as they come through the interface filter, I was just wondering
if there was some way to tell which packets from the interface may be
from a wireless connection or not?
Since you are using an interface filter, then the packets you get from
a specific interface are either all from a wireless connection, or none
are. Perhaps I am missing the point of your question.
In my filter I am passed a struct ifnet and the mbuf. I see that in the
struct ifnet it gives me the interface name, i.e. 'en', 'lo' and so on,
and with this I was just wondering if there is some variable in the
struct that might also tell me if it is wireless or not.
There is nothing in the name that will give you a hint, and all will
identified as ethernet, at the "BSD network device" layer.
There is probably a mechanism available to distinguish wireless devices
from others, at the IOKit layer, but I don't know what it is (perhaps
the archives will tell). There is provision for maintaining this info
at the BSD/network layer (the if_data substructure of the ifnet
structure), but I don't know that this is ever filled in, and in any
case, this would be done by the driver, so I can't say you can count on
it.
Anyone else?
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
"Weaseling out of things is what separates us from the animals.
Well, except the weasel."
- Homer J Simpson
--------
_______________________________________________
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