Merge from vendor branch OPENSSL:
[dragonfly.git] / sys / netproto / 802_11 / wlan / ieee80211_proto.h
1 /*
2  * Copyright (c) 2001 Atsushi Onoe
3  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. The name of the author may not be used to endorse or promote products
15  *    derived from this software without specific prior written permission.
16  *
17  * Alternatively, this software may be distributed under the terms of the
18  * GNU General Public License ("GPL") version 2 as published by the Free
19  * Software Foundation.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * $FreeBSD: src/sys/net80211/ieee80211_proto.h,v 1.4 2003/08/19 22:17:03 sam Exp $
33  * $DragonFly: src/sys/netproto/802_11/wlan/Attic/ieee80211_proto.h,v 1.1 2004/07/26 16:30:17 joerg Exp $
34  */
35
36 #ifndef _NETPROTO_802_11_IEEE80211_PROTO_H_
37 #define _NETPROTO_802_11_IEEE80211_PROTO_H_
38
39 /*
40  * 802.11 protocol implementation definitions.
41  */
42
43 enum ieee80211_state {
44         IEEE80211_S_INIT        = 0,    /* default state */
45         IEEE80211_S_SCAN        = 1,    /* scanning */
46         IEEE80211_S_AUTH        = 2,    /* try to authenticate */
47         IEEE80211_S_ASSOC       = 3,    /* try to assoc */
48         IEEE80211_S_RUN         = 4,    /* associated */
49 };
50 #define IEEE80211_S_MAX         (IEEE80211_S_RUN+1)
51
52 #define IEEE80211_SEND_MGMT(_ic,_ni,_type,_arg) \
53         ((*(_ic)->ic_send_mgmt)(_ic, _ni, _type, _arg))
54
55 extern  const char *ieee80211_mgt_subtype_name[];
56
57 extern  void ieee80211_proto_attach(struct ifnet *);
58 extern  void ieee80211_proto_detach(struct ifnet *);
59
60 struct ieee80211_node;
61 extern  void ieee80211_input(struct ifnet *, struct mbuf *,
62                 struct ieee80211_node *, int, uint32_t);
63 extern  void ieee80211_recv_mgmt(struct ieee80211com *, struct mbuf *,
64                 struct ieee80211_node *, int, int, uint32_t);
65 extern  int ieee80211_send_mgmt(struct ieee80211com *, struct ieee80211_node *,
66                 int, int);
67 extern  struct mbuf *ieee80211_encap(struct ifnet *, struct mbuf *,
68                 struct ieee80211_node **);
69 extern  struct mbuf *ieee80211_decap(struct ifnet *, struct mbuf *);
70 extern  uint8_t *ieee80211_add_rates(uint8_t *frm,
71                 const struct ieee80211_rateset *);
72 #define ieee80211_new_state(_ic, _nstate, _arg) \
73         (((_ic)->ic_newstate)((_ic), (_nstate), (_arg)))
74 extern  uint8_t *ieee80211_add_xrates(uint8_t *frm,
75                 const struct ieee80211_rateset *);
76 extern  void ieee80211_print_essid(uint8_t *, int);
77 extern  void ieee80211_dump_pkt(uint8_t *, int, int, int);
78
79 extern  const char *ieee80211_state_name[IEEE80211_S_MAX];
80 #endif /* _NETPROTO_802_11_IEEE80211_PROTO_H_ */