tcpdump mailing list archives

Obtaining interface IP address and MAC address with libpcap


From: roy hills <royhills () hotmail com>
Date: Mon, 24 Jan 2011 11:49:22 +0000


I maintain an application that uses libpcap to receive frames, and uses its own link-specific functions to obtain 
interface details and send frames.  I currently support packet socket (Linux), BPF (BSD) and DLPI (Solaris).

I'd like to use libpcap to send as well as receive frames, and notice that libpcap supports pcap_sendpacket() and 
pcap_inject() to do this.  But I can't find any portable way to obtain the interface IP address and MAC address.

Does libpcap allow me to get the interface IP address and MAC address?  If it's not currently supported, is this 
something that is planned for a future release?

                                          -
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: