wpa_supplicant / hostapd 2.0

l2_packet.h

Go to the documentation of this file.
00001 
00016 #ifndef L2_PACKET_H
00017 #define L2_PACKET_H
00018 
00028 struct l2_packet_data;
00029 
00030 #ifdef _MSC_VER
00031 #pragma pack(push, 1)
00032 #endif /* _MSC_VER */
00033 
00034 struct l2_ethhdr {
00035         u8 h_dest[ETH_ALEN];
00036         u8 h_source[ETH_ALEN];
00037         be16 h_proto;
00038 } STRUCT_PACKED;
00039 
00040 #ifdef _MSC_VER
00041 #pragma pack(pop)
00042 #endif /* _MSC_VER */
00043 
00062 struct l2_packet_data * l2_packet_init(
00063         const char *ifname, const u8 *own_addr, unsigned short protocol,
00064         void (*rx_callback)(void *ctx, const u8 *src_addr,
00065                             const u8 *buf, size_t len),
00066         void *rx_callback_ctx, int l2_hdr);
00067 
00073 void l2_packet_deinit(struct l2_packet_data *l2);
00074 
00082 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr);
00083 
00097 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto,
00098                    const u8 *buf, size_t len);
00099 
00115 int l2_packet_get_ip_addr(struct l2_packet_data *l2, char *buf, size_t len);
00116 
00117 
00130 void l2_packet_notify_auth_start(struct l2_packet_data *l2);
00131 
00132 #endif /* L2_PACKET_H */
00133 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines