8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / cmd-inet / usr.lib / wpad / l2_packet.h
blobec7ccdb20d6f389dac497360390e8342028d6c2d
1 /*
2 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 /*
7 * Copyright (c) 2003-2004, Jouni Malinen <jkmaline@cc.hut.fi>
8 * Sun elects to license this software under the BSD license.
9 * See README for more details.
11 #ifndef __L2_PACKET_H
12 #define __L2_PACKET_H
14 #pragma ident "%Z%%M% %I% %E% SMI"
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 #include <sys/types.h>
21 #include <net/if.h>
22 #include <libdlpi.h>
24 #define IEEE80211_MTU_MAX 2304
26 struct l2_packet_data {
27 dlpi_handle_t dh; /* dlpi handle for EAPOL frames */
28 char ifname[DLPI_LINKNAME_MAX];
29 uint8_t own_addr[IEEE80211_ADDR_LEN];
30 void (*rx_callback)(void *, unsigned char *,
31 unsigned char *, size_t);
32 void *rx_callback_ctx;
35 #pragma pack(1)
36 struct l2_ethhdr {
37 uint8_t h_dest[IEEE80211_ADDR_LEN];
38 uint8_t h_source[IEEE80211_ADDR_LEN];
39 uint16_t h_proto;
41 #pragma pack()
43 struct l2_packet_data *l2_packet_init(
44 const char *, unsigned short,
45 void (*rx_callback)(void *, unsigned char *,
46 unsigned char *, size_t),
47 void *);
48 void l2_packet_deinit(struct l2_packet_data *);
50 int l2_packet_get_own_addr(struct l2_packet_data *, uint8_t *);
51 int l2_packet_send(struct l2_packet_data *, uint8_t *, size_t);
53 #ifdef __cplusplus
55 #endif
57 #endif /* __L2_PACKET_H */