2 .\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org>
3 .\" Copyright (c) 2004 Darron Broad <darron@kewl.org>
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" $DragonFly: src/share/man/man9/ieee80211_node.9,v 1.1 2004/07/27 14:50:56 hmp Exp $
29 .\" $Id: ieee80211_node.9,v 1.3 2004/07/07 12:59:39 ru Exp $
35 .Nm ieee80211_node_attach ,
36 .Nm ieee80211_node_lateattach ,
37 .Nm ieee80211_node_detach ,
38 .Nm ieee80211_begin_scan ,
39 .Nm ieee80211_next_scan ,
40 .Nm ieee80211_create_ibss ,
41 .Nm ieee80211_end_scan ,
42 .Nm ieee80211_alloc_node ,
43 .Nm ieee80211_dup_bss ,
44 .Nm ieee80211_find_node ,
45 .Nm ieee80211_lookup_node ,
46 .Nm ieee80211_free_node ,
47 .Nm ieee80211_free_allnodes ,
48 .Nm ieee80211_timeout_nodes ,
49 .Nm ieee80211_iterate_nodes
50 .Nd software 802.11 stack node management functions
52 .In net80211/ieee80211_var.h
53 .In net80211/ieee80211_proto.h
54 .In net80211/ieee80211_node.h
56 .Fn ieee80211_node_attach "struct ifnet *ifp"
58 .Fn ieee80211_node_lateattach "struct ifnet *ifp"
60 .Fn ieee80211_node_detach "struct ifnet *ifp"
62 .Fn ieee80211_begin_scan "struct ifnet *ifp"
64 .Fn ieee80211_next_scan "struct ifnet *ifp"
66 .Fo ieee80211_create_ibss
67 .Fa "struct ieee80211com *ic" "struct ieee80211_channel *chan"
70 .Fn ieee80211_end_scan "struct ifnet *ifp"
71 .Ft struct ieee80211_node *
72 .Fn ieee80211_alloc_node "struct ieee80211com *ic" "u_int8_t *macaddr"
73 .Ft struct ieee80211_node *
74 .Fn ieee80211_dup_bss "struct ieee80211com *ic" "u_int8_t *macaddr"
75 .Ft struct ieee80211_node *
76 .Fn ieee80211_find_node "struct ieee80211com *ic" "u_int8_t *macaddr"
77 .Ft struct ieee80211_node *
78 .Fo ieee80211_lookup_node
79 .Fa "struct ieee80211com *ic" "u_int8_t *macaddr"
80 .Fa "struct ieee80211_channel *chan"
83 .Fn ieee80211_free_node "struct ieee80211com *ic" "struct ieee80211_node *ni"
85 .Fn ieee80211_free_allnodes "struct ieee80211com *ic"
87 .Fn ieee80211_timeout_nodes "struct ieee80211com *ic"
89 .Fo ieee80211_iterate_nodes
90 .Fa "struct ieee80211com *ic" "ieee80211_iter_func *f" "void *arg"
93 These functions are used to manage node lists within the software
95 These lists are typically used for implementing host-mode AP functionality,
96 or providing signal quality information about neighbouring nodes.
100 .Fn ieee80211_node_attach
101 function is called from
102 .Xr ieee80211_ifattach 9
103 to initialize node database management callbacks for the interface
105 (specifically for memory allocation, node copying and node
107 These functions may be overridden in special circumstances,
108 as long as this is done after calling
109 .Xr ieee80211_ifattach 9
110 and prior to any other call which may allocate a node.
114 .Fn ieee80211_node_lateattach
115 function initialises the
117 node element of the interface
120 .Xr ieee80211_media_init 9 .
121 This late attachment is to account for certain special cases described under
122 .Fn ieee80211_node_attach .
126 .Fn ieee80211_node_detach
127 function destroys all node database state associated with the interface
129 and is usually called during device detach.
133 .Fn ieee80211_begin_scan
134 function initialises the node database in preparation of an active
135 scan for an access point on the interface
137 The scan begins on the next radio channel by calling
138 .Fn ieee80211_next_scan
140 The actual scanning for an access point is not automated;
141 the device driver itself only handles setting the radio frequency
142 of the card and stepping through the channels.
146 .Fn ieee80211_next_scan
147 function is used to inform the
149 layer that the interface
151 is now scanning for an access point on the next radio channel.
152 A device driver is expected to first call
153 .Fn ieee80211_begin_scan ,
154 to initialize the node database,
155 then set the radio channel on the device;
156 then, after a certain time has elapsed (200ms for example), call
157 .Fn ieee80211_next_scan
158 to move to the next channel.
159 Typically, a callout is used to automate this process; see
161 for more information on how to use callouts.
165 .Fn ieee80211_create_ibss
166 function sets up the net80211-specific portion of an interface's softc,
168 for use in IBSS mode.
172 .Fn ieee80211_end_scan
173 function is called by
174 .Fn ieee80211_next_scan
175 when the state machine has peformed a full cycle of scanning on
176 all available radio channels.
178 .Fn ieee80211_end_scan
179 will inspect the node cache associated with the interface
181 for suitable access points found during scanning, and associate with one,
182 should the parameters of the node match those of the configuration
183 requested from userland.
187 .Fn ieee80211_alloc_node
188 function allocates an instance of
189 .Vt "struct ieee80211_node"
190 for a node having the MAC address
192 and associates it with the interface
194 If the allocation is successful, the node structure is initialised by
195 .Fn ieee80211_setup_node ;
202 .Fn ieee80211_dup_bss
203 function is similar to
204 .Fn ieee80211_alloc_node ,
205 but is instead used to create a node database entry for the BSSID
207 associated with the interface
209 If the allocation is successful, the node structure is initialised by
210 .Fn ieee80211_setup_node ;
217 .Fn ieee80211_find_node
218 function will iterate through the node list associated with the interface
220 searching for a node entry which matches
222 If the entry is found, its reference count is incremented, and
223 a pointer to the node is returned; otherwise,
229 .Fn ieee80211_lookup_node
230 function is similar to
231 .Fn ieee80211_find_node ,
232 with an additional argument
234 which is used to specify a channel for the match.
235 If the entry is found, its reference count is incremented, and
236 a pointer to the node is returned; otherwise,
242 .Fn ieee80211_free_node
243 function will remove the node
245 from the node database entries associated with the interface
247 and free any memory associated with the node.
248 This private method can be overridden in
249 .Fn ieee80211_node_attach .
253 .Fn ieee80211_free_allnodes
254 function will iterate through the node list calling
255 .Fn ieee80211_free_node
256 for all nodes associated with the interface
261 .Fn ieee80211_timeout_nodes
262 checks if the inactivity timer of each node associated with the interface
264 has exceeded the pre-defined constant
265 .Dv IEEE80211_INACT_MAX .
266 If so, then the node is freed, after sending a deauthentication message.
270 .Fn ieee80211_iterate_nodes
271 function will call the user-defined callback function
273 for all nodes in the node database associated with the interface
275 The callback is invoked with the with the user-supplied value
277 and a pointer to the current node.
285 series of functions first appeared in
287 and were later ported to
291 This man page was written by
292 .An Bruce M. Simpson Aq bms@FreeBSD.org
294 .An Darron Broad Aq darron@kewl.org .