FreeBSD kernel WLAN code
|
#include <sys/cdefs.h>
#include "opt_wlan.h"
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_media.h>
#include <net/ethernet.h>
#include <net80211/ieee80211_var.h>
Go to the source code of this file.
Macros | |
#define | IEEE80211_WEP_HDRLEN (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN) |
#define | IEEE80211_WEP_MINLEN |
Variables | |
static const struct ieee80211_cipher * | ciphers [IEEE80211_CIPHER_MAX] |
static const char * | cipher_modnames [IEEE80211_CIPHER_MAX] |
#define IEEE80211_WEP_HDRLEN (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN) |
#define IEEE80211_WEP_MINLEN |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 423 of file ieee80211_crypto.c.
References cipher_detach(), dev_key_delete(), ieee80211_cipher::ic_name, ieee80211_crypto_resetkey(), IEEE80211_DPRINTF, IEEE80211_KEY_DEVKEY, IEEE80211_KEYIX_NONE, IEEE80211_MSG_CRYPTO, IEEE80211_NONQOS_TID, ieee80211_stats::is_crypto_delkey, ieee80211vap::iv_stats, ieee80211_key::wk_cipher, ieee80211_key::wk_flags, ieee80211_key::wk_keyix, ieee80211_key::wk_keylen, ieee80211_key::wk_keyrsc, and ieee80211_key::wk_keytsc.
Referenced by ieee80211_crypto_delglobalkeys(), and ieee80211_crypto_delkey().
|
static |
Definition at line 110 of file ieee80211_crypto.c.
References ieee80211_cipher::ic_attach, and ieee80211_key::wk_cipher.
|
static |
Definition at line 104 of file ieee80211_crypto.c.
References ieee80211_cipher::ic_detach, and ieee80211_key::wk_cipher.
Referenced by _ieee80211_crypto_delkey(), and ieee80211_crypto_newkey().
CTASSERT | ( | (IEEE80211_KEY_COMMON &IEEE80211_KEY_DEVICE) | = =0 | ) |
|
static |
Definition at line 119 of file ieee80211_crypto.c.
References ieee80211vap::iv_key_alloc.
Referenced by ieee80211_crypto_newkey().
|
static |
Definition at line 127 of file ieee80211_crypto.c.
References ieee80211vap::iv_key_delete.
Referenced by _ieee80211_crypto_delkey().
|
static |
Definition at line 134 of file ieee80211_crypto.c.
References ieee80211vap::iv_key_set.
Referenced by ieee80211_crypto_reload_keys(), ieee80211_crypto_setkey(), and load_ucastkey().
void ieee80211_crypto_attach | ( | struct ieee80211com * | ic | ) |
Definition at line 143 of file ieee80211_crypto.c.
References ciphers, IEEE80211_CIPHER_NONE, and ieee80211_cipher_none.
Referenced by ieee80211_ifattach().
int ieee80211_crypto_available | ( | u_int | cipher | ) |
Definition at line 232 of file ieee80211_crypto.c.
References ciphers, and IEEE80211_CIPHER_MAX.
int ieee80211_crypto_decap | ( | struct ieee80211_node * | ni, |
struct mbuf * | m, | ||
int | hdrlen, | ||
struct ieee80211_key ** | key | ||
) |
Definition at line 606 of file ieee80211_crypto.c.
References ieee80211_rx_stats::c_pktflags, ieee80211_frame::i_addr1, ieee80211_frame::i_addr2, ieee80211_cipher::ic_decap, ieee80211_cipher::ic_header, ieee80211_cipher::ic_name, IEEE80211_DPRINTF, ieee80211_get_rx_params_ptr(), IEEE80211_IS_MULTICAST, IEEE80211_KEY_UNDEFINED, IEEE80211_MSG_ANY, IEEE80211_MSG_CRYPTO, IEEE80211_NOTE_MAC, IEEE80211_RX_F_DECRYPTED, IEEE80211_RX_F_IV_STRIP, IEEE80211_WEP_IVLEN, IEEE80211_WEP_MINLEN, ieee80211_stats::is_rx_tooshort, ieee80211vap::iv_nw_keys, ieee80211vap::iv_stats, ieee80211_node::ni_ucastkey, ieee80211_node::ni_vap, and ieee80211_key::wk_cipher.
Referenced by adhoc_input(), hostap_input(), sta_input(), and wds_input().
void ieee80211_crypto_delglobalkeys | ( | struct ieee80211vap * | vap | ) |
Definition at line 471 of file ieee80211_crypto.c.
References _ieee80211_crypto_delkey(), ieee80211_key_update_begin(), ieee80211_key_update_end(), IEEE80211_WEP_NKID, and ieee80211vap::iv_nw_keys.
Referenced by ieee80211_crypto_vdetach().
int ieee80211_crypto_delkey | ( | struct ieee80211vap * | vap, |
struct ieee80211_key * | key | ||
) |
Definition at line 457 of file ieee80211_crypto.c.
References _ieee80211_crypto_delkey(), ieee80211_key_update_begin(), and ieee80211_key_update_end().
Referenced by ieee80211_ioctl_delkey(), ieee80211_ioctl_set80211(), and ieee80211_node_delucastkey().
int ieee80211_crypto_demic | ( | struct ieee80211vap * | vap, |
struct ieee80211_key * | k, | ||
struct mbuf * | m, | ||
int | force | ||
) |
Definition at line 701 of file ieee80211_crypto.c.
References ieee80211_rx_stats::c_pktflags, ieee80211_cipher::ic_demic, ieee80211_cipher::ic_miclen, ieee80211_get_rx_params_ptr(), ieee80211_notify_michael_failure(), IEEE80211_RX_F_DECRYPTED, IEEE80211_RX_F_FAIL_MIC, IEEE80211_RX_F_MMIC_STRIP, and ieee80211_key::wk_cipher.
Referenced by adhoc_input(), hostap_input(), sta_input(), and wds_input().
void ieee80211_crypto_detach | ( | struct ieee80211com * | ic | ) |
Definition at line 153 of file ieee80211_crypto.c.
Referenced by ieee80211_ifdetach().
struct ieee80211_key * ieee80211_crypto_encap | ( | struct ieee80211_node * | ni, |
struct mbuf * | m | ||
) |
Definition at line 588 of file ieee80211_crypto.c.
References ieee80211_cipher::ic_encap, ieee80211_crypto_get_txkey(), and ieee80211_key::wk_cipher.
int ieee80211_crypto_get_key_wepidx | ( | const struct ieee80211vap * | vap, |
const struct ieee80211_key * | k | ||
) |
Definition at line 532 of file ieee80211_crypto.c.
References IEEE80211_WEP_NKID, and ieee80211vap::iv_nw_keys.
Referenced by null_key_alloc().
uint8_t ieee80211_crypto_get_keyid | ( | struct ieee80211vap * | vap, |
struct ieee80211_key * | k | ||
) |
Definition at line 546 of file ieee80211_crypto.c.
References IEEE80211_WEP_NKID, and ieee80211vap::iv_nw_keys.
Referenced by ccmp_setiv(), none_encap(), tkip_setiv(), and wep_setiv().
struct ieee80211_key * ieee80211_crypto_get_txkey | ( | struct ieee80211_node * | ni, |
struct mbuf * | m | ||
) |
Definition at line 556 of file ieee80211_crypto.c.
References ieee80211_frame::i_addr1, IEEE80211_IS_MULTICAST, IEEE80211_KEY_UNDEFINED, IEEE80211_KEYIX_NONE, IEEE80211_MSG_CRYPTO, IEEE80211_NOTE_MAC, ieee80211_stats::is_tx_nodefkey, ieee80211vap::iv_def_txkey, ieee80211vap::iv_nw_keys, ieee80211vap::iv_stats, ieee80211_node::ni_ucastkey, and ieee80211_node::ni_vap.
Referenced by ieee80211_crypto_encap().
int ieee80211_crypto_newkey | ( | struct ieee80211vap * | vap, |
int | cipher, | ||
int | flags, | ||
struct ieee80211_key * | key | ||
) |
Definition at line 264 of file ieee80211_crypto.c.
References cipher_detach(), cipher_modnames, ciphers, dev_key_alloc(), ieee80211_cipher::ic_attach, ieee80211com::ic_cryptocaps, ieee80211_cipher::ic_name, IEEE80211_CIPHER_MAX, IEEE80211_CIPHER_TKIP, IEEE80211_CRYPTO_TKIPMIC, IEEE80211_DPRINTF, IEEE80211_KEY_COMMON, IEEE80211_KEY_DEVICE, IEEE80211_KEY_DEVKEY, IEEE80211_KEY_SWCRYPT, IEEE80211_KEY_SWMIC, ieee80211_load_module(), IEEE80211_MSG_CRYPTO, ieee80211_stats::is_crypto_attachfail, ieee80211_stats::is_crypto_badcipher, ieee80211_stats::is_crypto_keyfail, ieee80211_stats::is_crypto_nocipher, ieee80211vap::iv_ic, ieee80211vap::iv_stats, ieee80211_key::wk_cipher, ieee80211_key::wk_flags, ieee80211_key::wk_keyix, ieee80211_key::wk_private, and ieee80211_key::wk_rxkeyix.
Referenced by ieee80211_ioctl_set80211(), and ieee80211_ioctl_setkey().
void ieee80211_crypto_register | ( | const struct ieee80211_cipher * | cip | ) |
Definition at line 195 of file ieee80211_crypto.c.
References ciphers, ieee80211_cipher::ic_cipher, ieee80211_cipher::ic_name, and IEEE80211_CIPHER_MAX.
void ieee80211_crypto_reload_keys | ( | struct ieee80211com * | ic | ) |
Definition at line 769 of file ieee80211_crypto.c.
References dev_key_set(), ieee80211com::ic_sta, ieee80211_iterate_nodes(), IEEE80211_KEY_DEVKEY, IEEE80211_S_RUN, IEEE80211_WEP_NKID, ieee80211vap::iv_nw_keys, ieee80211vap::iv_state, load_ucastkey(), and ieee80211_key::wk_flags.
void ieee80211_crypto_set_deftxkey | ( | struct ieee80211vap * | vap, |
ieee80211_keyix | kid | ||
) |
Definition at line 800 of file ieee80211_crypto.c.
References ieee80211vap::iv_update_deftxkey.
Referenced by ieee80211_ioctl_set80211(), and ieee80211_ioctl_setkey().
int ieee80211_crypto_setkey | ( | struct ieee80211vap * | vap, |
struct ieee80211_key * | key | ||
) |
Definition at line 489 of file ieee80211_crypto.c.
References dev_key_set(), ieee80211_cipher::ic_name, ieee80211_cipher::ic_setkey, IEEE80211_DPRINTF, IEEE80211_KEY_DEVKEY, IEEE80211_MSG_CRYPTO, IEEE80211_NONQOS_TID, ieee80211_stats::is_crypto_setkey_cipher, ieee80211_stats::is_crypto_setkey_nokey, ieee80211vap::iv_stats, ieee80211_key::wk_cipher, ieee80211_key::wk_flags, ieee80211_key::wk_keyix, ieee80211_key::wk_keylen, ieee80211_key::wk_keyrsc, ieee80211_key::wk_keytsc, and ieee80211_key::wk_macaddr.
Referenced by ieee80211_ioctl_set80211(), and ieee80211_ioctl_setkey().
void ieee80211_crypto_unregister | ( | const struct ieee80211_cipher * | cip | ) |
Definition at line 214 of file ieee80211_crypto.c.
References ciphers, ieee80211_cipher::ic_cipher, ieee80211_cipher::ic_name, and IEEE80211_CIPHER_MAX.
void ieee80211_crypto_vattach | ( | struct ieee80211vap * | vap | ) |
Definition at line 161 of file ieee80211_crypto.c.
References ieee80211_crypto_resetkey(), IEEE80211_KEYIX_NONE, IEEE80211_WEP_NKID, ieee80211vap::iv_def_txkey, ieee80211vap::iv_key_alloc, ieee80211vap::iv_key_delete, ieee80211vap::iv_key_set, ieee80211vap::iv_key_update_begin, ieee80211vap::iv_key_update_end, ieee80211vap::iv_max_keyix, ieee80211vap::iv_nw_keys, null_key_alloc(), null_key_delete(), null_key_set(), and null_key_update().
Referenced by ieee80211_vap_setup().
void ieee80211_crypto_vdetach | ( | struct ieee80211vap * | vap | ) |
Definition at line 186 of file ieee80211_crypto.c.
References ieee80211_crypto_delglobalkeys().
Referenced by ieee80211_vap_detach().
|
static |
Definition at line 751 of file ieee80211_crypto.c.
References dev_key_set(), IEEE80211_KEY_DEVKEY, IEEE80211_S_RUN, ieee80211vap::iv_state, ieee80211_node::ni_ucastkey, ieee80211_node::ni_vap, and ieee80211_key::wk_flags.
Referenced by ieee80211_crypto_reload_keys().
MALLOC_DEFINE | ( | M_80211_CRYPTO | , |
"80211crypto" | , | ||
"802.11 crypto state" | |||
) |
|
static |
Definition at line 64 of file ieee80211_crypto.c.
References ieee80211_crypto_get_key_wepidx(), IEEE80211_KEY_GROUP, IEEE80211_KEYIX_NONE, IEEE80211_WEP_NKID, ieee80211vap::iv_nw_keys, and ieee80211_key::wk_flags.
Referenced by ieee80211_crypto_vattach().
|
static |
Definition at line 89 of file ieee80211_crypto.c.
Referenced by ieee80211_crypto_vattach().
|
static |
Definition at line 94 of file ieee80211_crypto.c.
Referenced by ieee80211_crypto_vattach().
|
static |
Definition at line 98 of file ieee80211_crypto.c.
Referenced by ieee80211_crypto_vattach().
|
static |
Definition at line 238 of file ieee80211_crypto.c.
Referenced by ieee80211_crypto_newkey().
|
static |
Definition at line 58 of file ieee80211_crypto.c.
Referenced by ieee80211_crypto_attach(), ieee80211_crypto_available(), ieee80211_crypto_newkey(), ieee80211_crypto_register(), and ieee80211_crypto_unregister().