1*533063d8Sdholland.\" $NetBSD: ieee80211_node.9,v 1.8 2018/02/08 09:03:23 dholland Exp $ 26b4168a1Sdyoung.\" 36b4168a1Sdyoung.\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org> 46b4168a1Sdyoung.\" Copyright (c) 2004 Darron Broad <darron@kewl.org> 56b4168a1Sdyoung.\" All rights reserved. 66b4168a1Sdyoung.\" 76b4168a1Sdyoung.\" Redistribution and use in source and binary forms, with or without 86b4168a1Sdyoung.\" modification, are permitted provided that the following conditions 96b4168a1Sdyoung.\" are met: 106b4168a1Sdyoung.\" 1. Redistributions of source code must retain the above copyright 116b4168a1Sdyoung.\" notice, this list of conditions and the following disclaimer. 126b4168a1Sdyoung.\" 2. Redistributions in binary form must reproduce the above copyright 136b4168a1Sdyoung.\" notice, this list of conditions and the following disclaimer in the 146b4168a1Sdyoung.\" documentation and/or other materials provided with the distribution. 156b4168a1Sdyoung.\" 166b4168a1Sdyoung.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 176b4168a1Sdyoung.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 186b4168a1Sdyoung.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 196b4168a1Sdyoung.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 206b4168a1Sdyoung.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 216b4168a1Sdyoung.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 226b4168a1Sdyoung.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 236b4168a1Sdyoung.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 246b4168a1Sdyoung.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 256b4168a1Sdyoung.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 266b4168a1Sdyoung.\" SUCH DAMAGE. 276b4168a1Sdyoung.\" 286b4168a1Sdyoung.\" $FreeBSD: src/share/man/man9/ieee80211_node.9,v 1.3 2004/07/07 12:59:39 ru Exp $ 296b4168a1Sdyoung.\" 30a0621359Spooka.Dd September 12, 2006 316b4168a1Sdyoung.Dt IEEE80211_NODE 9 326b4168a1Sdyoung.Os 336b4168a1Sdyoung.Sh NAME 346b4168a1Sdyoung.Nm ieee80211_node_attach , 356b4168a1Sdyoung.Nm ieee80211_node_lateattach , 366b4168a1Sdyoung.Nm ieee80211_node_detach , 376b4168a1Sdyoung.Nm ieee80211_begin_scan , 386b4168a1Sdyoung.Nm ieee80211_next_scan , 396b4168a1Sdyoung.Nm ieee80211_end_scan , 40a0621359Spooka.Nm ieee80211_create_ibss , 416b4168a1Sdyoung.Nm ieee80211_alloc_node , 426b4168a1Sdyoung.Nm ieee80211_dup_bss , 436b4168a1Sdyoung.Nm ieee80211_find_node , 446b4168a1Sdyoung.Nm ieee80211_free_node , 456b4168a1Sdyoung.Nm ieee80211_free_allnodes , 466b4168a1Sdyoung.Nm ieee80211_iterate_nodes 476b4168a1Sdyoung.Nd software 802.11 stack node management functions 486b4168a1Sdyoung.Sh SYNOPSIS 496b4168a1Sdyoung.In net80211/ieee80211_var.h 506b4168a1Sdyoung.In net80211/ieee80211_proto.h 516b4168a1Sdyoung.In net80211/ieee80211_node.h 526b4168a1Sdyoung.Ft void 53a0621359Spooka.Fn ieee80211_node_attach "struct ieee80211com *ic" 546b4168a1Sdyoung.Ft void 55a0621359Spooka.Fn ieee80211_node_lateattach "struct ieee80211com *ic" 566b4168a1Sdyoung.Ft void 57a0621359Spooka.Fn ieee80211_node_detach "struct ieee80211com *ic" 586b4168a1Sdyoung.Ft void 59a0621359Spooka.Fn ieee80211_begin_scan "struct ieee80211com *ic" "int reset" 606b4168a1Sdyoung.Ft void 61a0621359Spooka.Fn ieee80211_next_scan "struct ieee80211com *ic" 62a0621359Spooka.Ft void 63a0621359Spooka.Fn ieee80211_end_scan "struct ieee80211com *ic" 646b4168a1Sdyoung.Ft void 656b4168a1Sdyoung.Fo ieee80211_create_ibss 666b4168a1Sdyoung.Fa "struct ieee80211com *ic" "struct ieee80211_channel *chan" 676b4168a1Sdyoung.Fc 686b4168a1Sdyoung.Ft struct ieee80211_node * 696b4168a1Sdyoung.Fn ieee80211_alloc_node "struct ieee80211com *ic" "u_int8_t *macaddr" 706b4168a1Sdyoung.Ft struct ieee80211_node * 71c013f8a6Spooka.Fo ieee80211_dup_bss 72a0621359Spooka.Fa "struct ieee80211_node_table *nt" "const u_int8_t *macaddr" 73a0621359Spooka.Fc 746b4168a1Sdyoung.Ft struct ieee80211_node * 75c013f8a6Spooka.Fo ieee80211_find_node 76a0621359Spooka.Fa "struct ieee80211_node_table *nt" "const u_int8_t *macaddr" 776b4168a1Sdyoung.Fc 786b4168a1Sdyoung.Ft void 79a0621359Spooka.Fn ieee80211_free_node "struct ieee80211_node *ni" 806b4168a1Sdyoung.Ft void 81a0621359Spooka.Fn ieee80211_free_allnodes "struct ieee80211_node_table *nt" 826b4168a1Sdyoung.Ft void 836b4168a1Sdyoung.Fo ieee80211_iterate_nodes 84a0621359Spooka.Fa "struct ieee80211_node_table *nt" "ieee80211_iter_func *f" "void *arg" 856b4168a1Sdyoung.Fc 866b4168a1Sdyoung.Sh DESCRIPTION 876b4168a1SdyoungThese functions are used to manage node lists within the software 886b4168a1Sdyoung802.11 stack. 896b4168a1SdyoungThese lists are typically used for implementing host-mode AP functionality, 906b4168a1Sdyoungor providing signal quality information about neighbouring nodes. 916b4168a1Sdyoung.Pp 926b4168a1Sdyoung.\" 936b4168a1SdyoungThe 946b4168a1Sdyoung.Fn ieee80211_node_attach 956b4168a1Sdyoungfunction is called from 966b4168a1Sdyoung.Xr ieee80211_ifattach 9 976b4168a1Sdyoungto initialize node database management callbacks for the interface 98a0621359Spooka.Fa ic 996b4168a1Sdyoung(specifically for memory allocation, node copying and node 1006b4168a1Sdyoungsignal inspection). 1016b4168a1SdyoungThese functions may be overridden in special circumstances, 1026b4168a1Sdyoungas long as this is done after calling 1036b4168a1Sdyoung.Xr ieee80211_ifattach 9 1046b4168a1Sdyoungand prior to any other call which may allocate a node. 1056b4168a1Sdyoung.Pp 1066b4168a1Sdyoung.\" 1076b4168a1SdyoungThe 1086b4168a1Sdyoung.Fn ieee80211_node_lateattach 1096b4168a1Sdyoungfunction initialises the 1106b4168a1Sdyoung.Va ic_bss 1116b4168a1Sdyoungnode element of the interface 112a0621359Spooka.Fa ic 1136b4168a1Sdyoungduring 1146b4168a1Sdyoung.Xr ieee80211_media_init 9 . 1156b4168a1SdyoungThis late attachment is to account for certain special cases described under 1166b4168a1Sdyoung.Fn ieee80211_node_attach . 1176b4168a1Sdyoung.Pp 1186b4168a1Sdyoung.\" 1196b4168a1SdyoungThe 1206b4168a1Sdyoung.Fn ieee80211_node_detach 1216b4168a1Sdyoungfunction destroys all node database state associated with the interface 122a0621359Spooka.Fa ic , 1236b4168a1Sdyoungand is usually called during device detach. 1246b4168a1Sdyoung.Pp 1256b4168a1Sdyoung.\" 1266b4168a1SdyoungThe 1276b4168a1Sdyoung.Fn ieee80211_begin_scan 128a0621359Spookafunction initialises the node database in preparation of a 1296b4168a1Sdyoungscan for an access point on the interface 130a0621359Spooka.Fa ic 131a0621359Spookaand begins the scan. 132a0621359SpookaThe parameter 133a0621359Spooka.Fa reset 134a0621359Spookacontrols if a previously built node list should be cleared. 135a0621359SpookaThe actual scanning for an access point is not fully automated: 136a0621359Spookathe device driver itself controls stepping through the channels, usually 137a0621359Spookaby a periodical callback. 1386b4168a1Sdyoung.Pp 1396b4168a1Sdyoung.\" 1406b4168a1SdyoungThe 1416b4168a1Sdyoung.Fn ieee80211_next_scan 1426b4168a1Sdyoungfunction is used to inform the 1436b4168a1Sdyoung.Xr ieee80211 9 144a0621359Spookalayer that the next channel for interface 145a0621359Spooka.Fa ic 146a0621359Spookashould be scanned. 1476b4168a1Sdyoung.Pp 1486b4168a1Sdyoung.\" 1496b4168a1SdyoungThe 1506b4168a1Sdyoung.Fn ieee80211_create_ibss 1516b4168a1Sdyoungfunction sets up the net80211-specific portion of an interface's softc, 1526b4168a1Sdyoung.Fa ic , 1536b4168a1Sdyoungfor use in IBSS mode. 1546b4168a1Sdyoung.Pp 1556b4168a1Sdyoung.\" 1566b4168a1SdyoungThe 1576b4168a1Sdyoung.Fn ieee80211_end_scan 1586b4168a1Sdyoungfunction is called by 1596b4168a1Sdyoung.Fn ieee80211_next_scan 160*533063d8Sdhollandwhen the state machine has performed a full cycle of scanning on 1616b4168a1Sdyoungall available radio channels. 1626b4168a1SdyoungInternally, 1636b4168a1Sdyoung.Fn ieee80211_end_scan 1646b4168a1Sdyoungwill inspect the node cache associated with the interface 165a0621359Spooka.Fa ic 1666b4168a1Sdyoungfor suitable access points found during scanning, and associate with one, 1676b4168a1Sdyoungshould the parameters of the node match those of the configuration 168a0621359Spookarequested. 1696b4168a1Sdyoung.Pp 1706b4168a1Sdyoung.\" 1716b4168a1SdyoungThe 1726b4168a1Sdyoung.Fn ieee80211_alloc_node 1736b4168a1Sdyoungfunction allocates an instance of 1746b4168a1Sdyoung.Vt "struct ieee80211_node" 1756b4168a1Sdyoungfor a node having the MAC address 1766b4168a1Sdyoung.Fa macaddr , 177a0621359Spookaand associates it with the node table 178a0621359Spooka.Fa nt . 1796b4168a1SdyoungIf the allocation is successful, the node structure is initialised by 1806b4168a1Sdyoung.Fn ieee80211_setup_node ; 1816b4168a1Sdyoungotherwise, 1826b4168a1Sdyoung.Dv NULL 1836b4168a1Sdyoungis returned. 1846b4168a1Sdyoung.Pp 1856b4168a1Sdyoung.\" 1866b4168a1SdyoungThe 1876b4168a1Sdyoung.Fn ieee80211_dup_bss 1886b4168a1Sdyoungfunction is similar to 1896b4168a1Sdyoung.Fn ieee80211_alloc_node , 1906b4168a1Sdyoungbut is instead used to create a node database entry for the BSSID 1916b4168a1Sdyoung.Fa macaddr 192a0621359Spookaassociated with the note table 193a0621359Spooka.Fa nt . 1946b4168a1SdyoungIf the allocation is successful, the node structure is initialised by 1956b4168a1Sdyoung.Fn ieee80211_setup_node ; 1966b4168a1Sdyoungotherwise, 1976b4168a1Sdyoung.Dv NULL 1986b4168a1Sdyoungis returned. 1996b4168a1Sdyoung.Pp 2006b4168a1Sdyoung.\" 2016b4168a1SdyoungThe 2026b4168a1Sdyoung.Fn ieee80211_find_node 203a0621359Spookafunction will iterate through the node table 204a0621359Spooka.Fa nt , 2056b4168a1Sdyoungsearching for a node entry which matches 2066b4168a1Sdyoung.Fa macaddr . 2076b4168a1SdyoungIf the entry is found, its reference count is incremented, and 2086b4168a1Sdyounga pointer to the node is returned; otherwise, 2096b4168a1Sdyoung.Dv NULL 210bcbefab5Swizis returned. 2116b4168a1Sdyoung.Pp 2126b4168a1Sdyoung.\" 2136b4168a1SdyoungThe 2146b4168a1Sdyoung.Fn ieee80211_free_allnodes 2156b4168a1Sdyoungfunction will iterate through the node list calling 2166b4168a1Sdyoung.Fn ieee80211_free_node 217a0621359Spookafor all the nodes in table 218a0621359Spooka.Fa nt . 2196b4168a1Sdyoung.Pp 2206b4168a1Sdyoung.\" 2216b4168a1SdyoungThe 2226b4168a1Sdyoung.Fn ieee80211_iterate_nodes 2236b4168a1Sdyoungfunction will call the user-defined callback function 2246b4168a1Sdyoung.Fa f 225a0621359Spookafor all nodes in the table 226a0621359Spooka.Fa nt . 2276b4168a1SdyoungThe callback is invoked with the with the user-supplied value 2286b4168a1Sdyoung.Fa arg 2296b4168a1Sdyoungand a pointer to the current node. 2306b4168a1Sdyoung.\" 2316b4168a1Sdyoung.Sh SEE ALSO 232a0621359Spooka.Xr ieee80211 9 2336b4168a1Sdyoung.Sh HISTORY 2346b4168a1SdyoungThe 2356b4168a1Sdyoung.Nm ieee80211 2366b4168a1Sdyoungseries of functions first appeared in 2376b4168a1Sdyoung.Nx 1.5 , 2386b4168a1Sdyoungand were later ported to 2396b4168a1Sdyoung.Fx 4.6 . 2406b4168a1Sdyoung.Sh AUTHORS 2416b4168a1Sdyoung.An -nosplit 2426b4168a1SdyoungThis man page was written by 243a5684d07Swiz.An Bruce M. Simpson Aq Mt bms@FreeBSD.org 2446b4168a1Sdyoungand 245a5684d07Swiz.An Darron Broad Aq Mt darron@kewl.org . 246