iPXE
Functions | Variables
802.11 settings handlers

Functions

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

Variables

struct settings_applicator net80211_applicator __settings_applicator
 802.11 settings applicator More...
 

Detailed Description

Function Documentation

◆ net80211_check_settings_update()

static 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 1891 of file net80211.c.

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

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.

◆ __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.

◆ __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.

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:1891

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 198 of file net80211.c.