ieee80211_node.h (170360) | ieee80211_node.h (170530) |
---|---|
1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2007 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 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2007 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 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/net80211/ieee80211_node.h 170360 2007-06-06 04:56:04Z sam $ | 26 * $FreeBSD: head/sys/net80211/ieee80211_node.h 170530 2007-06-11 03:36:55Z sam $ |
27 */ 28#ifndef _NET80211_IEEE80211_NODE_H_ 29#define _NET80211_IEEE80211_NODE_H_ 30 31#include <net80211/ieee80211_ioctl.h> /* for ieee80211_nodestats */ | 27 */ 28#ifndef _NET80211_IEEE80211_NODE_H_ 29#define _NET80211_IEEE80211_NODE_H_ 30 31#include <net80211/ieee80211_ioctl.h> /* for ieee80211_nodestats */ |
32#include <net80211/ieee80211_ht.h> /* for aggregation state */ |
|
32 33/* 34 * Each ieee80211com instance has a single timer that fires once a 35 * second. This is used to initiate various work depending on the 36 * state of the instance: scanning (passive or active), ``transition'' 37 * (waiting for a response to a management frame when operating 38 * as a station), and node inactivity processing (when operating 39 * as an AP). For inactivity processing each node has a timeout --- 7 unchanged lines hidden (view full) --- 47 */ 48#define IEEE80211_INACT_WAIT 15 /* inactivity interval (secs) */ 49#define IEEE80211_INACT_INIT (30/IEEE80211_INACT_WAIT) /* initial */ 50#define IEEE80211_INACT_AUTH (180/IEEE80211_INACT_WAIT) /* associated but not authorized */ 51#define IEEE80211_INACT_RUN (300/IEEE80211_INACT_WAIT) /* authorized */ 52#define IEEE80211_INACT_PROBE (30/IEEE80211_INACT_WAIT) /* probe */ 53#define IEEE80211_INACT_SCAN (300/IEEE80211_INACT_WAIT) /* scanned */ 54 | 33 34/* 35 * Each ieee80211com instance has a single timer that fires once a 36 * second. This is used to initiate various work depending on the 37 * state of the instance: scanning (passive or active), ``transition'' 38 * (waiting for a response to a management frame when operating 39 * as a station), and node inactivity processing (when operating 40 * as an AP). For inactivity processing each node has a timeout --- 7 unchanged lines hidden (view full) --- 48 */ 49#define IEEE80211_INACT_WAIT 15 /* inactivity interval (secs) */ 50#define IEEE80211_INACT_INIT (30/IEEE80211_INACT_WAIT) /* initial */ 51#define IEEE80211_INACT_AUTH (180/IEEE80211_INACT_WAIT) /* associated but not authorized */ 52#define IEEE80211_INACT_RUN (300/IEEE80211_INACT_WAIT) /* authorized */ 53#define IEEE80211_INACT_PROBE (30/IEEE80211_INACT_WAIT) /* probe */ 54#define IEEE80211_INACT_SCAN (300/IEEE80211_INACT_WAIT) /* scanned */ 55 |
55#define IEEE80211_TRANS_WAIT 5 /* mgt frame tx timer (secs) */ | 56#define IEEE80211_TRANS_WAIT 2 /* mgt frame tx timer (secs) */ |
56 57#define IEEE80211_NODE_HASHSIZE 32 58/* simple hash is enough for variation of macaddr */ 59#define IEEE80211_NODE_HASH(addr) \ | 57 58#define IEEE80211_NODE_HASHSIZE 32 59/* simple hash is enough for variation of macaddr */ 60#define IEEE80211_NODE_HASH(addr) \ |
60 (((const u_int8_t *)(addr))[IEEE80211_ADDR_LEN - 1] % \ | 61 (((const uint8_t *)(addr))[IEEE80211_ADDR_LEN - 1] % \ |
61 IEEE80211_NODE_HASHSIZE) 62 63struct ieee80211_rsnparms { | 62 IEEE80211_NODE_HASHSIZE) 63 64struct ieee80211_rsnparms { |
64 u_int8_t rsn_mcastcipher; /* mcast/group cipher */ 65 u_int8_t rsn_mcastkeylen; /* mcast key length */ 66 u_int8_t rsn_ucastcipherset; /* unicast cipher set */ 67 u_int8_t rsn_ucastcipher; /* selected unicast cipher */ 68 u_int8_t rsn_ucastkeylen; /* unicast key length */ 69 u_int8_t rsn_keymgmtset; /* key mangement algorithms */ 70 u_int8_t rsn_keymgmt; /* selected key mgmt algo */ 71 u_int16_t rsn_caps; /* capabilities */ | 65 uint8_t rsn_mcastcipher; /* mcast/group cipher */ 66 uint8_t rsn_mcastkeylen; /* mcast key length */ 67 uint8_t rsn_ucastcipherset; /* unicast cipher set */ 68 uint8_t rsn_ucastcipher; /* selected unicast cipher */ 69 uint8_t rsn_ucastkeylen; /* unicast key length */ 70 uint8_t rsn_keymgmtset; /* key mangement algorithms */ 71 uint8_t rsn_keymgmt; /* selected key mgmt algo */ 72 uint16_t rsn_caps; /* capabilities */ |
72}; 73 74struct ieee80211_node_table; 75struct ieee80211com; 76 77/* 78 * Node specific information. Note that drivers are expected 79 * to derive from this structure to add device-specific per-node 80 * state. This is done by overriding the ic_node_* methods in 81 * the ieee80211com structure. 82 */ 83struct ieee80211_node { 84 struct ieee80211com *ni_ic; 85 struct ieee80211_node_table *ni_table; 86 TAILQ_ENTRY(ieee80211_node) ni_list; 87 LIST_ENTRY(ieee80211_node) ni_hash; 88 u_int ni_refcnt; 89 u_int ni_scangen; /* gen# for timeout scan */ | 73}; 74 75struct ieee80211_node_table; 76struct ieee80211com; 77 78/* 79 * Node specific information. Note that drivers are expected 80 * to derive from this structure to add device-specific per-node 81 * state. This is done by overriding the ic_node_* methods in 82 * the ieee80211com structure. 83 */ 84struct ieee80211_node { 85 struct ieee80211com *ni_ic; 86 struct ieee80211_node_table *ni_table; 87 TAILQ_ENTRY(ieee80211_node) ni_list; 88 LIST_ENTRY(ieee80211_node) ni_hash; 89 u_int ni_refcnt; 90 u_int ni_scangen; /* gen# for timeout scan */ |
90 u_int8_t ni_authmode; /* authentication algorithm */ 91 u_int16_t ni_flags; /* special-purpose state */ | 91 uint8_t ni_authmode; /* authentication algorithm */ 92 uint8_t ni_ath_flags; /* Atheros feature flags */ 93 /* NB: These must have the same values as IEEE80211_ATHC_* */ 94#define IEEE80211_NODE_TURBOP 0x0001 /* Turbo prime enable */ 95#define IEEE80211_NODE_COMP 0x0002 /* Compresssion enable */ 96#define IEEE80211_NODE_FF 0x0004 /* Fast Frame capable */ 97#define IEEE80211_NODE_XR 0x0008 /* Atheros WME enable */ 98#define IEEE80211_NODE_AR 0x0010 /* AR capable */ 99#define IEEE80211_NODE_BOOST 0x0080 100#define IEEE80211_NODE_PSUPDATE 0x0200 /* power save state changed */ 101#define IEEE80211_NODE_CHWUPDATE 0x0400 /* 11n channel width change */ 102 uint16_t ni_flags; /* special-purpose state */ |
92#define IEEE80211_NODE_AUTH 0x0001 /* authorized for data */ 93#define IEEE80211_NODE_QOS 0x0002 /* QoS enabled */ 94#define IEEE80211_NODE_ERP 0x0004 /* ERP enabled */ 95/* NB: this must have the same value as IEEE80211_FC1_PWR_MGT */ 96#define IEEE80211_NODE_PWR_MGT 0x0010 /* power save mode enabled */ 97#define IEEE80211_NODE_AREF 0x0020 /* authentication ref held */ | 103#define IEEE80211_NODE_AUTH 0x0001 /* authorized for data */ 104#define IEEE80211_NODE_QOS 0x0002 /* QoS enabled */ 105#define IEEE80211_NODE_ERP 0x0004 /* ERP enabled */ 106/* NB: this must have the same value as IEEE80211_FC1_PWR_MGT */ 107#define IEEE80211_NODE_PWR_MGT 0x0010 /* power save mode enabled */ 108#define IEEE80211_NODE_AREF 0x0020 /* authentication ref held */ |
98 u_int16_t ni_associd; /* assoc response */ 99 u_int16_t ni_txpower; /* current transmit power */ 100 u_int16_t ni_vlan; /* vlan tag */ 101 u_int32_t *ni_challenge; /* shared-key challenge */ 102 u_int8_t *ni_wpa_ie; /* captured WPA/RSN ie */ 103 u_int8_t *ni_wme_ie; /* captured WME ie */ | 109#define IEEE80211_NODE_HT 0x0040 /* HT enabled */ 110#define IEEE80211_NODE_HTCOMPAT 0x0080 /* HT setup w/ vendor OUI's */ 111 uint16_t ni_ath_defkeyix;/* Atheros def key index */ 112 uint16_t ni_associd; /* assoc response */ 113 uint16_t ni_txpower; /* current transmit power */ 114 uint16_t ni_vlan; /* vlan tag */ 115 uint32_t *ni_challenge; /* shared-key challenge */ 116 uint8_t *ni_wpa_ie; /* captured WPA ie */ 117 uint8_t *ni_rsn_ie; /* captured RSN ie */ 118 uint8_t *ni_wme_ie; /* captured WME ie */ 119 uint8_t *ni_ath_ie; /* captured Atheros ie */ |
104#define IEEE80211_NONQOS_TID 16 /* index for non-QoS sta */ | 120#define IEEE80211_NONQOS_TID 16 /* index for non-QoS sta */ |
105 u_int16_t ni_txseqs[17]; /* tx seq per-tid */ 106 u_int16_t ni_rxseqs[17]; /* rx seq previous per-tid*/ 107 u_int32_t ni_rxfragstamp; /* time stamp of last rx frag */ | 121 uint16_t ni_txseqs[17]; /* tx seq per-tid */ 122 uint16_t ni_rxseqs[17]; /* rx seq previous per-tid*/ 123 uint32_t ni_rxfragstamp; /* time stamp of last rx frag */ |
108 struct mbuf *ni_rxfrag[3]; /* rx frag reassembly */ 109 struct ieee80211_rsnparms ni_rsn; /* RSN/WPA parameters */ 110 struct ieee80211_key ni_ucastkey; /* unicast key */ 111 112 /* hardware */ | 124 struct mbuf *ni_rxfrag[3]; /* rx frag reassembly */ 125 struct ieee80211_rsnparms ni_rsn; /* RSN/WPA parameters */ 126 struct ieee80211_key ni_ucastkey; /* unicast key */ 127 128 /* hardware */ |
113 u_int32_t ni_rstamp; /* recv timestamp */ 114 u_int8_t ni_rssi; /* recv ssi */ | 129 uint32_t ni_rstamp; /* recv timestamp */ 130 int8_t ni_rssi; /* recv ssi */ 131 int8_t ni_noise; /* noise floor */ |
115 116 /* header */ | 132 133 /* header */ |
117 u_int8_t ni_macaddr[IEEE80211_ADDR_LEN]; 118 u_int8_t ni_bssid[IEEE80211_ADDR_LEN]; | 134 uint8_t ni_macaddr[IEEE80211_ADDR_LEN]; 135 uint8_t ni_bssid[IEEE80211_ADDR_LEN]; |
119 120 /* beacon, probe response */ 121 union { | 136 137 /* beacon, probe response */ 138 union { |
122 u_int8_t data[8]; 123 u_int64_t tsf; | 139 uint8_t data[8]; 140 uint64_t tsf; |
124 } ni_tstamp; /* from last rcv'd beacon */ | 141 } ni_tstamp; /* from last rcv'd beacon */ |
125 u_int16_t ni_intval; /* beacon interval */ 126 u_int16_t ni_capinfo; /* capabilities */ 127 u_int8_t ni_esslen; 128 u_int8_t ni_essid[IEEE80211_NWID_LEN]; | 142 uint16_t ni_intval; /* beacon interval */ 143 uint16_t ni_capinfo; /* capabilities */ 144 uint8_t ni_esslen; 145 uint8_t ni_essid[IEEE80211_NWID_LEN]; |
129 struct ieee80211_rateset ni_rates; /* negotiated rate set */ | 146 struct ieee80211_rateset ni_rates; /* negotiated rate set */ |
130 struct ieee80211_channel *ni_chan; /* XXX multiple uses */ 131 u_int16_t ni_fhdwell; /* FH only */ 132 u_int8_t ni_fhindex; /* FH only */ 133 u_int8_t ni_erp; /* ERP from beacon/probe resp */ 134 u_int16_t ni_timoff; /* byte offset to TIM ie */ 135 u_int8_t ni_dtim_period; /* DTIM period */ 136 u_int8_t ni_dtim_count; /* DTIM count for last bcn */ | 147 struct ieee80211_channel *ni_chan; 148 uint16_t ni_fhdwell; /* FH only */ 149 uint8_t ni_fhindex; /* FH only */ 150 uint8_t ni_erp; /* ERP from beacon/probe resp */ 151 uint16_t ni_timoff; /* byte offset to TIM ie */ 152 uint8_t ni_dtim_period; /* DTIM period */ 153 uint8_t ni_dtim_count; /* DTIM count for last bcn */ |
137 | 154 |
155 /* 11n state */ 156 uint16_t ni_htcap; /* HT capabilities */ 157 uint8_t ni_htparam; /* HT params */ 158 uint8_t ni_htctlchan; /* HT control channel */ 159 uint8_t ni_ht2ndchan; /* HT 2nd channel */ 160 uint8_t ni_htopmode; /* HT operating mode */ 161 uint8_t ni_htstbc; /* HT */ 162 uint8_t ni_reqcw; /* requested tx channel width */ 163 uint8_t ni_chw; /* negotiated channel width */ 164 struct ieee80211_htrateset ni_htrates; /* negotiated ht rate set */ 165 struct ieee80211_tx_ampdu ni_tx_ampdu[WME_NUM_AC]; 166 struct ieee80211_rx_ampdu ni_rx_ampdu[WME_NUM_TID]; 167 |
|
138 /* others */ 139 int ni_fails; /* failure count to associate */ 140 short ni_inact; /* inactivity mark count */ 141 short ni_inact_reload;/* inactivity reload value */ 142 int ni_txrate; /* index to ni_rates[] */ 143 struct ifqueue ni_savedq; /* ps-poll queue */ 144 struct ieee80211_nodestats ni_stats; /* per-node statistics */ 145}; 146MALLOC_DECLARE(M_80211_NODE); 147 | 168 /* others */ 169 int ni_fails; /* failure count to associate */ 170 short ni_inact; /* inactivity mark count */ 171 short ni_inact_reload;/* inactivity reload value */ 172 int ni_txrate; /* index to ni_rates[] */ 173 struct ifqueue ni_savedq; /* ps-poll queue */ 174 struct ieee80211_nodestats ni_stats; /* per-node statistics */ 175}; 176MALLOC_DECLARE(M_80211_NODE); 177 |
178#define IEEE80211_NODE_ATH (IEEE80211_NODE_FF | IEEE80211_NODE_TURBOP) 179 |
|
148#define IEEE80211_NODE_AID(ni) IEEE80211_AID(ni->ni_associd) 149 150#define IEEE80211_NODE_STAT(ni,stat) (ni->ni_stats.ns_##stat++) 151#define IEEE80211_NODE_STAT_ADD(ni,stat,v) (ni->ni_stats.ns_##stat += v) 152#define IEEE80211_NODE_STAT_SET(ni,stat,v) (ni->ni_stats.ns_##stat = v) 153 154static __inline struct ieee80211_node * 155ieee80211_ref_node(struct ieee80211_node *ni) --- 19 unchanged lines hidden (view full) --- 175ieee80211_node_is_authorized(const struct ieee80211_node *ni) 176{ 177 return (ni->ni_flags & IEEE80211_NODE_AUTH); 178} 179 180void ieee80211_node_authorize(struct ieee80211_node *); 181void ieee80211_node_unauthorize(struct ieee80211_node *); 182 | 180#define IEEE80211_NODE_AID(ni) IEEE80211_AID(ni->ni_associd) 181 182#define IEEE80211_NODE_STAT(ni,stat) (ni->ni_stats.ns_##stat++) 183#define IEEE80211_NODE_STAT_ADD(ni,stat,v) (ni->ni_stats.ns_##stat += v) 184#define IEEE80211_NODE_STAT_SET(ni,stat,v) (ni->ni_stats.ns_##stat = v) 185 186static __inline struct ieee80211_node * 187ieee80211_ref_node(struct ieee80211_node *ni) --- 19 unchanged lines hidden (view full) --- 207ieee80211_node_is_authorized(const struct ieee80211_node *ni) 208{ 209 return (ni->ni_flags & IEEE80211_NODE_AUTH); 210} 211 212void ieee80211_node_authorize(struct ieee80211_node *); 213void ieee80211_node_unauthorize(struct ieee80211_node *); 214 |
183void ieee80211_begin_scan(struct ieee80211com *, int); 184int ieee80211_next_scan(struct ieee80211com *); | |
185void ieee80211_probe_curchan(struct ieee80211com *, int); 186void ieee80211_create_ibss(struct ieee80211com*, struct ieee80211_channel *); 187void ieee80211_reset_bss(struct ieee80211com *); | 215void ieee80211_probe_curchan(struct ieee80211com *, int); 216void ieee80211_create_ibss(struct ieee80211com*, struct ieee80211_channel *); 217void ieee80211_reset_bss(struct ieee80211com *); |
188void ieee80211_cancel_scan(struct ieee80211com *); 189void ieee80211_end_scan(struct ieee80211com *); | |
190int ieee80211_ibss_merge(struct ieee80211_node *); | 218int ieee80211_ibss_merge(struct ieee80211_node *); |
191int ieee80211_sta_join(struct ieee80211com *, struct ieee80211_node *); | 219struct ieee80211_scan_entry; 220int ieee80211_sta_join(struct ieee80211com *, 221 const struct ieee80211_scan_entry *); |
192void ieee80211_sta_leave(struct ieee80211com *, struct ieee80211_node *); 193 194/* 195 * Table of ieee80211_node instances. Each ieee80211com 196 * has at least one for holding the scan candidates. 197 * When operating as an access point or in ibss mode there 198 * is a second table for associated stations or neighbors. 199 */ 200struct ieee80211_node_table { 201 struct ieee80211com *nt_ic; /* back reference */ 202 ieee80211_node_lock_t nt_nodelock; /* on node table */ 203 TAILQ_HEAD(, ieee80211_node) nt_node; /* information of all nodes */ 204 LIST_HEAD(, ieee80211_node) nt_hash[IEEE80211_NODE_HASHSIZE]; | 222void ieee80211_sta_leave(struct ieee80211com *, struct ieee80211_node *); 223 224/* 225 * Table of ieee80211_node instances. Each ieee80211com 226 * has at least one for holding the scan candidates. 227 * When operating as an access point or in ibss mode there 228 * is a second table for associated stations or neighbors. 229 */ 230struct ieee80211_node_table { 231 struct ieee80211com *nt_ic; /* back reference */ 232 ieee80211_node_lock_t nt_nodelock; /* on node table */ 233 TAILQ_HEAD(, ieee80211_node) nt_node; /* information of all nodes */ 234 LIST_HEAD(, ieee80211_node) nt_hash[IEEE80211_NODE_HASHSIZE]; |
235 struct ieee80211_node **nt_keyixmap; /* key ix -> node map */ 236 int nt_keyixmax; /* keyixmap size */ |
|
205 const char *nt_name; /* for debugging */ 206 ieee80211_scan_lock_t nt_scanlock; /* on nt_scangen */ 207 u_int nt_scangen; /* gen# for timeout scan */ | 237 const char *nt_name; /* for debugging */ 238 ieee80211_scan_lock_t nt_scanlock; /* on nt_scangen */ 239 u_int nt_scangen; /* gen# for timeout scan */ |
208 int nt_inact_timer; /* inactivity timer */ | |
209 int nt_inact_init; /* initial node inact setting */ | 240 int nt_inact_init; /* initial node inact setting */ |
210 struct ieee80211_node **nt_keyixmap; /* key ix -> node map */ 211 int nt_keyixmax; /* keyixmap size */ 212 213 void (*nt_timeout)(struct ieee80211_node_table *); | |
214}; | 241}; |
215void ieee80211_node_table_reset(struct ieee80211_node_table *); | |
216 217struct ieee80211_node *ieee80211_alloc_node( | 242 243struct ieee80211_node *ieee80211_alloc_node( |
218 struct ieee80211_node_table *, const u_int8_t *); | 244 struct ieee80211_node_table *, const uint8_t *); |
219struct ieee80211_node *ieee80211_tmp_node(struct ieee80211com *, | 245struct ieee80211_node *ieee80211_tmp_node(struct ieee80211com *, |
220 const u_int8_t *macaddr); | 246 const uint8_t *macaddr); |
221struct ieee80211_node *ieee80211_dup_bss(struct ieee80211_node_table *, | 247struct ieee80211_node *ieee80211_dup_bss(struct ieee80211_node_table *, |
222 const u_int8_t *); | 248 const uint8_t *); |
223#ifdef IEEE80211_DEBUG_REFCNT 224void ieee80211_free_node_debug(struct ieee80211_node *, 225 const char *func, int line); | 249#ifdef IEEE80211_DEBUG_REFCNT 250void ieee80211_free_node_debug(struct ieee80211_node *, 251 const char *func, int line); |
226struct ieee80211_node *ieee80211_find_node_debug( 227 struct ieee80211_node_table *, const u_int8_t *, | 252struct ieee80211_node *ieee80211_find_node_debug(struct ieee80211_node_table *, 253 const uint8_t *, |
228 const char *func, int line); | 254 const char *func, int line); |
229struct ieee80211_node * ieee80211_find_rxnode_debug( 230 struct ieee80211com *, const struct ieee80211_frame_min *, | 255struct ieee80211_node * ieee80211_find_rxnode_debug(struct ieee80211com *, 256 const struct ieee80211_frame_min *, |
231 const char *func, int line); 232struct ieee80211_node * ieee80211_find_rxnode_withkey_debug( 233 struct ieee80211com *, | 257 const char *func, int line); 258struct ieee80211_node * ieee80211_find_rxnode_withkey_debug( 259 struct ieee80211com *, |
234 const struct ieee80211_frame_min *, u_int16_t keyix, | 260 const struct ieee80211_frame_min *, uint16_t keyix, |
235 const char *func, int line); | 261 const char *func, int line); |
236struct ieee80211_node *ieee80211_find_txnode_debug( 237 struct ieee80211com *, const u_int8_t *, | 262struct ieee80211_node * ieee80211_find_rxnode_withkey_debug( 263 struct ieee80211com *, 264 const struct ieee80211_frame_min *, uint16_t keyix, |
238 const char *func, int line); | 265 const char *func, int line); |
239struct ieee80211_node *ieee80211_find_node_with_channel_debug( 240 struct ieee80211_node_table *, const u_int8_t *macaddr, 241 struct ieee80211_channel *, const char *func, int line); | 266struct ieee80211_node *ieee80211_find_txnode_debug(struct ieee80211com *, 267 const uint8_t *, 268 const char *func, int line); |
242struct ieee80211_node *ieee80211_find_node_with_ssid_debug( | 269struct ieee80211_node *ieee80211_find_node_with_ssid_debug( |
243 struct ieee80211_node_table *, const u_int8_t *macaddr, 244 u_int ssidlen, const u_int8_t *ssid, | 270 struct ieee80211_node_table *, const uint8_t *macaddr, 271 u_int ssidlen, const uint8_t *ssid, |
245 const char *func, int line); 246#define ieee80211_free_node(ni) \ 247 ieee80211_free_node_debug(ni, __func__, __LINE__) 248#define ieee80211_find_node(nt, mac) \ 249 ieee80211_find_node_debug(nt, mac, __func__, __LINE__) 250#define ieee80211_find_rxnode(nt, wh) \ 251 ieee80211_find_rxnode_debug(nt, wh, __func__, __LINE__) 252#define ieee80211_find_rxnode_withkey(nt, wh, keyix) \ 253 ieee80211_find_rxnode_withkey_debug(nt, wh, keyix, __func__, __LINE__) 254#define ieee80211_find_txnode(nt, mac) \ 255 ieee80211_find_txnode_debug(nt, mac, __func__, __LINE__) | 272 const char *func, int line); 273#define ieee80211_free_node(ni) \ 274 ieee80211_free_node_debug(ni, __func__, __LINE__) 275#define ieee80211_find_node(nt, mac) \ 276 ieee80211_find_node_debug(nt, mac, __func__, __LINE__) 277#define ieee80211_find_rxnode(nt, wh) \ 278 ieee80211_find_rxnode_debug(nt, wh, __func__, __LINE__) 279#define ieee80211_find_rxnode_withkey(nt, wh, keyix) \ 280 ieee80211_find_rxnode_withkey_debug(nt, wh, keyix, __func__, __LINE__) 281#define ieee80211_find_txnode(nt, mac) \ 282 ieee80211_find_txnode_debug(nt, mac, __func__, __LINE__) |
256#define ieee80211_find_node_with_channel(nt, mac, c) \ 257 ieee80211_find_node_with_channel_debug(nt, mac, c, __func__, __LINE__) | |
258#define ieee80211_find_node_with_ssid(nt, mac, sl, ss) \ 259 ieee80211_find_node_with_ssid_debug(nt, mac, sl, ss, __func__, __LINE__) 260#else 261void ieee80211_free_node(struct ieee80211_node *); | 283#define ieee80211_find_node_with_ssid(nt, mac, sl, ss) \ 284 ieee80211_find_node_with_ssid_debug(nt, mac, sl, ss, __func__, __LINE__) 285#else 286void ieee80211_free_node(struct ieee80211_node *); |
262struct ieee80211_node *ieee80211_find_node( 263 struct ieee80211_node_table *, const u_int8_t *); 264struct ieee80211_node * ieee80211_find_rxnode( 265 struct ieee80211com *, const struct ieee80211_frame_min *); | 287struct ieee80211_node *ieee80211_find_node(struct ieee80211_node_table *, 288 const uint8_t *); 289struct ieee80211_node * ieee80211_find_rxnode(struct ieee80211com *, 290 const struct ieee80211_frame_min *); |
266struct ieee80211_node * ieee80211_find_rxnode_withkey(struct ieee80211com *, | 291struct ieee80211_node * ieee80211_find_rxnode_withkey(struct ieee80211com *, |
267 const struct ieee80211_frame_min *, u_int16_t keyix); 268struct ieee80211_node *ieee80211_find_txnode( 269 struct ieee80211com *, const u_int8_t *); 270struct ieee80211_node *ieee80211_find_node_with_channel( 271 struct ieee80211_node_table *, const u_int8_t *macaddr, 272 struct ieee80211_channel *); | 292 const struct ieee80211_frame_min *, uint16_t keyix); 293struct ieee80211_node *ieee80211_find_txnode(struct ieee80211com *, 294 const uint8_t *); |
273struct ieee80211_node *ieee80211_find_node_with_ssid( | 295struct ieee80211_node *ieee80211_find_node_with_ssid( |
274 struct ieee80211_node_table *, const u_int8_t *macaddr, 275 u_int ssidlen, const u_int8_t *ssid); | 296 struct ieee80211_node_table *, const uint8_t *macaddr, 297 u_int ssidlen, const uint8_t *ssid); |
276#endif 277int ieee80211_node_delucastkey(struct ieee80211_node *); | 298#endif 299int ieee80211_node_delucastkey(struct ieee80211_node *); |
300void ieee80211_node_timeout(void *arg); |
|
278 279typedef void ieee80211_iter_func(void *, struct ieee80211_node *); 280void ieee80211_iterate_nodes(struct ieee80211_node_table *, 281 ieee80211_iter_func *, void *); 282 283void ieee80211_dump_node(struct ieee80211_node_table *, 284 struct ieee80211_node *); 285void ieee80211_dump_nodes(struct ieee80211_node_table *); 286 287struct ieee80211_node *ieee80211_fakeup_adhoc_node( | 301 302typedef void ieee80211_iter_func(void *, struct ieee80211_node *); 303void ieee80211_iterate_nodes(struct ieee80211_node_table *, 304 ieee80211_iter_func *, void *); 305 306void ieee80211_dump_node(struct ieee80211_node_table *, 307 struct ieee80211_node *); 308void ieee80211_dump_nodes(struct ieee80211_node_table *); 309 310struct ieee80211_node *ieee80211_fakeup_adhoc_node( |
288 struct ieee80211_node_table *, const u_int8_t macaddr[]); 289void ieee80211_node_join(struct ieee80211com *, struct ieee80211_node *,int); 290void ieee80211_node_leave(struct ieee80211com *, struct ieee80211_node *); 291u_int8_t ieee80211_getrssi(struct ieee80211com *ic); 292 293/* 294 * Parameters supplied when adding/updating an entry in a 295 * scan cache. Pointer variables should be set to NULL 296 * if no data is available. Pointer references can be to 297 * local data; any information that is saved will be copied. 298 * All multi-byte values must be in host byte order. 299 */ 300struct ieee80211_scanparams { 301 u_int16_t capinfo; /* 802.11 capabilities */ 302 u_int16_t fhdwell; /* FHSS dwell interval */ 303 u_int8_t chan; /* */ 304 u_int8_t bchan; 305 u_int8_t fhindex; 306 u_int8_t erp; 307 u_int16_t bintval; 308 u_int8_t timoff; 309 u_int8_t *tim; 310 u_int8_t *tstamp; 311 u_int8_t *country; 312 u_int8_t *ssid; 313 u_int8_t *rates; 314 u_int8_t *xrates; 315 u_int8_t *wpa; 316 u_int8_t *wme; 317}; 318 319void ieee80211_add_scan(struct ieee80211com *, 320 const struct ieee80211_scanparams *, 321 const struct ieee80211_frame *, 322 int subtype, int rssi, int rstamp); | 311 struct ieee80211_node_table *, const uint8_t macaddr[]); 312struct ieee80211_scanparams; |
323void ieee80211_init_neighbor(struct ieee80211_node *, 324 const struct ieee80211_frame *, 325 const struct ieee80211_scanparams *); 326struct ieee80211_node *ieee80211_add_neighbor(struct ieee80211com *, 327 const struct ieee80211_frame *, 328 const struct ieee80211_scanparams *); | 313void ieee80211_init_neighbor(struct ieee80211_node *, 314 const struct ieee80211_frame *, 315 const struct ieee80211_scanparams *); 316struct ieee80211_node *ieee80211_add_neighbor(struct ieee80211com *, 317 const struct ieee80211_frame *, 318 const struct ieee80211_scanparams *); |
319void ieee80211_node_join(struct ieee80211com *, struct ieee80211_node *,int); 320void ieee80211_node_leave(struct ieee80211com *, struct ieee80211_node *); 321int8_t ieee80211_getrssi(struct ieee80211com *); 322void ieee80211_getsignal(struct ieee80211com *, int8_t *, int8_t *); |
|
329#endif /* _NET80211_IEEE80211_NODE_H_ */ | 323#endif /* _NET80211_IEEE80211_NODE_H_ */ |