tcpdump mailing list archives

Re: Obtaining interface IP address and MAC address with libpcap


From: Guy Harris <guy () alum mit edu>
Date: Mon, 24 Jan 2011 11:22:27 -0800


On Jan 24, 2011, at 3:49 AM, roy hills wrote:

Does libpcap allow me to get the interface IP address

Yes - use pcap_findalldevs() and look for the interface in question; note, however, that you really mean "the 
interface's IP addresses", plural, as an interface could have more than one IPv4 address and/or more than one IPv6 
address.

and MAC address?

No.

If it's not currently supported, is this something that is planned for a future release?

I'm not sure I'd use the word "planned", as there isn't a formal plan, but I'd like to provide an API to provide that 
in the future.-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: