1.\" 2.\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org> 3.\" Copyright (c) 2004 Darron Broad <darron@kewl.org> 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.\" 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 25.\" SUCH DAMAGE. 26.\" 27.\" $FreeBSD$ 28.\" $DragonFly: src/share/man/man9/ieee80211_output.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ 29.\" $Id: ieee80211_output.9,v 1.2 2004/07/07 12:59:39 ru Exp $ 30.\" 31.Dd March 2, 2004 32.Dt IEEE80211_OUTPUT 9 33.Os 34.Sh NAME 35.Nm ieee80211_encap , ieee80211_add_rates , 36.Nm ieee80211_add_xrates , ieee80211_send_mgmt 37.Nd software 802.11 stack output functions 38.Sh SYNOPSIS 39.In net80211/ieee80211_var.h 40.In net80211/ieee80211_proto.h 41.Ft struct mbuf * 42.Fo ieee80211_encap 43.Fa "struct ifnet *ifp" "struct mbuf *m" "struct ieee80211_node **pni" 44.Fc 45.Ft u_int8_t * 46.Fn ieee80211_add_rates "u_int8_t *frm" "const struct ieee80211_rateset *rs" 47.Ft u_int8_t * 48.Fn ieee80211_add_xrates "u_int8_t *frm" "const struct ieee80211_rateset *rs" 49.Ft int 50.Fo ieee80211_send_mgmt 51.Fa "struct ieee80211com *ic" "struct ieee80211_node *ni" "int type" "int arg" 52.Fc 53.Sh DESCRIPTION 54These functions handle the encapsulation and transmission of 802.11 frames 55within the software 802.11 stack. 56.Pp 57The 58.Fn ieee80211_encap 59function encapsulates an outbound data frame contained within the 60mbuf chain 61.Fa m 62from the interface 63.Fa ifp . 64The argument 65.Fa *pni 66is a reference to the destination node. 67.Pp 68If the function is successful, the mbuf chain is updated with the 69802.11 frame header prepended, and a pointer to the head of the chain 70is returned. 71If an error occurs, 72.Dv NULL 73will be returned, and 74.Fa *pni 75is also set to 76.Dv NULL . 77The caller is responsible for freeing the node reference if 78.Fa *pni 79is 80.Pf non- Dv NULL 81on return. 82The convention is that 83.Va ic_bss 84is not reference counted; the caller is responsible for maintaining this 85reference count. 86.Pp 87.\" 88The 89.Fn ieee80211_add_rates 90utility function is used to add the rate set element 91.Fa *rs 92to the frame 93.Fa frm . 94A pointer to the location in the buffer after the addition of the rate set 95is returned. 96It is typically used when constructing management frames from within the 97software 802.11 stack. 98.Pp 99.\" 100The 101.Fn ieee80211_add_xrates 102utility function is used to add the extended rate set element 103.Fa *rs 104to the frame 105.Fa frm . 106A pointer to the location in the buffer after the addition of the rate set 107is returned. 108It is typically used when constructing management frames from within the 109software 802.11 stack in 802.11g mode. 110.Pp 111.\" 112The 113.Fn ieee80211_send_mgmt 114function transmits a management frame on the interface 115.Fa ic 116to the destination node 117.Fa ni 118of type 119.Fa type . 120.Pp 121The argument 122.Fa arg 123specifies either a sequence number for authentication operations, 124a status code for [re]association operations, 125or a reason for deauthentication and deassociation operations. 126.Pp 127Nodes other than 128.Va ic_bss 129have their reference count incremented to reflect their use for an 130indeterminate amount of time. 131This reference is freed when the function returns. 132.Pp 133The function returns 0 if successful; if temporary buffer space is not 134available, the function returns 135.Er ENOMEM . 136.\" 137.Sh SEE ALSO 138.Xr ieee80211 9 , 139.Xr ifnet 9 140.Sh HISTORY 141The 142.Nm ieee80211 143series of functions first appeared in 144.Nx 1.5 , 145and were later ported to 146.Fx 4.6 . 147.Sh AUTHORS 148.An -nosplit 149This man page was written by 150.An Bruce M. Simpson Aq bms@FreeBSD.org 151and 152.An Darron Broad Aq darron@kewl.org . 153