1*33378d91Sjmc.\" $OpenBSD: ieee80211_output.9,v 1.6 2015/11/23 17:53:57 jmc Exp $ 2f903018eSjsg.\" 3f903018eSjsg.\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org> 4f903018eSjsg.\" Copyright (c) 2004 Darron Broad <darron@kewl.org> 5f903018eSjsg.\" All rights reserved. 6f903018eSjsg.\" 7f903018eSjsg.\" Redistribution and use in source and binary forms, with or without 8f903018eSjsg.\" modification, are permitted provided that the following conditions 9f903018eSjsg.\" are met: 10f903018eSjsg.\" 1. Redistributions of source code must retain the above copyright 11f903018eSjsg.\" notice, this list of conditions and the following disclaimer. 12f903018eSjsg.\" 2. Redistributions in binary form must reproduce the above copyright 13f903018eSjsg.\" notice, this list of conditions and the following disclaimer in the 14f903018eSjsg.\" documentation and/or other materials provided with the distribution. 15f903018eSjsg.\" 16f903018eSjsg.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17f903018eSjsg.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18f903018eSjsg.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19f903018eSjsg.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20f903018eSjsg.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21f903018eSjsg.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22f903018eSjsg.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23f903018eSjsg.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24f903018eSjsg.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25f903018eSjsg.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26f903018eSjsg.\" SUCH DAMAGE. 27f903018eSjsg.\" 28f903018eSjsg.\" $FreeBSD: src/share/man/man9/ieee80211_output.9,v 1.2 2004/07/07 12:59:39 ru Exp $ 29*33378d91Sjmc.\" $Id: ieee80211_output.9,v 1.6 2015/11/23 17:53:57 jmc Exp $ 30f903018eSjsg.\" 31*33378d91Sjmc.Dd $Mdocdate: November 23 2015 $ 32*33378d91Sjmc.Dt IEEE80211_ENCAP 9 33f903018eSjsg.Os 34f903018eSjsg.Sh NAME 35f903018eSjsg.Nm ieee80211_encap , ieee80211_add_rates , 364c86a366Sdamien.Nm ieee80211_add_xrates , 37f903018eSjsg.Nm ieee80211_send_mgmt 38f903018eSjsg.Nd software 802.11 stack output functions 39f903018eSjsg.Sh SYNOPSIS 40f903018eSjsg.In net80211/ieee80211_var.h 41f903018eSjsg.In net80211/ieee80211_proto.h 42f903018eSjsg.Ft struct mbuf * 43f903018eSjsg.Fo ieee80211_encap 44f903018eSjsg.Fa "struct ifnet *ifp" "struct mbuf *m" "struct ieee80211_node **pni" 45f903018eSjsg.Fc 46f903018eSjsg.Ft u_int8_t * 47f903018eSjsg.Fn ieee80211_add_rates "u_int8_t *frm" "const struct ieee80211_rateset *rs" 48f903018eSjsg.Ft u_int8_t * 49f903018eSjsg.Fn ieee80211_add_xrates "u_int8_t *frm" "const struct ieee80211_rateset *rs" 50f903018eSjsg.Ft int 51f903018eSjsg.Fo ieee80211_send_mgmt 52f903018eSjsg.Fa "struct ieee80211com *ic" "struct ieee80211_node *ni" "int type" "int arg" 53f903018eSjsg.Fc 54f903018eSjsg.Sh DESCRIPTION 55f903018eSjsgThese functions handle the encapsulation and transmission of 802.11 frames 56f903018eSjsgwithin the software 802.11 stack. 57f903018eSjsg.Pp 58f903018eSjsgThe 59f903018eSjsg.Fn ieee80211_encap 60f903018eSjsgfunction encapsulates an outbound data frame contained within the 61f903018eSjsgmbuf chain 62f903018eSjsg.Fa m 63f903018eSjsgfrom the interface 64f903018eSjsg.Fa ifp . 65f903018eSjsgThe argument 66f903018eSjsg.Fa *pni 67f903018eSjsgis a reference to the destination node. 68f903018eSjsg.Pp 69f903018eSjsgIf the function is successful, the mbuf chain is updated with the 70f903018eSjsg802.11 frame header prepended, and a pointer to the head of the chain 71f903018eSjsgis returned. 72f903018eSjsgIf an error occurs, 73f903018eSjsg.Dv NULL 74f903018eSjsgwill be returned, and 75f903018eSjsg.Fa *pni 76f903018eSjsgis also set to 77f903018eSjsg.Dv NULL . 78f903018eSjsgThe caller is responsible for freeing the node reference if 79f903018eSjsg.Fa *pni 80f903018eSjsgis 81f903018eSjsg.Pf non- Dv NULL 82f903018eSjsgon return. 83f903018eSjsgThe convention is that 84f903018eSjsg.Va ic_bss 85f903018eSjsgis not reference counted; the caller is responsible for maintaining this 86f903018eSjsgreference count. 87f903018eSjsg.Pp 88f903018eSjsg.\" 89f903018eSjsgThe 90f903018eSjsg.Fn ieee80211_add_rates 91f903018eSjsgutility function is used to add the rate set element 92f903018eSjsg.Fa *rs 93f903018eSjsgto the frame 94f903018eSjsg.Fa frm . 95f903018eSjsgA pointer to the location in the buffer after the addition of the rate set 96f903018eSjsgis returned. 97f903018eSjsgIt is typically used when constructing management frames from within the 98f903018eSjsgsoftware 802.11 stack. 99f903018eSjsg.Pp 100f903018eSjsg.\" 101f903018eSjsgThe 102f903018eSjsg.Fn ieee80211_add_xrates 103f903018eSjsgutility function is used to add the extended rate set element 104f903018eSjsg.Fa *rs 105f903018eSjsgto the frame 106f903018eSjsg.Fa frm . 107f903018eSjsgA pointer to the location in the buffer after the addition of the rate set 108f903018eSjsgis returned. 109f903018eSjsgIt is typically used when constructing management frames from within the 110f903018eSjsgsoftware 802.11 stack in 802.11g mode. 111f903018eSjsg.Pp 112f903018eSjsg.\" 113f903018eSjsgThe 114f903018eSjsg.Fn ieee80211_send_mgmt 115f903018eSjsgfunction transmits a management frame on the interface 116f903018eSjsg.Fa ic 117f903018eSjsgto the destination node 118f903018eSjsg.Fa ni 119f903018eSjsgof type 120f903018eSjsg.Fa type . 121f903018eSjsg.Pp 122f903018eSjsgThe argument 123f903018eSjsg.Fa arg 124f903018eSjsgspecifies either a sequence number for authentication operations, 125f903018eSjsga status code for [re]association operations, 126f903018eSjsgor a reason for deauthentication and deassociation operations. 127f903018eSjsg.Pp 128f903018eSjsgNodes other than 129f903018eSjsg.Va ic_bss 130f903018eSjsghave their reference count incremented to reflect their use for an 131f903018eSjsgindeterminate amount of time. 132f903018eSjsgThis reference is freed when the function returns. 133f903018eSjsg.Pp 134f903018eSjsgThe function returns 0 if successful; if temporary buffer space is not 135f903018eSjsgavailable, the function returns 136f903018eSjsg.Er ENOMEM . 137f903018eSjsg.\" 138f903018eSjsg.Sh SEE ALSO 139f903018eSjsg.Xr ieee80211 9 140f903018eSjsg.Sh HISTORY 141f903018eSjsgThe 142f903018eSjsg.Nm ieee80211 143f903018eSjsgseries of functions first appeared in 144f903018eSjsg.Nx 1.5 , 145f903018eSjsgand were later ported to 146f903018eSjsg.Fx 4.6 147f903018eSjsgand 148f903018eSjsg.Ox 3.6 . 149f903018eSjsg.Sh AUTHORS 150d281945cSjaredy.An -nosplit 151f903018eSjsgThis man page was written by 152f0641c22Sschwarze.An Bruce M. Simpson Aq Mt bms@FreeBSD.org 153f903018eSjsgand 154f0641c22Sschwarze.An Darron Broad Aq Mt darron@kewl.org . 155