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