4 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
5 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
8 #define ETH_P_EAPOL 0x888e
11 #ifndef ETH_P_RSN_PREAUTH
12 #define ETH_P_RSN_PREAUTH 0x88c7
15 struct l2_packet_data;
19 u8 h_source[ETH_ALEN];
21 } __attribute__ ((packed));
23 struct l2_packet_data * l2_packet_init(
24 const char *ifname, const u8 *own_addr, unsigned short protocol,
25 void (*rx_callback)(void *ctx, unsigned char *src_addr,
26 unsigned char *buf, size_t len),
27 void *rx_callback_ctx);
28 void l2_packet_deinit(struct l2_packet_data *l2);
30 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr);
31 int l2_packet_send(struct l2_packet_data *l2, u8 *buf, size_t len);
32 void l2_packet_set_rx_l2_hdr(struct l2_packet_data *l2, int rx_l2_hdr);
34 #endif /* L2_PACKET_H */