---
name: "ieee80211_crypto_attach"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/ieee80211_crypto_attach"
---

# ieee80211\_crypto\_attach(9)

802\.11 WEP encryption functions

## NAME

**ieee80211\_crypto\_attach**, **ieee80211\_crypto\_detach**, **ieee80211\_wep\_crypt** – 802.11 WEP encryption functions

## SYNOPSIS

*void*\

**ieee80211\_crypto\_attach**(*struct ifnet \*ifp*);

*void*\

**ieee80211\_crypto\_detach**(*struct ifnet \*ifp*);

*struct* *mbuf* *\**\

**ieee80211\_wep\_crypt**(*struct ifnet \*ifp*, *struct mbuf \*m0*, *int txflag*);

## DESCRIPTION

These functions provide software encryption support for 802.11 device drivers.

The **ieee80211\_crypto\_attach**() function initializes crypto support for the interface *ifp*, and sets the initialization vector (IV) for WEP encryption to a random number derived from a secure PRNG.

The **ieee80211\_crypto\_detach**() function frees data structures associated with crypto support for the interface *ifp*.

The **ieee80211\_wep\_crypt**() function runs the appropriate WEP encryption algorithm over the 802.11 encapsulated frame held in the mbuf chain *m0*, for transmission or reception on the interface *ifp*. The *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.

## IMPLEMENTATION NOTES

The **ieee80211\_wep\_crypt**() function stores its IV in the interface's embedded *struct* *ieee80211com* instance.

## SEE ALSO

[awi(4)](/awi/4.md), [wi(4)](/wi/4.md), [arc4random(9)](/arc4random/9.md), [ieee80211(9)](/ieee80211/9.md), [ifnet(9)](/ifnet/9.md)

## HISTORY

The **ieee80211** series of functions first appeared in NetBSD 1.5, and were later ported to FreeBSD 4.6.

## AUTHORS

This manual page was written by Bruce M. Simpson ⟨bms@FreeBSD.org⟩ and Darron Broad ⟨darron@kewl.org⟩.
