mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
POSIX PCAP: Platform agnostic MAC address discovery
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#ifndef __MACADDR_LINUX_H_
|
||||
#define __MACADDR_LINUX_H_
|
||||
|
||||
#include <netpacket/packet.h>
|
||||
|
||||
#define ICSNEO_AF_MACADDR (AF_PACKET)
|
||||
|
||||
// Points towards the first byte of the MAC address, given a sockaddr*
|
||||
#define PLATFORM_MAC_FROM_SOCKADDR(SADDR) (((struct sockaddr_ll*)SADDR)->sll_addr)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user