POSIX PCAP: Platform agnostic MAC address discovery

This commit is contained in:
Paul Hollinsky
2019-05-06 13:48:42 -04:00
parent ea8e6e6316
commit 4e0ed09d71
4 changed files with 35 additions and 4 deletions
@@ -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