ieee80211_proto.h revision 116742
1/*-
2 * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/net80211/ieee80211_proto.h 116742 2003-06-23 16:55:01Z sam $
27 */
28#ifndef _NET80211_IEEE80211_PROTO_H_
29#define _NET80211_IEEE80211_PROTO_H_
30
31/*
32 * 802.11 protocol implementation definitions.
33 */
34
35enum ieee80211_state {
36	IEEE80211_S_INIT,		/* default state */
37	IEEE80211_S_SCAN,		/* scanning */
38	IEEE80211_S_AUTH,		/* try to authenticate */
39	IEEE80211_S_ASSOC,		/* try to assoc */
40	IEEE80211_S_RUN			/* associated */
41};
42
43#define	IEEE80211_SEND_MGMT(_ic,_ni,_type,_arg) \
44	((*(_ic)->ic_send_mgmt)(_ic, _ni, _type, _arg))
45
46extern	const char *ieee80211_mgt_subtype_name[];
47
48extern	void ieee80211_proto_attach(struct ifnet *);
49extern	void ieee80211_proto_detach(struct ifnet *);
50
51extern	void ieee80211_input(struct ifnet *, struct mbuf *,
52		int, u_int32_t, u_int);
53extern	void ieee80211_recv_mgmt(struct ieee80211com *, struct mbuf *, int,
54		int, u_int32_t, u_int);
55extern	int ieee80211_send_mgmt(struct ieee80211com *, struct ieee80211_node *,
56		int, int);
57extern	int ieee80211_mgmt_output(struct ifnet *, struct ieee80211_node *,
58		struct mbuf *, int);
59extern	struct mbuf *ieee80211_encap(struct ifnet *, struct mbuf *);
60extern	struct mbuf *ieee80211_decap(struct ifnet *, struct mbuf *);
61extern	u_int8_t *ieee80211_add_rates(u_int8_t *frm,
62		const struct ieee80211_rateset *);
63extern	u_int8_t *ieee80211_add_xrates(u_int8_t *frm,
64		const struct ieee80211_rateset *);
65extern	int ieee80211_new_state(struct ifnet *, enum ieee80211_state, int);
66extern	void ieee80211_print_essid(u_int8_t *, int);
67extern	void ieee80211_dump_pkt(u_int8_t *, int, int, int);
68#endif /* _NET80211_IEEE80211_PROTO_H_ */
69