--- src/share/man/man9/ieee80211_crypto.9 2005/08/05 22:35:10 1.2 +++ src/share/man/man9/ieee80211_crypto.9 2006/06/28 19:41:59 1.3 @@ -1,93 +1,79 @@ .\" -.\" Copyright (c) 2004 Bruce M. Simpson -.\" Copyright (c) 2004 Darron Broad -.\" All rights reserved. -.\" +.\" Copyright (c) 2006 The DragonFly Project. All rights reserved. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: +.\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" 3. Neither the name of The DragonFly Project nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific, prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ .\" $DragonFly$ -.\" $Id: ieee80211_crypto.9,v 1.2 2005/08/05 22:35:10 swildner Exp $ .\" -.Dd March 2, 2004 +.Dd June 28, 2006 .Dt IEEE80211_CRYPTO 9 .Os .Sh NAME -.Nm ieee80211_crypto_attach , -.Nm ieee80211_crypto_detach , -.Nm ieee80211_wep_crypt -.Nd 802.11 WEP encryption functions +.Nm ieee80211_crypto_encap +.Nd 802.11 encryption function .Sh SYNOPSIS -.Ft void -.Fn ieee80211_crypto_attach "struct ifnet *ifp" -.Ft void -.Fn ieee80211_crypto_detach "struct ifnet *ifp" -.Ft struct mbuf * -.Fn ieee80211_wep_crypt "struct ifnet *ifp" "struct mbuf *m0" "int txflag" +.In netproto/802_11/ieee80211_var.h +.Ft struct ieee80211_key * +.Fo ieee80211_crypto_encap +.Fa "struct ieee80211com *ic" "struct ieee80211_node *ni" "struct mbuf *m" +.Fc .Sh DESCRIPTION -These functions provide software encryption support +This function provides software encryption support for 802.11 device drivers. .Pp .\" The -.Fn ieee80211_crypto_attach -function initializes crypto support for the interface -.Fa ifp , -and sets the initialization vector (IV) for WEP encryption to -a random number derived from a secure PRNG. -.Pp -.\" -The -.Fn ieee80211_crypto_detach -function frees data structures associated with crypto support -for the interface -.Fa ifp . -.Pp -.\" -The -.Fn ieee80211_wep_crypt -function runs the appropriate WEP encryption algorithm over the 802.11 +.Fn ieee80211_crypto_encap +function runs the appropriate encryption algorithm over the 802.11 encapsulated frame held in the mbuf chain -.Fa m0 , -for transmission or reception on the interface -.Fa ifp . -The -.Fa txflag -argument specifies whether the frame is being received or transmitted. -A value of 0 indicates that the frame is being received and should -therefore be decrypted; a non-zero value indicates that the frame -is being transmitted -and should be encrypted. +.Fa m , +for transmission on the interface +.Fa ic . +The +.Fa ni +argument specifies the target to which the encrypted frame will be transmitted. +It must not be +.Dv NULL , +and is typically the return value of +.Xr ieee80211_find_txnode 9 . .\" .Sh IMPLEMENTATION NOTES -The -.Fn ieee80211_wep_crypt -function stores its IV in the interface's embedded -.Vt struct ieee80211com -instance. +The key used to encrypt unicast frames is stored in +.Fa ni . +.\" +.Sh RETURN VALUES +If successful, +the key used to encrypt the frame is returned. +Otherwise, +.Dv NULL +is returned. +.\" .Sh SEE ALSO -.Xr awi 4 , -.Xr wi 4 , -.Xr arc4random 9 , .Xr ieee80211 9 , .Xr ifnet 9 .Sh HISTORY @@ -100,6 +86,6 @@ and were later ported to .Sh AUTHORS .An -nosplit This man page was written by -.An Bruce M. Simpson Aq bms@FreeBSD.org +.An Sepherosa Ziehau and -.An Darron Broad Aq darron@kewl.org . +.An Sascha Wildner .