Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef L2_PACKET_H
00022 #define L2_PACKET_H
00023
00032 struct l2_packet_data;
00033
00034 #ifdef _MSC_VER
00035 #pragma pack(push, 1)
00036 #endif
00037
00038 struct l2_ethhdr {
00039 u8 h_dest[ETH_ALEN];
00040 u8 h_source[ETH_ALEN];
00041 be16 h_proto;
00042 } STRUCT_PACKED;
00043
00044 #ifdef _MSC_VER
00045 #pragma pack(pop)
00046 #endif
00047
00065 struct l2_packet_data * l2_packet_init(
00066 const char *ifname, const u8 *own_addr, unsigned short protocol,
00067 void (*rx_callback)(void *ctx, const u8 *src_addr,
00068 const u8 *buf, size_t len),
00069 void *rx_callback_ctx, int l2_hdr);
00070
00075 void l2_packet_deinit(struct l2_packet_data *l2);
00076
00083 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr);
00084
00097 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto,
00098 const u8 *buf, size_t len);
00099
00114 int l2_packet_get_ip_addr(struct l2_packet_data *l2, char *buf, size_t len);
00115
00116
00128 void l2_packet_notify_auth_start(struct l2_packet_data *l2);
00129
00130 #endif