123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #ifndef __NETINET_IF_ETHER_H
- #define __NETINET_IF_ETHER_H 1
- #include <features.h>
- #include <sys/types.h>
- #include <linux/if_ether.h>
- #ifdef __USE_BSD
- #include <net/ethernet.h>
- #include <net/if_arp.h>
- __BEGIN_DECLS
- struct ether_arp {
- struct arphdr ea_hdr;
- u_int8_t arp_sha[ETH_ALEN];
- u_int8_t arp_spa[4];
- u_int8_t arp_tha[ETH_ALEN];
- u_int8_t arp_tpa[4];
- };
- #define arp_hrd ea_hdr.ar_hrd
- #define arp_pro ea_hdr.ar_pro
- #define arp_hln ea_hdr.ar_hln
- #define arp_pln ea_hdr.ar_pln
- #define arp_op ea_hdr.ar_op
- #define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
- \
- \
- { \
- (enaddr)[0] = 0x01; \
- (enaddr)[1] = 0x00; \
- (enaddr)[2] = 0x5e; \
- (enaddr)[3] = ((u_int8_t *)ipaddr)[1] & 0x7f; \
- (enaddr)[4] = ((u_int8_t *)ipaddr)[2]; \
- (enaddr)[5] = ((u_int8_t *)ipaddr)[3]; \
- }
- __END_DECLS
- #endif
- #endif
|