NET80211(4)

๐Ÿ“ฆ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

โœจ NAME โœจ

net80211 โ€” standard interface to IEEE 802.11 devices

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>
#include <net80211/ieee80211_ioctl.h>

๐Ÿ’– DESCRIPTION ๐Ÿ’–

okay so this section is literally the standard programming interface for configuring and grabbing status info from IEEE 802.11 devices that depend on the wlan(4) module to operate. you talk to them through one of these ioctl(2) calls on a socket:

  • SIOCG80211 โ€” get configuration or status information.
  • SIOCS80211 โ€” set configuration information.

these requests are made via a modified ifreq structure, and it is defined exactly like this:

struct ieee80211req {
        char            i_name[IFNAMSIZ];       /* if_name, e.g. "wi0" */
        uint16_t        i_type;                 /* req type */
        int16_t         i_val;                  /* Index or simple value */
        int16_t         i_len;                  /* Index or simple value */
        void            *i_data;                /* Extra data */
};

requests that are not supported by the underlying device return -1 and set the global variable errno to EOPNOTSUPP. SIOCG80211 requests that return data to an application place small values in i_val or in a user-specified buffer pointed to by i_data. when an indirect buffer is used i_len specifies how large the indirect buffer is and on return it is set by the system to the actual amount of data returned. SIOCS80211 requests use a similar scheme with data passed to the system taken either from i_val or an indirect buffer pointed to by i_data.

for SIOCG80211 the following values of i_type are valid:

  • IEEE80211_IOC_AMPDU โ€” returns whether or not AMPDU is enabled in i_val. AMPDU is an aggregation scheme that is part of the 802.11n specification and is used only when operating on an HT channel. the value returned is one of: 0 (AMPDU disabled), 1 (AMPDU enabled for transmit), 2 (AMPDU enabled for receive), and 3 (AMPDU enabled for transmit and receive). the 802.11n specification says a compliant station must receive AMPDU but may not support transmitting AMPDU frames. disabling AMPDU receive is mainly useful for testing and working around bugs.
  • IEEE80211_IOC_AMPDU_DENSITY โ€” returns the minimum density for bursting AMPDU frames in i_val. the value returned is one of: 0 (no time restriction), 1 (1/4 usec), 2 (1/2 usec), 3 (1 usec), 4 (2 usec), 5 (4 usec), 6 (8 usec), and 7 (16 usec).
  • IEEE80211_IOC_AMPDU_LIMIT โ€” returns the limit on the size of AMPDU frames in i_val. the value returned is one of: 0 (8 kilobytes), 1 (16 kilobytes), 2 (32 kilobytes), and 3 (64 kilobytes).
  • IEEE80211_IOC_AMSDU โ€” returns whether or not AMSDU is enabled in i_val. AMSDU is an aggregation scheme that is part of the 802.11n specification and is used only when operating on an HT channel. the value returned is one of: 0 (AMSDU disabled), 1 (AMSDU enabled for transmit), 2 (AMSDU enabled for receive), and 3 (AMSDU enabled for transmit and receive). the 802.11n specification says a compliant station must receive AMSDU but may not support transmitting AMSDU frames. disabling AMSDU receive is mainly useful for testing and working around bugs.
  • IEEE80211_IOC_AMSDU_LIMIT โ€” returns the limit on the size of AMSDU frames in i_val. the value returned is one of: 3839 (bytes) and 7935 (bytes). note these values are specified by 802.11n; arbitrary values are not allowed.
  • IEEE80211_IOC_APBRIDGE โ€” returns whether AP bridging is enabled in i_val. normally packets sent between stations associated to the same access point are delivered without going through system layers that do packet filtering; when AP bridging is disabled packets are passed up the system to be forwarded using some other mechanism. this value will be non-zero when AP bridging is enabled and otherwise zero.
  • IEEE80211_IOC_APPIE โ€” returns an application information element via i_data. application IE's are maintained for many 802.11 frames; the request must identify the frame to return an IE for in i_val. for example, to retrieve the IE sent in each Beacon frame i_val would be set to IEEE80211_FC0_SUBTYPE_BEACON | IEEE80211_FC0_TYPE_MGT. if no information element is installed then EINVAL is returned. if the data buffer for returning data is too small to hold the information element the value is truncated; this permits querying the presence of data by requesting zero bytes of data be returned.
  • IEEE80211_IOC_AUTHMODE โ€” returns the current authentication mode in i_val. valid values are IEEE80211_AUTH_NONE (no authentication), IEEE80211_AUTH_OPEN (open authentication), IEEE80211_AUTH_SHARED (shared key authentication), IEEE80211_AUTH_8021X (802.1x only authentication), and IEEE80211_AUTH_WPA (WPA/802.11i/802.1x authentication).
  • IEEE80211_IOC_BEACON_INTERVAL โ€” returns the time between Beacon frames (in TU) in i_val.
  • IEEE80211_IOC_BGSCAN โ€” returns whether background scanning is enabled in i_val. when this value is non-zero and operating in station mode the station will periodically leave the current channel and scan for neighboring stations. see also IEEE80211_IOC_BGSCAN_IDLE and IEEE80211_IOC_BGSCAN_INTERVAL.
  • IEEE80211_IOC_BGSCAN_IDLE โ€” returns in i_val the minimum time (msecs) a station must be idle (i.e. not transmitting or receiving frames) before it will do a background scan. see also IEEE80211_IOC_BGSCAN_INTERVAL.
  • IEEE80211_IOC_BGSCAN_INTERVAL โ€” returns in i_val the minimum time (seconds) between background scan operations. see also IEEE80211_IOC_BGSCAN_IDLE.
  • IEEE80211_IOC_BMISSTHRESHOLD โ€” returns in i_val the number of consecutive missed Beacon frames before the system will attempt to roam to a different/better access point.
  • IEEE80211_IOC_BSSID โ€” returns the MAC address for the current BSS identifier via i_data. when the interface is running, the bssid is either the value configured locally (e.g. for an IBSS network started by the local station) or the value adopted when joining an existing network. for WDS interfaces this value is the address of the remote station. when the interface is not running, the bssid returned is the desired bssid, if any, that has been configured.
  • IEEE80211_IOC_BURST โ€” returns whether or not packet bursting is enabled in i_val. if this value is non-zero then the system will try to send packets closely spaced to improve throughput.
  • IEEE80211_IOC_CHANINFO โ€” returns the set of available channels via i_data. note this data should be used by user applications to map between channel specifications (frequency and attributes) and IEEE channel numbers as user applications may not have the necessary information to do this directly (e.g. for 900MHz radios, operation in the Public Safety Band).
  • IEEE80211_IOC_CHANLIST โ€” returns the current list of usable channels via i_data. the channel list is returned as a bit vector with bit N set to 1 if IEEE channel number N is available for use.
  • IEEE80211_IOC_CHANNEL โ€” returns the IEEE channel number of the current channel in i_val. note this request is deprecated; use IEEE80211_IOC_CURCHAN instead.
  • IEEE80211_IOC_COUNTERMEASURES โ€” returns whether TKIP Countermeasures are enabled in i_val. this value will be non-zero when Countermeasures are enabled and otherwise zero.
  • IEEE80211_IOC_CURCHAN โ€” returns information for the current channel via i_data. this information includes the IEEE channel number, the frequency, and attributes that describe the operating constraints (e.g. Passive Scan, DFS, usage restrictions).
  • IEEE80211_IOC_DEVCAPS โ€” returns device capabilities in the data buffer pointed at by i_data. the buffer must be large enough to return the number of available channels but otherwise may be made small to limit how much information is returned.
  • IEEE80211_IOC_DFS โ€” returns whether or not Dynamic Frequency Selection (DFS) is enabled in i_val. DFS embodies several facilities including detection of overlapping radar signals, dynamic transmit power control, and channel selection according to a least-congested criteria. DFS support is mandatory for some 5GHz frequencies in certain locales (e.g. ETSI). by default DFS is enabled according to the regulatory definitions and the current country code, regdomain, and channel.
  • IEEE80211_IOC_DOTD โ€” returns whether or not 802.11d support is enabled in i_val. when 802.11d is enabled in station mode, Beacon frames that advertise a country code different than the currently configured country code will cause an event to be dispatched to user applications. this event can be used by the station to adopt that country code and operate according to the associated regulatory constraints. when operating as an access point with 802.11d enabled the Beacon and ProbeResponse frames transmitted will advertise the current regulatory domain settings.
  • IEEE80211_IOC_DOTH โ€” returns whether 802.11h support is enabled in i_val. when 802.11h is enabled Beacon and ProbeResponse frames will have the SpectrumMgt bit set in the capabilities field and country and power constraint information elements will be present. 802.11h support also includes handling Channel Switch Announcements (CSA) which are a mechanism to coordinate channel changes by an access point. by default 802.11h is enabled if the device is capable.
  • IEEE80211_IOC_DROPUNENCRYPTED โ€” returns, in i_val, whether unencrypted packets transmit/received should be discarded. this value will be zero if unencrypted packets will be accepted and non-zero if they are to be discarded.
  • IEEE80211_IOC_DTIM_PERIOD โ€” returns the period (in beacon intervals) between DTIM events in i_val.
  • IEEE80211_IOC_DWDS โ€” drops whether Dynamic WDS support is turned on into i_val ๐ŸŒ€. Dynamic WDS is the whole facility where packets can get tunneled over normal Infrastructure BSS associations using 4-address (WDS) frames. cute.
  • IEEE80211_IOC_FF โ€” tells you, via i_val, if Atheros fast-frames support is enabled โšก. Fast-frames is a non-standard protocol extension that aggregates multiple frames to level up throughput. > heads up bestie: enabling fast-frames support does not guarantee it gets used โ€” the client and access point have to negotiate that themselves, iykyk.
  • IEEE80211_IOC_FRAGTHRESHOLD โ€” the threshold (in bytes) for kicking on fragmentation frames, right there in i_val ๐ŸŽ€. Any packet bigger than this value gets automatically split into multiple fragmented frames that are sent one after the other.
  • IEEE80211_IOC_GREENFIELD โ€” returns in i_val whether Greenfield preamble use is enabled or not ๐ŸŒฟ. This setting is basically only meaningful when you're operating with 802.11n on an HT channel.
  • IEEE80211_IOC_HIDESSID โ€” tells you, in i_val, if SSID hiding/cloaking is enabled ๐Ÿ™ˆ. SSID hiding only makes sense when you're operating as an access point. When it's on, Beacon frames do not include the SSID, and ProbeRequest frames are not answered unless they include the AP's SSID. The value is non-zero when SSID hiding is enabled and zero otherwise.
  • IEEE80211_IOC_HTCOMPAT โ€” returns in i_val whether 802.11n compatibility support is enabled ๐Ÿ’ซ. The 802.11n protocol specification went through several incompatible iterations, so some vendors implemented 11n support to older specifications that will not interoperate with a purely 11n-compliant station. In particular, the information elements included in management frames for old devices are different. When compatibility support is enabled, both standard and compatible data will be provided and/or accepted.
  • IEEE80211_IOC_HTCONF โ€” drops the setting for automatic promotion of HT channels into i_val ๐Ÿ“ถ. Promotion kicks in when the system has to select a channel and might choose between legacy, HT20, and HT40 operation (like when it's scanning). Valid values are:
    • 0 โ€” do not promote, use legacy
    • 1 โ€” promote to HT20
    • 2 โ€” promote to HT40
  • IEEE80211_IOC_HTPROTMODE โ€” the technique used to protect HT frames in a mixed 802.11n network, in i_val ๐Ÿ›ก๏ธ. Valid values are:
    • IEEE80211_PROTMODE_OFF โ€” no protection enabled
    • IEEE80211_PROTMODE_RTSCTS โ€” send RTS and wait for CTS
  • IEEE80211_IOC_HWMP_MAXHOPS โ€” the maximum acceptable hop count in an HWMP path, handed back in i_val ๐Ÿฆ˜.
  • IEEE80211_IOC_HWMP_ROOTMODE โ€” the setting for Mesh root mode operation in i_val ๐Ÿ‘‘. Valid values are:
    • IEEE80211_HWMP_ROOTMODE_DISABLED โ€” root mode is disabled
    • IEEE80211_HWMP_ROOTMODE_NORMAL โ€” send broadcast Path Request frames
    • IEEE80211_HWMP_ROOTMODE_PROACTIVE โ€” send broadcast Path Request frames and force replies
    • IEEE80211_HWMP_ROOTMODE_RANN โ€” send broadcast Root Announcement (RANN) frames
  • IEEE80211_IOC_IC_NAME โ€” the underlying hardware device(9) name goes in the buffer pointed to by i_data, and the name length including the terminating NUL character goes in i_len ๐Ÿท๏ธ. If the buffer length is too small to hold the full name, EINVAL gets returned.
  • IEEE80211_IOC_INACTIVITY โ€” whether the system handles inactivity processing, in i_val ๐Ÿ˜ด. When inactivity processing is enabled, the system tracks stations that haven't transmitted frames and periodically probes them to check if they're still present. Stations that are inactive and don't respond to probes get dropped. bye bestie.
  • IEEE80211_IOC_MACCMD โ€” info about the state of the MAC address access control list (ACL) system ๐Ÿ”’. There are two requests supported:
    • IEEE80211_MACCMD_POLICY โ€” retrieve the current policy in i_val
    • IEEE80211_MACCMD_LIST โ€” retrieve the list of installed/active ACL's via i_data
the wlan_acl(4) module has to be installed and enabled, or you'll get EINVAL back. no exceptions ๐Ÿ’…
  • IEEE80211_IOC_MESH_AP โ€” whether Mesh AP support is enabled, dropped into i_val ๐Ÿ•ธ๏ธ.
  • IEEE80211_IOC_MESH_ID โ€” the Mesh ID, in the buffer pointed to by i_data ๐ŸŒ.
  • IEEE80211_IOC_MESH_FWRD โ€” whether packet forwarding support is enabled, in i_val ๐Ÿ“จ.
  • IEEE80211_IOC_MESH_PP_METRIC โ€” the link metric protocol, in the buffer pointed to by i_data ๐Ÿ“.
  • IEEE80211_IOC_MESH_PP_PATH โ€” the path selection protocol, in the buffer pointed to by i_data ๐Ÿ›ฃ๏ธ.
  • IEEE80211_IOC_MESH_RTCMD โ€” info about the state of the Mesh routing tables ๐Ÿ“Š. Exactly one request is supported: IEEE80211_MESH_RTCMD_LIST, which retrieves the contents of the routing table in the buffer pointed to by i_data.
  • IEEE80211_IOC_MESH_TTL โ€” the Mesh Time To Live (TTL) setting installed in packets transmitted by this mesh node, in i_val โณ.
  • IEEE80211_IOC_NUMSSIDS โ€” the number of SSIDs supported, in i_val ๐Ÿ”ข.
  • IEEE80211_IOC_NUMWEPKEYS โ€” the number of WEP keys supported, in i_val ๐Ÿ”‘.
  • IEEE80211_IOC_POWERSAVE โ€” the current powersaving mode in i_val ๐Ÿ’ค. Valid values are:
    • IEEE80211_POWERSAVE_OFF โ€” power save operation is disabled
    • IEEE80211_POWERSAVE_ON โ€” power save operation is enabled
  • IEEE80211_IOC_POWERSAVESLEEP โ€” the powersave sleep time in TU, in i_val ๐Ÿ›Œ. This value is also termed the listen interval, and it represents the maximum time a station will sleep before waking to retrieve packets buffered by an access point.
  • IEEE80211_IOC_PRIVACY โ€” the current MLME setting for PRIVACY, in i_val ๐Ÿ”. When PRIVACY is enabled, all data packets must be encrypted. The value will be zero if PRIVACY is disabled and non-zero when PRIVACY is enabled.
  • IEEE80211_IOC_PROTMODE โ€” the current 802.11g protection mode in i_val ๐Ÿ›ก๏ธ. Protection is the mechanism used to safeguard 802.11b stations operating on an 802.11g network. Valid values are:
    • IEEE80211_PROTMODE_OFF โ€” no protection enabled
    • IEEE80211_PROTMODE_CTS โ€” send CTS to yourself
    • IEEE80211_PROTMODE_RTSCTS โ€” send RTS and wait for CTS
  • IEEE80211_IOC_PUREG โ€” whether ``pure 11g'' mode is enabled, in i_val ๐Ÿ€. This setting is meaningful only for access point operation; when it's non-zero, 802.11b stations will not be allowed to associate. sorry not sorry.
  • IEEE80211_IOC_PUREN โ€” whether ``pure 11n'' mode is enabled, in i_val ๐Ÿƒ. This one is also meaningful only for access point operation; when it's non-zero, legacy (non-11n capable) stations will not be allowed to associate.
  • IEEE80211_IOC_REGDOMAIN โ€” the regulatory state, in the buffer pointed to by i_data ๐ŸŒ.
  • IEEE80211_IOC_RIFS โ€” whether Reduced InterFrame Spacing (RIFS) is enabled, in i_val โฑ๏ธ. This setting is meaningful only when operating with 802.11n on an HT channel.
  • IEEE80211_IOC_ROAM โ€” station roaming parameters, in the buffer pointed to by i_data ๐Ÿšถโ€โ™€๏ธ.
  • IEEE80211_IOC_ROAMING โ€” the current roaming mode in i_val ๐Ÿงญ. Roaming mode specifies which entity controls operation of the MLME state machine when operating as a station in an Infrastructure BSS. Valid values are:
    • IEEE80211_ROAMING_DEVICE โ€” driver/firmware is in control
    • IEEE80211_ROAMING_AUTO โ€” host 802.11 layer is in control
    • IEEE80211_ROAMING_MANUAL โ€” application is in control
  • IEEE80211_IOC_RTSTHRESHOLD โ€” the threshold (in bytes) for enabling transmission of RTS frames, in i_val ๐Ÿ“ฎ. Packets larger than this value will automatically have an RTS frame sent preceding them to reduce the likelihood of packet loss.
  • IEEE80211_IOC_SCAN_RESULTS โ€” the current contents of the scan cache, sitting in the data area pointed to by i_data ๐Ÿ”.
  • IEEE80211_IOC_SCANVALID โ€” how long (in seconds) results from a scan operation will be considered valid, in i_val โฒ๏ธ. When scan results are no longer valid and they're needed (like, to roam), the system will initiate a scan operation to replenish the scan cache.
  • IEEE80211_IOC_SHORTGI โ€” whether Short Guard Interval (SGI) is enabled, in i_val ๐ŸŒธ. Note: SGI is only used when operating with 802.11n on an HT channel.
  • IEEE80211_IOC_SMPS โ€” the Spatial Multiplexing Power Save (SMPS) setting in i_val ๐Ÿ’ค. This setting is meaningful only when operating with 802.11n on an HT channel. Valid values are:
    • IEEE80211_HTCAP_SMPS_DYNAMIC โ€” Dynamic SMPS is enabled
    • IEEE80211_HTCAP_SMPS_ENA โ€” Static SMPS is enabled
    • IEEE80211_HTCAP_SMPS_OFF โ€” SMPS is disabled
  • IEEE80211_IOC_SSID โ€” the requested SSID, in the buffer pointed to by i_data ๐Ÿ“ก. If i_val is โ‰ฅ 0 then the request refers to the configured value for that slot. Generally 0 is the only valid value, but some interfaces support more SSIDs.
  • IEEE80211_IOC_STA_INFO โ€” info about the current state of the specified station(s) via i_data ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘. The MAC address of a single station may be passed in, or, if the broadcast address is supplied, information about all stations will be returned. If a single station is requested and the MAC address is unknown then ENOENT will be returned.
  • IEEE80211_IOC_STA_STATS โ€” collected statistics for the specified station via i_data ๐Ÿ“ˆ. The MAC address of the desired station is passed in; if it's unknown, ENOENT will be returned.
  • IEEE80211_IOC_STA_VLAN โ€” any VLAN tag assigned to a station, via i_data ๐Ÿท๏ธ.
  • IEEE80211_IOC_TDMA_SLOT โ€” the slot number for the station, in i_val ๐ŸŽฐ. Slot number zero is the master station in a TDMA network.
  • IEEE80211_IOC_TDMA_SLOTCNT โ€” the count of slots in the TDMA network, in i_val ๐Ÿ”ข.
  • IEEE80211_IOC_TDMA_SLOTLEN โ€” the length (in usecs) of the TDMA slot assigned to each station in the network, in i_val โณ.
  • IEEE80211_IOC_TDMA_BINTERVAL โ€” hands you the number of superframes that sit between Beacon frames, dropped into i_val. And because math class never ends: a TDMA network with N slots and slot length T has a superframe of NxT. ๐ŸŒธ
  • IEEE80211_IOC_TSN โ€” tells you whether Transitional Security Network (TSN) is enabled or not, in i_val.
  • IEEE80211_IOC_TURBOP โ€” returns whether Atheros Dynamic Turbo mode is enabled in i_val. Okay so what is Dynamic Turbo mode? It's a non-standard protocol extension that exists only on Atheros devices, where the channel width gets dynamically flipped between 20MHz and 40MHz. ๐Ÿ”ฅ And before you get too excited: enabling Dynamic Turbo mode support does not guarantee you'll actually get to use it โ€” both the client and the access point have to be Atheros devices, and support has to be enabled on both sides. No cap.
  • IEEE80211_IOC_TXPARAMS โ€” returns transmit parameters in the buffer that i_data points to.
  • IEEE80211_IOC_TXPOWER โ€” returns the transmit power limit in .5 dBm units in i_val. This value represents the effective maximum, and it's calculated according to the maximum power allowed by local regulations, any user-specified power limit, and the maximum power the device is capable of. It's giving "we did the math for you." ๐Ÿ’…
  • IEEE80211_IOC_TXPOWMAX โ€” returns the user-specified maximum transmit power in .5 dBm units in i_val. The maximum setting is applied after any regulatory cap, iykyk.
  • IEEE80211_IOC_WEP โ€” returns the current WEP status in i_val. Valid values are: IEEE80211_WEP_ON (enabled for all packets sent and received), IEEE80211_WEP_OFF (disabled), and IEEE80211_WEP_MIXED (enabled for transmit and receive but also willing to receive unencrypted frames). โš ๏ธ Heads up bestie โ€” this request is deprecated; use IEEE80211_IOC_PRIVACY and IEEE80211_IOC_UNENCRYPTED instead.
  • IEEE80211_IOC_WEPKEY โ€” returns the requested WEP key via i_data. The key number is specified in i_val and may be 0-3. If the device does not support returning the WEP key, or the user is not root, then the key may be returned as all zeros. ๐Ÿ™ˆ This request is deprecated in favor of IEEE80211_IOC_WPAKEY.
  • IEEE80211_IOC_WEPTXKEY โ€” returns the number of the WEP key used for transmission in i_val.
  • IEEE80211_IOC_WME โ€” returns whether 802.11e/WME/WMM support is enabled in i_val. This value will be non-zero when support is enabled and otherwise zero.
  • IEEE80211_IOC_WME_CWMIN โ€” returns the WME CWmin setting (log2) for the specified Access Class (AC) in i_val. The AC is passed in through i_len, together with an optional IEEE80211_WMEPARAM_BSS flag to indicate if the parameter for the BSS or the channel is desired. If WME is not supported then EINVAL will be returned. ๐Ÿ’€
  • IEEE80211_IOC_WME_CWMAX โ€” returns the WME CWmax setting (log2) for the specified Access Class (AC) in i_val. See IEEE80211_IOC_WME_CWMIN above for more details.
  • IEEE80211_IOC_WME_AIFS โ€” returns the WME AIFS setting for the specified Access Class (AC) in i_val. See IEEE80211_IOC_WME_CWMIN above for more details.
  • IEEE80211_IOC_WME_TXOPLIMIT โ€” returns the WME TxOpLimit (msec) for the specified Access Class (AC) in i_val. See IEEE80211_IOC_WME_CWMIN above for more details.
  • IEEE80211_IOC_WME_ACM โ€” returns the WME Admission Control Mechanism (ACM) setting for the specified Access Class (AC) in i_val. This value is meaningful only for the BSS (not channel). See IEEE80211_IOC_WME_CWMIN above for more details.
  • IEEE80211_IOC_WME_ACKPOLICY โ€” returns the WME ACK Policy setting for the specified Access Class (AC) in i_val. When this value is zero, frames will be transmitted without waiting for an Acknowledgement. ๐Ÿ‘€ This value is meaningful only for the channel (not BSS). See IEEE80211_IOC_WME_CWMIN above for more details.
  • IEEE80211_IOC_WPA โ€” returns the WPA configuration in i_val. Valid values are 0 (WPA is not enabled), 1 (WPA1 is enabled), 2 (WPA2/802.11i is enabled), and 3 (WPA1 and WPA2/802.11i are both enabled). Slay, all four of them. โœจ
  • IEEE80211_IOC_WPAIE โ€” returns any WPA information element for an associated station via i_data. The request passed in through i_data identifies the MAC address of the desired station. If an RSN (802.11i) element is present it is returned; otherwise any WPA element is returned. Note this request is deprecated โ€” use IEEE80211_IOC_WPAIE2 instead.
  • IEEE80211_IOC_WPAIE2 โ€” returns any WPA information elements for an associated station via i_data. The request passed in through i_data identifies the MAC address of the desired station. One or both of RSN (802.11i) and WPA elements may be returned. ๐ŸŽ€
  • IEEE80211_IOC_WPAKEY โ€” returns the requested cryptographic key in the buffer pointed to by i_data. The key number is specified in i_val and may be 0-3. A key number of zero is used to retrieve a station's unicast cipher key when operating with WPA enabled. If the user is not root then the key data returned is all zeros. ๐Ÿ”
  • IEEE80211_IOC_WPS โ€” returns whether or not Wi-FI Protected Setup (WPS) is enabled in i_val.

Okay bestie, deep breath, because this next part is the setter era. ๐Ÿซถ

For SIOCS80211 the following values of i_type are valid. Note that changing a value on an interface that is running may cause the interface to be โ€˜resetโ€™. Resets may be handled without altering the state if the parameter does not affect the MLME state (e.g. RTS threshold), but in some cases the interface may need to scan for a new network or clear state (including any associated stations); in that case the interface is said to be โ€˜restartedโ€™ (it is equivalent to marking the interface down and back up). The information below identifies whether changing a value affects the state of a running interface.

๐Ÿšจ Real talk: setters can straight-up restart your interface. Your associated stations may vanish. Read the "causes a reset / restart" note on each one before you poke it, fr fr.
  • IEEE80211_IOC_ADDMAC โ€” add an entry to the MAC address Access Control List (ACL) database using the value pointed to by i_data. The wlan_acl(4) module must be installed and enabled, or EINVAL will be returned. ๐Ÿ’…
  • IEEE80211_IOC_AMPDU โ€” set whether or not AMPDU is enabled for transmit and/or receive using the value in i_val. โš ๏ธ This request causes a running interface operating on an HT channel to be reset. See IEEE80211_IOC_AMPDU above for details.
  • IEEE80211_IOC_AMPDU_DENSITY โ€” set the minimum density for bursting AMPDU frames to the value in i_val. โš ๏ธ This request causes a running interface to be reset. See IEEE80211_IOC_AMPDU_DENSITY above for details.
  • IEEE80211_IOC_AMPDU_LIMIT โ€” set the limit on the size of AMPDU frames to the value in i_val. โš ๏ธ This request causes a running interface to be reset. See IEEE80211_IOC_AMPDU_LIMIT above for details.
  • IEEE80211_IOC_AMSDU โ€” set whether or not AMSDU is enabled for transmit and/or receive using the value in i_val. โš ๏ธ This request causes a running interface operating on an HT channel to be reset. See IEEE80211_IOC_AMSDU above for details.
  • IEEE80211_IOC_AMSDU_LIMIT โ€” set the limit on the size of AMSDU frames to the value in i_val. โš ๏ธ This request causes a running interface to be reset. See IEEE80211_IOC_AMSDU_LIMIT above for details.
  • IEEE80211_IOC_APBRIDGE โ€” set whether AP bridging is enabled using the value in i_val. See IEEE80211_IOC_APBRIDGE above for details.
  • IEEE80211_IOC_APPIE โ€” set an application information element using the data pointed to by i_data. โš ๏ธ This request causes a running interface to be restarted if the WPA information element is changed. See IEEE80211_IOC_APPIE above for details.
  • IEEE80211_IOC_AUTHMODE โ€” set the current authentication mode using the value in i_val. โš ๏ธ This request causes a running interface to be restarted. See IEEE80211_IOC_AUTHMODE above for details. This request causes a running interface to be restarted. (Yes, it says it twice in the original and honestly? Same. It's that serious. ๐Ÿ˜ญ)
  • IEEE80211_IOC_BEACON_INTERVAL โ€” set the time between Beacon frames (in TU) to the value in i_val. โš ๏ธ This request causes a running interface to be restarted.
  • IEEE80211_IOC_BGSCAN โ€” set whether background scanning is enabled using the value in i_val.
  • IEEE80211_IOC_BGSCAN_IDLE โ€” set the minimum time (in msecs) a station must be idle before it will do a background scan to the value in i_val.
  • IEEE80211_IOC_BGSCAN_INTERVAL โ€” set the minimum time (seconds) between background scan operations to the value in i_val.
  • IEEE80211_IOC_BMISSTHRESHOLD โ€” set the number of consecutive missed Beacon frames before the system will attempt to roam to the value in i_val. โš ๏ธ This request causes a running interface to be reset.
  • IEEE80211_IOC_BSSID โ€” set the 802.11 MAC address for the desired BSS identifier according to i_data. โš ๏ธ This request causes a running interface to be restarted.
  • IEEE80211_IOC_BURST โ€” set whether or not packet bursting is enabled using the value in i_val. โš ๏ธ This request causes a running interface to be reset.
  • IEEE80211_IOC_CHANNEL โ€” set the desired/current channel to the value given by i_val. This request causes a running interface to immediately change to the specified channel if possible; otherwise the interface will be restarted. ๐Ÿ‘‘ Note this request is deprecated; use IEEE80211_IOC_CURCHAN instead.
  • IEEE80211_IOC_CHANLIST โ€” set the list of available channels using the channel list pointed to by i_data. The channel list is a bit vector with bit N set to 1 if IEEE channel number N is available for use. The specified channel list is checked against the set of supported channels and any channels not supported are silently ignored (๐Ÿ™ˆ rude but okay). If the intersection of the channel list and the supported channels is empty, EINVAL is returned. Note the current channel may be marked invalid after installing a new channel list. โš ๏ธ This request causes a running interface to be restarted.
  • IEEE80211_IOC_COUNTERMEASURES โ€” set whether TKIP Countermeasures are enabled using the value in i_val. This request can only be used when the authentication mode is set WPA; otherwise EOPNOTSUPP will be returned. ๐Ÿ’€
  • IEEE80211_IOC_CURCHAN โ€” Sets the current channel using the info that i_data points at ๐ŸŽฏ. If a running interface can switch to that channel immediately, it does โ€” otherwise the interface gets restarted (no cap, it just yeets itself back up). ๐Ÿ’…
  • IEEE80211_IOC_DELKEY โ€” Deletes the key specified by the info referenced by i_data ๐Ÿ—‘๏ธ. Bye-bye key, you will not be missed.
  • IEEE80211_IOC_DELMAC โ€” Removes an entry in the MAC address Access Control List (ACL) database using the value pointed to by i_data ๐Ÿšซ. The wlan_acl(4) module must be installed and enabled โ€” otherwise you get EINVAL, periodt.
  • IEEE80211_IOC_DFS โ€” Sets whether Dynamic Frequency Selection (DFS) is enabled using i_val ๐Ÿ“ก. This request will fail with EINVAL if 802.11h support is not enabled. See IEEE80211_IOC_DFS above for the details, bestie.
  • IEEE80211_IOC_DOTD โ€” Sets whether 802.11d support is enabled using i_val ๐ŸŒ. This request causes a running interface to be restarted. See IEEE80211_IOC_DOTD above for details.
  • IEEE80211_IOC_DOTH โ€” Returns whether 802.11h support is enabled using i_val ๐Ÿ“ถ. See IEEE80211_IOC_DOTH above for details.
  • IEEE80211_IOC_DROPUNENCRYPTED โ€” Sets whether unencrypted packets transmit/received should be discarded using i_val ๐Ÿ”’. Security vibe check: enabled means no plaintext shenanigans.
  • IEEE80211_IOC_DTIM_PERIOD โ€” Sets the period (in beacon intervals) between DTIM events to the value in i_val โณ. This request causes a running interface to be restarted.
  • IEEE80211_IOC_DWDS โ€” Sets whether Dynamic WDS support is enabled using i_val ๐Ÿ”—. See IEEE80211_IOC_DWDS above for details.
  • IEEE80211_IOC_FF โ€” Sets whether Atheros fast-frames support is enabled using i_val โšก. This request causes a running interface to be restarted. See IEEE80211_IOC_FF above for details.
  • IEEE80211_IOC_FRAGTHRESHOLD โ€” Sets the threshold (in bytes) for enabling fragmentation frames using i_val ๐Ÿงฉ. This request causes a running interface to be reset. See IEEE80211_IOC_FRAGTHRESHOLD above for details.
  • IEEE80211_IOC_GREENFIELD โ€” Sets whether or not Greenfield preamble use is enabled using i_val ๐ŸŒฟ. This request causes a running interface to be reset. See IEEE80211_IOC_GREENFIELD above for details.
  • IEEE80211_IOC_HIDESSID โ€” Sets whether SSID hiding/cloaking is enabled using i_val ๐Ÿ™ˆ. This request causes a running interface to be reset. See IEEE80211_IOC_HIDESSID above for details.
  • IEEE80211_IOC_HTCOMPAT โ€” Sets whether or not 802.11n compatibility support is enabled using i_val ๐Ÿ”„. This request causes a running interface to be reset if operating on an HT channel. See IEEE80211_IOC_HTCOMPAT above for details.
  • IEEE80211_IOC_HTCONF โ€” Sets automatic promotion of HT channels using i_val ๐Ÿš€. This request causes a running interface to be restarted. See IEEE80211_IOC_HTCONF above for details.
  • IEEE80211_IOC_HTPROTMODE โ€” Sets the technique used to protect HT frames in a mixed 802.11n network using i_val ๐Ÿ›ก๏ธ. This request causes a running interface to be reset. See IEEE80211_IOC_HTPROTMODE above for details.
  • IEEE80211_IOC_HWMP_MAXHOPS โ€” Sets the maximum acceptable hop count in an HWMP path according to i_val ๐Ÿฆ˜. Values must be in the range [0-255] โ€” no out-of-bounds hopscotch, bestie.
  • IEEE80211_IOC_HWMP_ROOTMODE โ€” Sets the Mesh root mode operation according to i_val ๐ŸŒณ. Valid values are:
    • IEEE80211_HWMP_ROOTMODE_DISABLED โ€” root mode is disabled
    • IEEE80211_HWMP_ROOTMODE_NORMAL โ€” send broadcast Path Request frames
    • IEEE80211_HWMP_ROOTMODE_PROACTIVE โ€” send broadcast Path Request frames and force replies
    • IEEE80211_HWMP_ROOTMODE_RANN โ€” send broadcast Root Announcement (RANN) frames
  • IEEE80211_IOC_INACTIVITY โ€” Sets whether or not the system handles inactivity processing using i_val ๐Ÿ’ค. When inactivity processing is enabled, the system will track stations that have not transmitted frames and periodically probe them to check if they are still present. Stations that are inactive and do not respond to probes are dropped (ghosted, honestly). ๐Ÿ‘ป
  • IEEE80211_IOC_MACCMD โ€” Changes the state of the MAC address Access Control List (ACL) system ๐ŸŽ›๏ธ. There are several requests supported:
    • IEEE80211_MACCMD_POLICY_OPEN โ€” set the current policy to disable ACL use
    • IEEE80211_MACCMD_POLICY_ALLOW โ€” set the current policy to allow only addresses listed in the database
    • IEEE80211_MACCMD_POLICY_DENY โ€” set the current policy to deny addresses listed in the database
    • IEEE80211_MACCMD_POLICY_RADUS โ€” set the current policy to enable use of a RADIUS backend
    • IEEE80211_MACCMD_FLUSH โ€” flush all addresses from the database
    • IEEE80211_MACCMD_DETACH โ€” detach the ACL subsystem, disabling it

The wlan_acl(4) module must be installed or EINVAL will be returned. No module, no ACL magic. โœจ

  • IEEE80211_IOC_MESH_AP โ€” Sets whether or not Mesh AP support is enabled using i_val ๐Ÿ•ธ๏ธ.
  • IEEE80211_IOC_MESH_FWRD โ€” Sets whether or not packet forwarding support is enabled using i_val ๐Ÿ“ฆ.
  • IEEE80211_IOC_MESH_ID โ€” Sets the Mesh ID using the value pointed to by i_data ๐Ÿท๏ธ. A Mesh ID can be up to IEEE80211_MESHID_LEN bytes long.
  • IEEE80211_IOC_MESH_PP_METRIC โ€” Sets the link metric protocol using the value pointed to by i_data ๐Ÿ“.
  • IEEE80211_IOC_MESH_PP_PATH โ€” Sets the path selection protocol using the value pointed to by i_data ๐Ÿ›ฃ๏ธ.
  • IEEE80211_IOC_MESH_RTCMD โ€” Manipulates the state of the Mesh routing tables ๐Ÿ—บ๏ธ. Several requests are supported:
    • IEEE80211_MESH_RTCMD_FLUSH โ€” flush the contents of the routing table
    • IEEE80211_MESH_RTCMD_ADD โ€” add an entry for the MAC address specified in i_data and start the Peer discovery process
    • IEEE80211_MESH_RTCMD_DELETE โ€” delete the entry corresponding to the MAC address specified in i_data
  • IEEE80211_IOC_MESH_TTL โ€” Sets the Mesh Time To Live (TTL) setting installed in packets transmitted by this mesh node using i_val โฒ๏ธ.
  • IEEE80211_IOC_MLME โ€” Explicitly controls the MLME state machine for a station using the MLME request pointed to by i_data ๐ŸŽฎ. There are several MLME operations supported:
    • IEEE80211_MLME_ASSOC โ€” request association to an access point
    • IEEE80211_MLME_DIASSOC โ€” diassociate the specified station
    • IEEE80211_MLME_DEAUTH โ€” deauthenticate the specified station
    • IEEE80211_MLME_AUHORIZE โ€” mark the specified station authorized to pass data frames (yes, that's how it's spelled in the original โ€” we don't fix it, we respect it)
    • IEEE80211_MLME_UNAUTHORIZE โ€” revoke the specified station's ability to pass data frames
    • IEEE80211_MLME_AUTH โ€” request authentication to an access point

Note: when this facility is used for stations operating in infrastructure mode, the roaming mode should be set to manual. ๐Ÿง 

  • IEEE80211_IOC_POWERSAVE โ€” Sets the current powersaving mode to the value in i_val ๐Ÿ”‹. See IEEE80211_IOC_POWERSAVE above for valid values. This request causes a running interface to be reset.
  • IEEE80211_IOC_POWERSAVESLEEP โ€” Sets the powersave sleep time in TU to the value in i_val ๐Ÿ˜ด. This request causes a running interface to be reset.
  • IEEE80211_IOC_PRIVACY โ€” Sets the current MLME setting for PRIVACY using the value in i_val ๐Ÿ•ต๏ธ. See IEEE80211_IOC_PRIVACY above for details.
  • IEEE80211_IOC_PROTMODE โ€” Sets the current 802.11g protection mode to the value in i_val ๐Ÿ›ก๏ธ. This request causes a running interface to be reset. See IEEE80211_IOC_PROTMODE above for details. This request causes a running interface to be reset. (Yes, it says reset twice โ€” the original is just like that, and we keep every detail, bestie.) ๐Ÿ’…
  • IEEE80211_IOC_PUREG โ€” Sets whether ``pure 11g'' mode is enabled using the value in i_val ๐ŸŒฑ. This request causes a running interface to be restarted. See IEEE80211_IOC_PUREG above for details.
  • IEEE80211_IOC_PUREN โ€” Sets whether ``pure 11n'' mode is enabled using the value in i_val ๐ŸŒฟ. This request causes a running interface to be restarted. See IEEE80211_IOC_PUREN above for details.
  • IEEE80211_IOC_REGDOMAIN โ€” Sets the regulatory state using the data referenced by i_data ๐Ÿ—บ๏ธ. This request can only be issued when all interfaces cloned from the underlying physical device are marked down; otherwise EBUSY is returned. Note: the new regulatory data may invalidate any desired channel. So like, don't be surprised if your fave channel ghosts you. ๐Ÿ“ต
  • IEEE80211_IOC_RIFS โ€” Sets whether or not Reduced InterFrame Spacing (RIFS) is enabled using the value in i_val โฑ๏ธ. This setting is meaningful only when operating with 802.11n on an HT channel. This request causes a running interface to be reset.
  • IEEE80211_IOC_ROAM โ€” Sets station roaming parameters using the data pointed to by i_data ๐Ÿšถโ€โ™€๏ธ.
  • IEEE80211_IOC_ROAMING โ€” Sets the current roaming mode to the value in i_val ๐Ÿงญ. See IEEE80211_IOC_ROAMING above for details.
  • IEEE80211_IOC_RTSTHRESHOLD โ€” Sets the threshold (in bytes) for enabling transmission of RTS frames to the value in i_val ๐Ÿ“จ. This request causes a running interface to be reset. See IEEE80211_IOC_RTSTHRESHOLD above for details.
  • IEEE80211_IOC_SCANVALID โ€” Sets the age (in seconds) that results from a scan operation will be considered valid โณ. When scan results are no longer valid and they are needed (e.g. to roam), the system will initiate a scan operation to replenish the scan cache. Gotta keep that cache fresh, bestie. ๐Ÿงผ
  • IEEE80211_IOC_SCAN_REQ โ€” Requests a scan operation using the parameters pointed to by i_val ๐Ÿ“ก. The underlying device must be running or ENXIO will be returned. Values for sr_duration, sr_mindwell, and sr_maxdwell shorter than 1 clock tick are rounded up to a tick. If more SSID's are supplied than the system is capable of handling, the extra ones are silently ignored. If a scan operation is already in progress, the request will be (silently) ignored. Silent treatment, but for scans. ๐Ÿ’€
  • IEEE80211_IOC_SCAN_CANCEL โ€” Cancels any pending/active scan operation โŒ. Scan said "not today", and this ioctl agrees.
  • IEEE80211_IOC_SHORTGI โ€” turns Short Guard Interval (SGI) on or off depending on the value in i_val. Heads up bestie: SGI only does anything when you're operating on an HT (802.11n) channel, so don't come for it on a non-n channel ๐Ÿ’…. This one resets a running interface.
  • IEEE80211_IOC_SMPS โ€” sets the Spatial Multiplexing Power Save (SMPS) setting to the value in i_val. Also resets a running interface. For the deets, see IEEE80211_IOC_SMPS above ๐Ÿ‘†.
  • IEEE80211_IOC_SSID โ€” sets the desired SSID from the value i_data points to. That string can be at most IEEE80211_NWID_LEN bytes, no cap. This request restarts a running interface.
  • IEEE80211_IOC_STA_STATS โ€” wipes the accumulated statistics for the station you specified. fresh start energy โœจ
  • IEEE80211_IOC_STA_VLAN โ€” sets the VLAN tag for the specified station using the info i_data points to.
  • IEEE80211_IOC_TDMA_BINTERVAL โ€” sets the interval between Beacon frames to the value in i_val. Values must be positive (negative beacon intervals are not it ๐Ÿ™ˆ). Resets a running interface.
  • IEEE80211_IOC_TDMA_SLOT โ€” sets the current TDMA slot to the value in i_val. Values must land in the range [0-slotcnt]. Slot 0 is literally the master of the TDMA network โ€” if it's running, it immediately starts sending Beacon frames like the main character it is ๐Ÿ‘‘.
  • IEEE80211_IOC_TDMA_SLOTCNT โ€” sets the number of slots in the TDMA network to the value in i_val. Resets a running interface.
  • IEEE80211_IOC_TDMA_SLOTLEN โ€” sets the length of the TDMA slot assigned to each station in the network to the value in i_val. Slot lengths must be in the range 200 usecs to 1024 milliseconds (though ngl, values outside the range 1-200ms are unlikely to work well ๐Ÿฅฒ). Resets a running interface.
  • IEEE80211_IOC_TSN โ€” turns Transitional Security Network (TSN) on or off based on the value in i_val.
  • IEEE80211_IOC_TURBOP โ€” turns Atheros Dynamic Turbo mode on or off based on the value in i_val. This one restarts a running interface, so brace yourself.
  • IEEE80211_IOC_TXPARAMS โ€” sets transmit parameters using the data i_data points to. Restarts a running interface.
  • IEEE80211_IOC_TXPOWER โ€” sets the max transmit power limit to the value in i_val, measured in .5 dBm units. Resets a running interface.
  • IEEE80211_IOC_WEP โ€” sets the current WEP mode to the value in i_val. Valid values live in IEEE80211_IOC_WEP above. Restarts a running interface. โš ๏ธ Also: this request is deprecated โ€” use IEEE80211_IOC_PRIVACY and IEEE80211_IOC_DROPUNENCRYPTED instead, okurrr?
  • IEEE80211_IOC_WEPKEY โ€” sets the WEP key indicated by i_val using the data i_data points to. โš ๏ธ Also deprecated โ€” use IEEE80211_IOC_WPAKEY instead.
  • IEEE80211_IOC_WEPTXKEY โ€” sets the default transmit key used for transmission to the value in i_val.
  • IEEE80211_IOC_WME โ€” turns WME/WMM support on or off depending on the value in i_val. Resets a running interface.
  • IEEE80211_IOC_WME_ACKPOLICY โ€” sets the WME ACK Policy for the Access Class (AC) given in i_len, using the value in i_val.
  • IEEE80211_IOC_WME_ACM โ€” sets the WME Admission Control Mechanism for the Access Class (AC) given in i_len, using the value in i_val.
  • IEEE80211_IOC_WME_AIFS โ€” sets the WME AIFS parameter for the Access Class (AC) given in i_len, using the value in i_val.
  • IEEE80211_IOC_WME_CWMAX โ€” sets the WME CWmax parameter for the Access Class (AC) given in i_len, using the value in i_val.
  • IEEE80211_IOC_WME_CWMIN โ€” sets the WME CWmin parameter for the Access Class (AC) given in i_len, using the value in i_val.
  • IEEE80211_IOC_WME_TXOPLIMIT โ€” sets the WME TxOpLimit parameter for the Access Class (AC) given in i_len, using the value in i_val.
  • IEEE80211_IOC_WPA โ€” sets the WPA configuration using the value in i_val. Resets a running interface. See IEEE80211_IOC_WPA above for the details ๐Ÿ’–.
  • IEEE80211_IOC_WPAKEY โ€” sets the requested cryptographic key using the data in the buffer i_data points to. See IEEE80211_IOC_WPAKEY for the full rundown.
  • IEEE80211_IOC_WPS โ€” turns Wi-Fi Protected Setup (WPS) on or off based on the value in i_val.

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

okay so if you wanna go deeper (and you should, she's an icon), go read:


and that's the whole page bestie, you ate that ๐Ÿซถ go configure some wireless interfaces, you've got this. this masterpiece ships from Debian, dated August 7, 2020, and it's filed under NET80211(4) โ€” iconic behavior, no notes ๐Ÿ’…โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from