iPXE
802.11 settings handlers

Functions

static int net80211_check_settings_update (void)
 Check for 802.11 SSID or key updates.
const struct setting net80211_ssid_setting __setting (SETTING_NETDEV_EXTRA, ssid)
 The network name to associate with.
const struct setting net80211_active_setting __setting (SETTING_NETDEV_EXTRA, active-scan)
 Whether to use active scanning.
const struct setting net80211_key_setting __setting (SETTING_NETDEV_EXTRA, key)
 The cryptographic key to use.

Variables

struct settings_applicator net80211_applicator __settings_applicator
 802.11 settings applicator

Detailed Description

Function Documentation

◆ net80211_check_settings_update()

int net80211_check_settings_update ( void )
static

Check for 802.11 SSID or key updates.

This acts as a settings applicator; if the user changes netX/ssid, and netX is currently open, the association task will be invoked again. If the user changes the encryption key, the current security handshaker will be asked to update its state to match; if that is impossible without reassociation, we reassociate.

Definition at line 1892 of file net80211.c.

1893{
1894 struct net80211_device *dev;
1895 char ssid[IEEE80211_MAX_SSID_LEN + 1];
1896 int key_reassoc;
1897
1899 if ( ! netdev_is_open ( dev->netdev ) )
1900 continue;
1901
1902 key_reassoc = 0;
1903 if ( dev->handshaker && dev->handshaker->change_key &&
1904 dev->handshaker->change_key ( dev ) < 0 )
1905 key_reassoc = 1;
1906
1908 &net80211_ssid_setting, ssid,
1910
1911 if ( key_reassoc ||
1912 ( ! ( ! ssid[0] && ( dev->state & NET80211_AUTO_SSID ) ) &&
1913 strcmp ( ssid, dev->essid ) != 0 ) ) {
1914 DBGC ( dev, "802.11 %p updating association: "
1915 "%s -> %s\n", dev, dev->essid, ssid );
1916 net80211_autoassociate ( dev );
1917 }
1918 }
1919
1920 return 0;
1921}
#define DBGC(...)
Definition compiler.h:505
#define IEEE80211_MAX_SSID_LEN
Maximum length of an ESSID.
Definition ieee80211.h:77
void net80211_autoassociate(struct net80211_device *dev)
Start 802.11 association process.
Definition net80211.c:1930
#define NET80211_AUTO_SSID
Whether this association was performed using a broadcast SSID.
Definition net80211.h:234
char ssid[0]
SSID data, not NUL-terminated.
Definition ieee80211.h:2
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition list.h:432
static struct list_head net80211_devices
List of 802.11 devices.
Definition net80211.c:48
static int netdev_is_open(struct net_device *netdev)
Check whether or not network device is open.
Definition netdevice.h:662
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
Definition netdevice.h:587
int fetch_string_setting(struct settings *settings, const struct setting *setting, char *data, size_t len)
Fetch value of string setting.
Definition settings.c:842
int strcmp(const char *first, const char *second)
Compare strings.
Definition string.c:174
Structure encapsulating the complete state of an 802.11 device.
Definition net80211.h:787
struct net_device * netdev
The net_device that wraps us.
Definition net80211.h:789
char essid[IEEE80211_MAX_SSID_LEN+1]
SSID of the access point we are or will be associated with.
Definition net80211.h:962
u16 state
State of our association to the network.
Definition net80211.h:921
struct net80211_handshaker * handshaker
Security handshaker being used.
Definition net80211.h:879
struct list_head list
List of 802.11 devices.
Definition net80211.h:792
int(* change_key)(struct net80211_device *dev)
Change cryptographic key based on setting.
Definition net80211.h:639

References net80211_handshaker::change_key, DBGC, net80211_device::essid, fetch_string_setting(), net80211_device::handshaker, IEEE80211_MAX_SSID_LEN, net80211_device::list, list_for_each_entry, NET80211_AUTO_SSID, net80211_autoassociate(), net80211_devices, net80211_device::netdev, netdev_is_open(), netdev_settings(), ssid, net80211_device::state, and strcmp().

◆ __setting() [1/3]

const struct setting net80211_ssid_setting __setting ( SETTING_NETDEV_EXTRA ,
ssid  )

The network name to associate with.

If this is blank, we scan for all networks and use the one with the greatest signal strength.

References __setting, SETTING_NETDEV_EXTRA, and ssid.

◆ __setting() [2/3]

const struct setting net80211_active_setting __setting ( SETTING_NETDEV_EXTRA ,
active- scan )

Whether to use active scanning.

In order to associate with a hidden SSID, it's necessary to use an active scan (send probe packets). If this setting is nonzero, an active scan on the 2.4GHz band will be used to associate.

References __setting, and SETTING_NETDEV_EXTRA.

◆ __setting() [3/3]

const struct setting net80211_key_setting __setting ( SETTING_NETDEV_EXTRA ,
key  )

The cryptographic key to use.

For hex WEP keys, as is common, this must be entered using the normal iPXE method for entering hex settings; an ASCII string of hex characters will not behave as expected.

References __setting, key, and SETTING_NETDEV_EXTRA.

Variable Documentation

◆ __settings_applicator

struct settings_applicator net80211_applicator __settings_applicator
Initial value:
= {
}
static int net80211_check_settings_update(void)
Check for 802.11 SSID or key updates.
Definition net80211.c:1892

802.11 settings applicator

When the SSID is changed, this will cause any open devices to re-associate; when the encryption key is changed, we similarly update their state.

Definition at line 199 of file net80211.c.

199 {
201};