]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/wpa_supplicant/l2_packet.h
This commit was generated by cvs2svn to compensate for changes in r149749,
[FreeBSD/FreeBSD.git] / contrib / wpa_supplicant / l2_packet.h
1 #ifndef L2_PACKET_H
2 #define L2_PACKET_H
3
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"
6
7 #ifndef ETH_P_EAPOL
8 #define ETH_P_EAPOL 0x888e
9 #endif
10
11 #ifndef ETH_P_RSN_PREAUTH
12 #define ETH_P_RSN_PREAUTH 0x88c7
13 #endif
14
15 struct l2_packet_data;
16
17 struct l2_ethhdr {
18         u8 h_dest[ETH_ALEN];
19         u8 h_source[ETH_ALEN];
20         u16 h_proto;
21 } __attribute__ ((packed));
22
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);
29
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);
33
34 #endif /* L2_PACKET_H */