IEEE80211(4)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’… IEEE80211(4) β€” the ieee80211 manual page, bestie edition πŸŽ€

okay so this is the ieee80211 page from the Kernel Interfaces Manual β€” yes, the kernel one, we're in the big leagues now. it's literally the standard interface to IEEE 802.11 devices and it's giving "backstage pass to your wifi card's whole personality". let's go ✨

🌸 NAME 🌸

ieee80211 β€” the 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 <net/if_ieee80211.h>

πŸ’– DESCRIPTION πŸ’–

okay so this whole section is about the standard interface for configuration and status info on IEEE 802.11 devices. and like β€” heads up β€” most devices support options that this interface literally cannot configure 😭. those have to be set by their own respective, specific control program. not us. not here. it's giving "not my department".

the interface happens via one of these ioctl(2) calls on a socket:

  • SIOCG80211 β€” get configuration or status information πŸ‘€
  • SIOCS80211 β€” set configuration information ✍️

these requests get made through a modified ifreq structure. and it's defined like this, no cap:

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 */
};

🫢 for SIOCG80211, these are the valid values of i_type 🫢

  • IEEE80211_IOC_SSID β€” returns the requested SSID by copying it into the buffer pointed to by i_data and setting i_len to the length πŸ’Œ. 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. if i_val is -1 then the request refers to the currently active value. main character SSID energy fr.
  • IEEE80211_IOC_NUMSSIDS β€” returns the number of SSIDs this card supports. in most cases that's 1, but some devices such as an(4) support more πŸ‘‘
  • IEEE80211_IOC_WEP β€” returns the current WEP status in i_val. valid values are IEEE80211_WEP_NOSUP, IEEE80211_WEP_ON, IEEE80211_WEP_OFF, and IEEE80211_WEP_MIXED. respectively, these mean unsupported, mandatory for all devices, off, and on but not required for all devices πŸ’€
  • IEEE80211_IOC_WEPKEY β€” returns the requested WEP key via i_data and its length via i_len. 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 πŸ™ˆ. technically this is a valid key, but it is the kind of key an idiot would put on his luggage so we use it as a special value β€” iconic choice, honestly. generally only four WEP keys are allowed, but some devices support more; if so, the first four (0-3) are the standard keys stored in volatile storage and the others are device specific.
  • IEEE80211_IOC_NUMWEPKEYS β€” returns the number of WEP keys supported by this device, generally 4. a device that does not support WEP may either report 0 or simply return EINVAL 😭
  • IEEE80211_IOC_WEPTXKEY β€” returns the WEP key used for transmission πŸ“‘
  • IEEE80211_IOC_AUTHMODE β€” returns the current authentication mode in i_val. valid values are IEEE80211_AUTH_NONE, IEEE80211_AUTH_OPEN, and IEEE80211_AUTH_SHARED πŸ”
  • IEEE80211_IOC_STATIONNAME β€” returns the station name via i_data and its length via i_len. and like… while all known devices seem to support this in some way or another, they all do it differently and it appears to not have anything to do with the actual IEEE 802.11 standard, so making up an answer may be necessary for future devices 🧚 β€” yes, literally vibes-based station names.
  • IEEE80211_IOC_CHANNEL β€” returns the current direct sequence spread spectrum channel in use 🌈
  • IEEE80211_IOC_POWERSAVE β€” returns the current powersaving mode. valid values are IEEE80211_POWERSAVE_NOSUP, IEEE80211_POWERSAVE_OFF, IEEE80211_POWERSAVE_ON, IEEE80211_POWERSAVE_CAM, IEEE80211_POWERSAVE_PSP, and IEEE80211_POWERSAVE_PSP_CAM. currently, IEEE80211_POWERSAVE_ON is defined to be equal to IEEE80211_POWERSAVE_CAM, but this may be incorrect πŸ‘€ (noted, bestie, we're watching it)
  • IEEE80211_IOC_POWERSAVESLEEP β€” returns the powersave sleep time in msec in i_val 😴

πŸ’œ for SIOCS80211, these are the valid values of i_type πŸ’œ

  • IEEE80211_IOC_SSID β€” set the desired SSID for infrastructure and ad-hoc modes to the value given by i_data and i_len. the length should be no longer than 32 characters βœ‚οΈ
  • IEEE80211_IOC_WEP β€” set the current WEP mode to the value given in i_val. valid values are the same as those for this value above. devices which do not support all modes may choose to either return EINVAL or choose a reasonable alternate (supported) setting β€” pick your fighter πŸ’€
  • IEEE80211_IOC_WEPKEY β€” set the WEP key indicated by i_val to the value given by i_data and i_len. generally, valid values of i_len are 0, 5, and 13 β€” though not all devices with WEP support have support for 13-byte keys πŸ’…
  • IEEE80211_IOC_WEPTXKEY β€” set the WEP key used for transmission to the value in i_val. not all values which are valid for setting keys may be valid for setting transmit keys, due to strange device interfaces πŸ™ƒ strange device interfaces, we love you, never change.
  • IEEE80211_IOC_AUTHMODE β€” set the current authorization mode to the value given in i_val. valid values are given above. not all devices support this 🀷
  • IEEE80211_IOC_STATIONNAME β€” set the station name to the value given by i_data and i_len. the standard does not appear to deal with this feature so the range of valid values may vary from device to device πŸŽ€
  • IEEE80211_IOC_CHANNEL β€” set the desired ad-hoc channel to the value given by i_val. on some devices this has an impact on infrastructure mode as well πŸ‘€. valid values are 1-14, but 0 should be allowed and should return the device to the default value. many devices support this directly by converting any invalid value to the default value πŸ¦‹
  • IEEE80211_IOC_POWERSAVE β€” set the current powersaving mode to the value given in i_val. valid values are the same as those for this value above. devices which do not support all modes may choose to either return EINVAL or choose a reasonable alternate (supported) setting. most devices only support CAM mode πŸ”‹
  • IEEE80211_IOC_POWERSAVESLEEP β€” set the powersave sleep time in msec to the value in i_val 😴

πŸ”₯ SEE ALSO πŸ”₯

ioctl(2), an(4), ray(4), wi(4), ifconfig(8) β€” go read those too, bestie, your wifi knowledge will be unmatched, iykyk πŸ‘‘

πŸ¦‹ HISTORY πŸ¦‹

the ieee80211 manual appeared in FreeBSD 4.3 πŸ“œβœ¨


and that's the whole page, periodt πŸ’… this edition came from Debian, dated February 23, 2001 β€” a vintage icon, honestly, we stan a classic πŸŽ€πŸ’–

πŸ“¦ where this page comes from