diff options
author | sam <sam@FreeBSD.org> | 2005-06-05 20:52:14 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-06-05 20:52:14 +0000 |
commit | 2b0ba7bae5b60321ee7843871a2cf15ad6b3f65b (patch) | |
tree | 98be326632e2ea3857ee0d9f831c91ea0823bb0d /contrib/wpa_supplicant/l2_packet.h | |
download | FreeBSD-src-2b0ba7bae5b60321ee7843871a2cf15ad6b3f65b.zip FreeBSD-src-2b0ba7bae5b60321ee7843871a2cf15ad6b3f65b.tar.gz |
Stripped down import of wpa_supplicant v0.3.8
Diffstat (limited to 'contrib/wpa_supplicant/l2_packet.h')
-rw-r--r-- | contrib/wpa_supplicant/l2_packet.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/contrib/wpa_supplicant/l2_packet.h b/contrib/wpa_supplicant/l2_packet.h new file mode 100644 index 0000000..3e3914c --- /dev/null +++ b/contrib/wpa_supplicant/l2_packet.h @@ -0,0 +1,34 @@ +#ifndef L2_PACKET_H +#define L2_PACKET_H + +#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] +#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" + +#ifndef ETH_P_EAPOL +#define ETH_P_EAPOL 0x888e +#endif + +#ifndef ETH_P_RSN_PREAUTH +#define ETH_P_RSN_PREAUTH 0x88c7 +#endif + +struct l2_packet_data; + +struct l2_ethhdr { + u8 h_dest[ETH_ALEN]; + u8 h_source[ETH_ALEN]; + u16 h_proto; +} __attribute__ ((packed)); + +struct l2_packet_data * l2_packet_init( + const char *ifname, const u8 *own_addr, unsigned short protocol, + void (*rx_callback)(void *ctx, unsigned char *src_addr, + unsigned char *buf, size_t len), + void *rx_callback_ctx); +void l2_packet_deinit(struct l2_packet_data *l2); + +int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr); +int l2_packet_send(struct l2_packet_data *l2, u8 *buf, size_t len); +void l2_packet_set_rx_l2_hdr(struct l2_packet_data *l2, int rx_l2_hdr); + +#endif /* L2_PACKET_H */ |