tcpdump mailing list archives
Re: Re: [WinPcap-users] MAC ADDRESS pcap_if_t
From: "Loris Degioanni" <loris () netgroup-serv polito it>
Date: Wed, 6 Aug 2003 12:23:04 +0200
Hi, ...
I'd been thinking about adding some other per-interface information, and decided that if I do that, the right way to do it would be to add a "pcap_findalldevs_proplist()", or something such as that, with the "pcap_if_t" structure replaced by a structure containing a "next" pointer, a possibly-empty set of hard-wired properties, and either a chunk of memory containing a list of properties as an attribute/value list, along with the length of that chunk of memory, or a linked list of those properties - with network-layer addresses (IPv4 and possibly IPv6, at least) being among those properties.
Note that I'm adding support for IPv6 addresses under Win32 and I'm not having having too many difficulties with the current pcap_if. I simply put the IPv6 address inside a sockaddr_storage and then cast it to a sockaddr to put it in the address list.
That way, to add a new property, we'd just define a new numerical value for the property, and add it to the list. Programs that know about the new property just won't get that property when run with the old library; they should be prepared not to get that property, and fail or work around the absence of the new property. Programs that don't know about a particular property should just ignore it.
I find this a good idea. It has the value of being very generic and versatile. Moreover it allows to define properties that are specific of particular OS or that are not provided by every OS supported by libpcap. The only drawback that I see is that parsing the interface list starts to become a quite complex operation for the average programmer that builds a small tool using libpcap: one hat to scan the list, interpret the properties, handle the situation in which the needed property isn't present... Probably some auxiliary function (like for example "search_property") should be provided to make life esier. Loris - This is the TCPDUMP workers list. It is archived at http://www.tcpdump.org/lists/workers/index.html To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe
Current thread:
- Re: [WinPcap-users] MAC ADDRESS pcap_if_t Guy Harris (Aug 15)
- Re: Re: [WinPcap-users] MAC ADDRESS pcap_if_t Loris Degioanni (Aug 15)
- RE: Re: [WinPcap-users] MAC ADDRESS pcap_if_t Fulvio Risso (Aug 18)