Q: Extract hardware address from received datagram?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

is there any possibility to read the hardware address (MAC) of the remote machine from received PF_INET/SOCK_DGRAM packets?

I want to write an application which opens a datagram socket, binds it to a specific port and receives broadcast messages. The sending machine is not necessarily in the same net segment. It is of course easy to get the remote ip address, but I also need the in the information in the packet header, in particular the 6-byte hardware (MAC) address of the sending machine. Apparently /proc/net/arp does not contain any information extracted from such packets.

Any idea how I could get this information? Any pointer/example?

Thanks in advance
Cheers

Albrecht

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Albrecht Dreß  -  Johanna-Kirchner-Straße 13  -  D-53123 Bonn (Germany)
       Phone (+49) 228 6199571  -  mailto:albrecht.dress@xxxxxxxx
   GnuPG public key:  http://home.arcor.de/dralbrecht.dress/pubkey.asc
_________________________________________________________________________

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux