Top | ![]() |
![]() |
![]() |
![]() |
gchar * | band | Read / Write |
gchar * | bssid | Read / Write |
guint | channel | Read / Write / Construct |
gchar * | cloned-mac-address | Read / Write |
gchar * | generate-mac-address-mask | Read / Write |
gboolean | hidden | Read / Write |
gchar * | mac-address | Read / Write |
GStrv | mac-address-blacklist | Read / Write |
guint | mac-address-randomization | Read / Write |
gchar * | mode | Read / Write |
guint | mtu | Read / Write / Construct |
guint | powersave | Read / Write |
guint | rate | Read / Write / Construct |
GStrv | seen-bssids | Read / Write |
GBytes * | ssid | Read / Write |
guint | tx-power | Read / Write / Construct |
guint | wake-on-wlan | Read / Write / Construct |
#define | NM_SETTING_WIRELESS_SETTING_NAME |
enum | NMSettingWirelessWakeOnWLan |
#define | NM_SETTING_WIRELESS_SSID |
#define | NM_SETTING_WIRELESS_MODE |
#define | NM_SETTING_WIRELESS_BAND |
#define | NM_SETTING_WIRELESS_CHANNEL |
#define | NM_SETTING_WIRELESS_BSSID |
#define | NM_SETTING_WIRELESS_RATE |
#define | NM_SETTING_WIRELESS_TX_POWER |
#define | NM_SETTING_WIRELESS_MAC_ADDRESS |
#define | NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS |
#define | NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK |
#define | NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST |
#define | NM_SETTING_WIRELESS_MTU |
#define | NM_SETTING_WIRELESS_SEEN_BSSIDS |
#define | NM_SETTING_WIRELESS_HIDDEN |
#define | NM_SETTING_WIRELESS_POWERSAVE |
#define | NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION |
#define | NM_SETTING_WIRELESS_WAKE_ON_WLAN |
#define | NM_SETTING_WIRELESS_MODE_ADHOC |
#define | NM_SETTING_WIRELESS_MODE_AP |
#define | NM_SETTING_WIRELESS_MODE_INFRA |
enum | NMSettingWirelessPowersave |
NMSettingWireless |
GEnum ╰── NMSettingWirelessPowersave GFlags ╰── NMSettingWirelessWakeOnWLan GObject ╰── NMSetting ╰── NMSettingWireless
The NMSettingWireless object is a NMSetting subclass that describes properties necessary for connection to 802.11 Wi-Fi networks.
NMSetting *
nm_setting_wireless_new (void
);
Creates a new NMSettingWireless object with default values.
const char *
nm_setting_wireless_get_mode (NMSettingWireless *setting
);
const char *
nm_setting_wireless_get_band (NMSettingWireless *setting
);
guint32
nm_setting_wireless_get_channel (NMSettingWireless *setting
);
const char *
nm_setting_wireless_get_bssid (NMSettingWireless *setting
);
guint32
nm_setting_wireless_get_tx_power (NMSettingWireless *setting
);
const char *
nm_setting_wireless_get_mac_address (NMSettingWireless *setting
);
const char *
nm_setting_wireless_get_cloned_mac_address
(NMSettingWireless *setting
);
const char *
nm_setting_wireless_get_generate_mac_address_mask
(NMSettingWireless *setting
);
Since: 1.4
const char * const *
nm_setting_wireless_get_mac_address_blacklist
(NMSettingWireless *setting
);
guint32
nm_setting_wireless_get_num_mac_blacklist_items
(NMSettingWireless *setting
);
const char * nm_setting_wireless_get_mac_blacklist_item (NMSettingWireless *setting
,guint32 idx
);
gboolean nm_setting_wireless_add_mac_blacklist_item (NMSettingWireless *setting
,const char *mac
);
Adds a new MAC address to the “mac-address-blacklist” property.
void nm_setting_wireless_remove_mac_blacklist_item (NMSettingWireless *setting
,guint32 idx
);
Removes the MAC address at index idx
from the blacklist.
gboolean nm_setting_wireless_remove_mac_blacklist_item_by_value (NMSettingWireless *setting
,const char *mac
);
Removes the MAC address mac
from the blacklist.
void
nm_setting_wireless_clear_mac_blacklist_items
(NMSettingWireless *setting
);
Removes all blacklisted MAC addresses.
gboolean
nm_setting_wireless_get_hidden (NMSettingWireless *setting
);
guint32
nm_setting_wireless_get_powersave (NMSettingWireless *setting
);
Since: 1.2
NMSettingMacRandomization
nm_setting_wireless_get_mac_address_randomization
(NMSettingWireless *setting
);
Since: 1.2
gboolean nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting
,const char *bssid
);
Adds a new Wi-Fi AP's BSSID to the previously seen BSSID list of the setting. NetworkManager now tracks previously seen BSSIDs internally so this function no longer has much use. Actually, changes you make using this function will not be preserved.
guint32
nm_setting_wireless_get_num_seen_bssids
(NMSettingWireless *setting
);
const char * nm_setting_wireless_get_seen_bssid (NMSettingWireless *setting
,guint32 i
);
gboolean nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless
,NMSettingWirelessSecurity *s_wireless_sec
,NM80211ApFlags ap_flags
,NM80211ApSecurityFlags ap_wpa
,NM80211ApSecurityFlags ap_rsn
,NM80211Mode ap_mode
);
Given a NMSettingWireless and an optional NMSettingWirelessSecurity, determine if the configuration given by the settings is compatible with the security of an access point using that access point's capability flags and mode. Useful for clients that wish to filter a set of connections against a set of access points and determine which connections are compatible with which access points.
s_wireless |
||
s_wireless_sec |
||
ap_flags |
the |
|
ap_wpa |
the |
|
ap_rsn |
the |
|
ap_mode |
the 802.11 mode of the AP, either Ad-Hoc or Infrastructure |
NMSettingWirelessWakeOnWLan
nm_setting_wireless_get_wake_on_wlan (NMSettingWireless *setting
);
Returns the Wake-on-WLAN options enabled for the connection
Since: 1.12
Options for “wake-on-wlan”. Note that not all options are supported by all devices.
Wake-on-WLAN disabled |
||
Wake on any activity |
||
Wake on disconnect |
||
Wake on magic packet |
||
Wake on GTK rekey failure |
||
Wake on EAP identity request |
||
Wake on 4way handshake |
||
Wake on rfkill release |
||
Wake on all events. This does not
include the exclusive flags |
||
Use the default value |
||
Don't change configured settings |
||
Mask of flags that are incompatible with other flags |
Since: 1.12
#define NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS "cloned-mac-address"
#define NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK "generate-mac-address-mask"
#define NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST "mac-address-blacklist"
#define NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION "mac-address-randomization"
#define NM_SETTING_WIRELESS_MODE_ADHOC "adhoc"
Indicates Ad-Hoc mode where no access point is expected to be present.
#define NM_SETTING_WIRELESS_MODE_AP "ap"
Indicates AP/master mode where the wireless device is started as an access point/hotspot.
#define NM_SETTING_WIRELESS_MODE_INFRA "infrastructure"
Indicates infrastructure mode where an access point is expected to be present for this connection.
These flags indicate whether wireless powersave must be enabled.
“band”
property“band” gchar *
802.11 frequency band of the network. One of "a" for 5GHz 802.11a or "bg" for 2.4GHz 802.11. This will lock associations to the Wi-Fi network to the specific band, i.e. if "a" is specified, the device will not associate with the same network in the 2.4GHz band even if the network's settings are compatible. This setting depends on specific driver capability and may not work with all drivers.
Flags: Read / Write
Default value: NULL
“bssid”
property“bssid” gchar *
If specified, directs the device to only associate with the given access point. This capability is highly driver dependent and not supported by all devices. Note: this property does not control the BSSID used when creating an Ad-Hoc network and is unlikely to in the future.
Flags: Read / Write
Default value: NULL
“channel”
property“channel” guint
Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the "band" property to be set.
Flags: Read / Write / Construct
Default value: 0
“cloned-mac-address”
property“cloned-mac-address” gchar *
If specified, request that the device use this MAC address instead. This is known as MAC cloning or spoofing.
Beside explicitly specifying a MAC address, the special values "preserve", "permanent", "random" and "stable" are supported. "preserve" means not to touch the MAC address on activation. "permanent" means to use the permanent hardware address of the device. "random" creates a random MAC address on each connect. "stable" creates a hashed MAC address based on connection.stable-id and a machine dependent key.
If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to "preserve" (older versions of NetworkManager may use a different default value).
On D-Bus, this field is expressed as "assigned-mac-address" or the deprecated "cloned-mac-address".
Flags: Read / Write
Default value: NULL
“generate-mac-address-mask”
property“generate-mac-address-mask” gchar *
With “cloned-mac-address” setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address.
If the property is NULL
, it is eligible to be overwritten by a default
connection setting. If the value is still NULL
or an empty string, the
default is to create a locally-administered, unicast MAC address.
If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm.
If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address.
If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered.
Flags: Read / Write
Default value: NULL
“hidden”
property“hidden” gboolean
If TRUE
, indicates that the network is a non-broadcasting network that
hides its SSID. This works both in infrastructure and AP mode.
In infrastructure mode, various workarounds are used for a more reliable discovery of hidden networks, such as probe-scanning the SSID. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution.
In AP mode, the created network does not broadcast its SSID.
Note that marking the network as hidden may be a privacy issue for you (in infrastructure mode) or client stations (in AP mode), as the explicit probe-scans are distinctly recognizable on the air.
Flags: Read / Write
Default value: FALSE
“mac-address”
property“mac-address” gchar *
If specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing).
Flags: Read / Write
Default value: NULL
“mac-address-blacklist”
property“mac-address-blacklist” GStrv
A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55").
Flags: Read / Write
“mac-address-randomization”
property“mac-address-randomization” guint
One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT
(never randomize unless
the user has set a global default to randomize and the supplicant
supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER
(never
randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS
(always randomize the MAC address). This property is deprecated for
'cloned-mac-address'.
NMSettingWireless:mac-address-randomization
has been deprecated since version 1.4 and should not be used in newly-written code.
Deprecated by NMSettingWireless:cloned-mac-address property
Flags: Read / Write
Default value: 0
Since: 1.2
“mode”
property“mode” gchar *
Wi-Fi network mode; one of "infrastructure", "adhoc" or "ap". If blank, infrastructure is assumed.
Flags: Read / Write
Default value: NULL
“mtu”
property“mtu” guint
If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.
Flags: Read / Write / Construct
Default value: 0
“powersave”
property“powersave” guint
One of NM_SETTING_WIRELESS_POWERSAVE_DISABLE
(disable Wi-Fi power
saving), NM_SETTING_WIRELESS_POWERSAVE_ENABLE
(enable Wi-Fi power
saving), NM_SETTING_WIRELESS_POWERSAVE_IGNORE
(don't touch currently
configure setting) or NM_SETTING_WIRELESS_POWERSAVE_DEFAULT
(use the
globally configured value). All other values are reserved.
Flags: Read / Write
Default value: 0
Since: 1.2
“rate”
property“rate” guint
If non-zero, directs the device to only use the specified bitrate for communication with the access point. Units are in Kb/s, ie 5500 = 5.5 Mbit/s. This property is highly driver dependent and not all devices support setting a static bitrate.
Flags: Read / Write / Construct
Default value: 0
“seen-bssids”
property“seen-bssids” GStrv
A list of BSSIDs (each BSSID formatted as a MAC address like "00:11:22:33:44:55") that have been detected as part of the Wi-Fi network. NetworkManager internally tracks previously seen BSSIDs. The property is only meant for reading and reflects the BSSID list of NetworkManager. The changes you make to this property will not be preserved.
Flags: Read / Write
“ssid”
property“ssid” GBytes *
SSID of the Wi-Fi network. Must be specified.
Flags: Read / Write
“tx-power”
property“tx-power” guint
If non-zero, directs the device to use the specified transmit power. Units are dBm. This property is highly driver dependent and not all devices support setting a static transmit power.
Flags: Read / Write / Construct
Default value: 0
“wake-on-wlan”
property“wake-on-wlan” guint
The NMSettingWirelessWakeOnWLan options to enable. Not all devices support all options.
May be any combination of NM_SETTING_WIRELESS_WAKE_ON_WLAN_ANY
,
NM_SETTING_WIRELESS_WAKE_ON_WLAN_DISCONNECT
,
NM_SETTING_WIRELESS_WAKE_ON_WLAN_MAGIC
,
NM_SETTING_WIRELESS_WAKE_ON_WLAN_GTK_REKEY_FAILURE
,
NM_SETTING_WIRELESS_WAKE_ON_WLAN_EAP_IDENTITY_REQUEST
,
NM_SETTING_WIRELESS_WAKE_ON_WLAN_4WAY_HANDSHAKE
,
NM_SETTING_WIRELESS_WAKE_ON_WLAN_RFKILL_RELEASE
,
NM_SETTING_WIRELESS_WAKE_ON_WLAN_TCP
or the special values
NM_SETTING_WIRELESS_WAKE_ON_WLAN_DEFAULT
(to use global settings) and
NM_SETTING_WIRELESS_WAKE_ON_WLAN_IGNORE
(to disable management of Wake-on-LAN in
NetworkManager).
Flags: Read / Write / Construct
Default value: 1
Since: 1.12