tcpdump mailing list archives

Re: Dealing with pcap-linux.c


From: Darren Reed <Darren.Reed () Sun COM>
Date: Mon, 27 Jul 2009 14:14:09 -0700

On 27/07/09 12:48 PM, Guy Harris wrote:

On Jul 27, 2009, at 11:40 AM, Guy Harris wrote:

The code to use PF_PACKET and PF_INET/SOCK_PACKET sockets *does* have to translate the ARPHRD_ values Linux returns to DLT_ values; that's not a lot of code, and is only minimally involved with Linux's ARP implementation - many of the ARPHRD_ values are not, in fact, ARP hardware types, as not all network types supported by Linux *have* ARP hardware types.

...and if your intent with the PF_PACKET implementation is to provide source compatibility for applications written for Linux's PF_PACKET, including PF_PACKET/SOCK_RAW, you'll have to implement the SIOCGIFHWADDR ioctl, complete with the sa_family field in the address being a Linux ARPHRD_ type (you could choose your own values for ones that don't correspond to ARP hardware types, but you probably wouldn't want to in most cases), so libpcap could and probably should use the same code as it does on Linux for dealing with them.

Hmm!

Nothing like a new name space to use because we don't have enough already
that cover the same thing.

Darren

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


Current thread: