mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 15:10:05 +01:00
wifi: export the Wi-Fi generation of access points
With this, clients can show the Wi-Fi generation to users. It can be useful to choose which AP or network to connect to.
This commit is contained in:
parent
d41fbc2fde
commit
5d3db07e40
10 changed files with 195 additions and 62 deletions
|
|
@ -38,7 +38,8 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMWifiAP,
|
||||||
PROP_MAX_BITRATE,
|
PROP_MAX_BITRATE,
|
||||||
PROP_BANDWIDTH,
|
PROP_BANDWIDTH,
|
||||||
PROP_STRENGTH,
|
PROP_STRENGTH,
|
||||||
PROP_LAST_SEEN, );
|
PROP_LAST_SEEN,
|
||||||
|
PROP_WIFI_GENERATION, );
|
||||||
|
|
||||||
struct _NMWifiAPPrivate {
|
struct _NMWifiAPPrivate {
|
||||||
/* Scanned or cached values */
|
/* Scanned or cached values */
|
||||||
|
|
@ -57,6 +58,7 @@ struct _NMWifiAPPrivate {
|
||||||
NM80211ApFlags flags; /* General flags */
|
NM80211ApFlags flags; /* General flags */
|
||||||
NM80211ApSecurityFlags wpa_flags; /* WPA-related flags */
|
NM80211ApSecurityFlags wpa_flags; /* WPA-related flags */
|
||||||
NM80211ApSecurityFlags rsn_flags; /* RSN (WPA2) -related flags */
|
NM80211ApSecurityFlags rsn_flags; /* RSN (WPA2) -related flags */
|
||||||
|
NMWifiGeneration wifi_generation;
|
||||||
|
|
||||||
bool metered : 1;
|
bool metered : 1;
|
||||||
|
|
||||||
|
|
@ -367,6 +369,19 @@ nm_wifi_ap_set_last_seen(NMWifiAP *ap, gint32 last_seen_msec)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
nm_wifi_ap_set_wifi_generation(NMWifiAP *ap, NMWifiGeneration wifi_generation)
|
||||||
|
{
|
||||||
|
NMWifiAPPrivate *priv = NM_WIFI_AP_GET_PRIVATE(ap);
|
||||||
|
|
||||||
|
if (priv->wifi_generation != wifi_generation) {
|
||||||
|
priv->wifi_generation = wifi_generation;
|
||||||
|
_notify(ap, PROP_WIFI_GENERATION);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
nm_wifi_ap_get_metered(const NMWifiAP *self)
|
nm_wifi_ap_get_metered(const NMWifiAP *self)
|
||||||
{
|
{
|
||||||
|
|
@ -431,6 +446,8 @@ nm_wifi_ap_update_from_properties(NMWifiAP *ap, const NMSupplicantBssInfo *bss_i
|
||||||
changed |= nm_wifi_ap_set_wpa_flags(ap, bss_info->wpa_flags);
|
changed |= nm_wifi_ap_set_wpa_flags(ap, bss_info->wpa_flags);
|
||||||
changed |= nm_wifi_ap_set_rsn_flags(ap, bss_info->rsn_flags);
|
changed |= nm_wifi_ap_set_rsn_flags(ap, bss_info->rsn_flags);
|
||||||
|
|
||||||
|
changed |= nm_wifi_ap_set_wifi_generation(ap, bss_info->wifi_generation);
|
||||||
|
|
||||||
changed |= nm_wifi_ap_set_last_seen(ap, bss_info->last_seen_msec);
|
changed |= nm_wifi_ap_set_last_seen(ap, bss_info->last_seen_msec);
|
||||||
|
|
||||||
changed |= nm_wifi_ap_set_fake(ap, FALSE);
|
changed |= nm_wifi_ap_set_fake(ap, FALSE);
|
||||||
|
|
@ -718,6 +735,9 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||||
1)
|
1)
|
||||||
: -1);
|
: -1);
|
||||||
break;
|
break;
|
||||||
|
case PROP_WIFI_GENERATION:
|
||||||
|
g_value_set_uint(value, priv->wifi_generation);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -742,6 +762,7 @@ nm_wifi_ap_init(NMWifiAP *self)
|
||||||
priv->wpa_flags = NM_802_11_AP_SEC_NONE;
|
priv->wpa_flags = NM_802_11_AP_SEC_NONE;
|
||||||
priv->rsn_flags = NM_802_11_AP_SEC_NONE;
|
priv->rsn_flags = NM_802_11_AP_SEC_NONE;
|
||||||
priv->last_seen_msec = G_MININT64;
|
priv->last_seen_msec = G_MININT64;
|
||||||
|
priv->wifi_generation = NM_WIFI_GENERATION_LEGACY;
|
||||||
}
|
}
|
||||||
|
|
||||||
NMWifiAP *
|
NMWifiAP *
|
||||||
|
|
@ -898,9 +919,10 @@ static const NMDBusInterfaceInfoExtended interface_info_access_point = {
|
||||||
NM_WIFI_AP_MAX_BITRATE),
|
NM_WIFI_AP_MAX_BITRATE),
|
||||||
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Bandwidth", "u", NM_WIFI_AP_BANDWIDTH),
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Bandwidth", "u", NM_WIFI_AP_BANDWIDTH),
|
||||||
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Strength", "y", NM_WIFI_AP_STRENGTH),
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Strength", "y", NM_WIFI_AP_STRENGTH),
|
||||||
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("LastSeen",
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("LastSeen", "i", NM_WIFI_AP_LAST_SEEN),
|
||||||
"i",
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("WifiGeneration",
|
||||||
NM_WIFI_AP_LAST_SEEN), ), ),
|
"u",
|
||||||
|
NM_WIFI_AP_WIFI_GENERATION), ), ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -1003,6 +1025,15 @@ nm_wifi_ap_class_init(NMWifiAPClass *ap_class)
|
||||||
-1,
|
-1,
|
||||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_WIFI_GENERATION] =
|
||||||
|
g_param_spec_uint(NM_WIFI_AP_WIFI_GENERATION,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
NM_WIFI_GENERATION_LEGACY,
|
||||||
|
G_MAXUINT,
|
||||||
|
NM_WIFI_GENERATION_LEGACY,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
obj_properties[PROP_BANDWIDTH] = g_param_spec_uint(NM_WIFI_AP_BANDWIDTH,
|
obj_properties[PROP_BANDWIDTH] = g_param_spec_uint(NM_WIFI_AP_BANDWIDTH,
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
#define NM_WIFI_AP_BANDWIDTH "bandwidth"
|
#define NM_WIFI_AP_BANDWIDTH "bandwidth"
|
||||||
#define NM_WIFI_AP_STRENGTH "strength"
|
#define NM_WIFI_AP_STRENGTH "strength"
|
||||||
#define NM_WIFI_AP_LAST_SEEN "last-seen"
|
#define NM_WIFI_AP_LAST_SEEN "last-seen"
|
||||||
|
#define NM_WIFI_AP_WIFI_GENERATION "wifi-generation"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMDBusObject parent;
|
NMDBusObject parent;
|
||||||
|
|
|
||||||
|
|
@ -4901,6 +4901,10 @@ get_bandwidth_vht(const guint8 *bytes, guint len, guint32 *out_bandwidth)
|
||||||
#define WLAN_EID_VHT_CAPABILITY 191
|
#define WLAN_EID_VHT_CAPABILITY 191
|
||||||
#define WLAN_EID_VHT_OPERATION 192
|
#define WLAN_EID_VHT_OPERATION 192
|
||||||
#define WLAN_EID_VENDOR_SPECIFIC 221
|
#define WLAN_EID_VENDOR_SPECIFIC 221
|
||||||
|
#define WLAN_EID_EXTENSION 255
|
||||||
|
|
||||||
|
#define WLAN_EID_EXT_HE_CAPABILITY 35
|
||||||
|
#define WLAN_EID_EXT_EHT_CAPABILITY 108
|
||||||
|
|
||||||
void
|
void
|
||||||
nm_wifi_utils_parse_ies(const guint8 *bytes,
|
nm_wifi_utils_parse_ies(const guint8 *bytes,
|
||||||
|
|
@ -4908,7 +4912,8 @@ nm_wifi_utils_parse_ies(const guint8 *bytes,
|
||||||
guint32 *out_max_rate,
|
guint32 *out_max_rate,
|
||||||
guint32 *out_bandwidth,
|
guint32 *out_bandwidth,
|
||||||
gboolean *out_metered,
|
gboolean *out_metered,
|
||||||
gboolean *out_owe_transition_mode)
|
gboolean *out_owe_transition_mode,
|
||||||
|
NMWifiGeneration *out_wifi_generation)
|
||||||
{
|
{
|
||||||
guint8 id, elem_len;
|
guint8 id, elem_len;
|
||||||
guint32 m;
|
guint32 m;
|
||||||
|
|
@ -4917,6 +4922,7 @@ nm_wifi_utils_parse_ies(const guint8 *bytes,
|
||||||
NM_SET_OUT(out_bandwidth, 0);
|
NM_SET_OUT(out_bandwidth, 0);
|
||||||
NM_SET_OUT(out_metered, FALSE);
|
NM_SET_OUT(out_metered, FALSE);
|
||||||
NM_SET_OUT(out_owe_transition_mode, FALSE);
|
NM_SET_OUT(out_owe_transition_mode, FALSE);
|
||||||
|
NM_SET_OUT(out_wifi_generation, NM_WIFI_GENERATION_LEGACY);
|
||||||
|
|
||||||
while (len) {
|
while (len) {
|
||||||
if (len < 2)
|
if (len < 2)
|
||||||
|
|
@ -4931,6 +4937,9 @@ nm_wifi_utils_parse_ies(const guint8 *bytes,
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case WLAN_EID_HT_CAPABILITY:
|
case WLAN_EID_HT_CAPABILITY:
|
||||||
|
if (out_wifi_generation && *out_wifi_generation < NM_WIFI_GENERATION_WIFI_4)
|
||||||
|
*out_wifi_generation = NM_WIFI_GENERATION_WIFI_4;
|
||||||
|
|
||||||
if (out_max_rate) {
|
if (out_max_rate) {
|
||||||
if (get_max_rate_ht(bytes, elem_len, &m))
|
if (get_max_rate_ht(bytes, elem_len, &m))
|
||||||
*out_max_rate = NM_MAX(*out_max_rate, m);
|
*out_max_rate = NM_MAX(*out_max_rate, m);
|
||||||
|
|
@ -4941,6 +4950,9 @@ nm_wifi_utils_parse_ies(const guint8 *bytes,
|
||||||
get_bandwidth_ht(bytes, elem_len, out_bandwidth);
|
get_bandwidth_ht(bytes, elem_len, out_bandwidth);
|
||||||
break;
|
break;
|
||||||
case WLAN_EID_VHT_CAPABILITY:
|
case WLAN_EID_VHT_CAPABILITY:
|
||||||
|
if (out_wifi_generation && *out_wifi_generation < NM_WIFI_GENERATION_WIFI_5)
|
||||||
|
*out_wifi_generation = NM_WIFI_GENERATION_WIFI_5;
|
||||||
|
|
||||||
if (out_max_rate) {
|
if (out_max_rate) {
|
||||||
if (get_max_rate_vht(bytes, elem_len, &m))
|
if (get_max_rate_vht(bytes, elem_len, &m))
|
||||||
*out_max_rate = NM_MAX(*out_max_rate, m);
|
*out_max_rate = NM_MAX(*out_max_rate, m);
|
||||||
|
|
@ -4950,6 +4962,19 @@ nm_wifi_utils_parse_ies(const guint8 *bytes,
|
||||||
if (out_bandwidth)
|
if (out_bandwidth)
|
||||||
get_bandwidth_vht(bytes, elem_len, out_bandwidth);
|
get_bandwidth_vht(bytes, elem_len, out_bandwidth);
|
||||||
break;
|
break;
|
||||||
|
case WLAN_EID_EXTENSION:
|
||||||
|
if (out_wifi_generation && elem_len >= 1) {
|
||||||
|
guint8 ext_id = bytes[0];
|
||||||
|
|
||||||
|
if (ext_id == WLAN_EID_EXT_HE_CAPABILITY) {
|
||||||
|
if (*out_wifi_generation < NM_WIFI_GENERATION_WIFI_6)
|
||||||
|
*out_wifi_generation = NM_WIFI_GENERATION_WIFI_6;
|
||||||
|
} else if (ext_id == WLAN_EID_EXT_EHT_CAPABILITY) {
|
||||||
|
if (*out_wifi_generation < NM_WIFI_GENERATION_WIFI_7)
|
||||||
|
*out_wifi_generation = NM_WIFI_GENERATION_WIFI_7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case WLAN_EID_VENDOR_SPECIFIC:
|
case WLAN_EID_VENDOR_SPECIFIC:
|
||||||
if (len == 8 && bytes[0] == 0x00 /* OUI: Microsoft */
|
if (len == 8 && bytes[0] == 0x00 /* OUI: Microsoft */
|
||||||
&& bytes[1] == 0x50 && bytes[2] == 0xf2
|
&& bytes[1] == 0x50 && bytes[2] == 0xf2
|
||||||
|
|
|
||||||
|
|
@ -463,7 +463,8 @@ void nm_wifi_utils_parse_ies(const guint8 *bytes,
|
||||||
guint32 *out_max_rate,
|
guint32 *out_max_rate,
|
||||||
guint32 *out_bandwidth,
|
guint32 *out_bandwidth,
|
||||||
gboolean *out_metered,
|
gboolean *out_metered,
|
||||||
gboolean *out_owe_transition_mode);
|
gboolean *out_owe_transition_mode,
|
||||||
|
NMWifiGeneration *out_wifi_generation);
|
||||||
|
|
||||||
guint8 nm_wifi_utils_level_to_quality(int val);
|
guint8 nm_wifi_utils_level_to_quality(int val);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <linux/if_ether.h>
|
#include <linux/if_ether.h>
|
||||||
|
|
||||||
|
#include "core/nm-core-utils.h"
|
||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
#include "libnm-core-intern/nm-core-internal.h"
|
#include "libnm-core-intern/nm-core-internal.h"
|
||||||
#include "libnm-glib-aux/nm-c-list.h"
|
#include "libnm-glib-aux/nm-c-list.h"
|
||||||
|
|
@ -769,6 +770,7 @@ _bss_info_properties_changed(NMSupplicantInterface *self,
|
||||||
gboolean p_metered;
|
gboolean p_metered;
|
||||||
guint32 rate;
|
guint32 rate;
|
||||||
guint32 bandwidth;
|
guint32 bandwidth;
|
||||||
|
NMWifiGeneration p_wifi_generation;
|
||||||
|
|
||||||
arr_data = g_variant_get_fixed_array(v_v, &arr_len, 1);
|
arr_data = g_variant_get_fixed_array(v_v, &arr_len, 1);
|
||||||
nm_wifi_utils_parse_ies(arr_data,
|
nm_wifi_utils_parse_ies(arr_data,
|
||||||
|
|
@ -776,7 +778,8 @@ _bss_info_properties_changed(NMSupplicantInterface *self,
|
||||||
&rate,
|
&rate,
|
||||||
&bandwidth,
|
&bandwidth,
|
||||||
&p_metered,
|
&p_metered,
|
||||||
&p_owe_transition_mode);
|
&p_owe_transition_mode,
|
||||||
|
&p_wifi_generation);
|
||||||
p_max_rate = NM_MAX(p_max_rate, rate);
|
p_max_rate = NM_MAX(p_max_rate, rate);
|
||||||
p_max_rate_has = TRUE;
|
p_max_rate_has = TRUE;
|
||||||
g_variant_unref(v_v);
|
g_variant_unref(v_v);
|
||||||
|
|
@ -788,6 +791,7 @@ _bss_info_properties_changed(NMSupplicantInterface *self,
|
||||||
|
|
||||||
bss_info->metered = p_metered;
|
bss_info->metered = p_metered;
|
||||||
bss_info->bandwidth = bandwidth;
|
bss_info->bandwidth = bandwidth;
|
||||||
|
bss_info->wifi_generation = (guint8) p_wifi_generation;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_max_rate_has)
|
if (p_max_rate_has)
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,8 @@ typedef struct _NMSupplicantBssInfo {
|
||||||
|
|
||||||
bool _bss_dirty : 1;
|
bool _bss_dirty : 1;
|
||||||
|
|
||||||
|
guint8 wifi_generation; /* NMWifiGeneration */
|
||||||
|
|
||||||
} NMSupplicantBssInfo;
|
} NMSupplicantBssInfo;
|
||||||
|
|
||||||
typedef struct _NMSupplicantPeerInfo {
|
typedef struct _NMSupplicantPeerInfo {
|
||||||
|
|
|
||||||
|
|
@ -2096,7 +2096,9 @@ global:
|
||||||
|
|
||||||
libnm_1_58_0 {
|
libnm_1_58_0 {
|
||||||
global:
|
global:
|
||||||
|
nm_access_point_get_wifi_generation;
|
||||||
nm_utils_wifi_6ghz_freqs;
|
nm_utils_wifi_6ghz_freqs;
|
||||||
nm_utils_wifi_freq_to_band;
|
nm_utils_wifi_freq_to_band;
|
||||||
nm_wifi_band_get_type;
|
nm_wifi_band_get_type;
|
||||||
|
nm_wifi_generation_get_type;
|
||||||
} libnm_1_56_0;
|
} libnm_1_56_0;
|
||||||
|
|
@ -34,7 +34,8 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMAccessPoint,
|
||||||
PROP_BANDWIDTH,
|
PROP_BANDWIDTH,
|
||||||
PROP_STRENGTH,
|
PROP_STRENGTH,
|
||||||
PROP_BSSID,
|
PROP_BSSID,
|
||||||
PROP_LAST_SEEN, );
|
PROP_LAST_SEEN,
|
||||||
|
PROP_WIFI_GENERATION, );
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GBytes *ssid;
|
GBytes *ssid;
|
||||||
|
|
@ -48,6 +49,7 @@ typedef struct {
|
||||||
guint32 bandwidth;
|
guint32 bandwidth;
|
||||||
gint32 last_seen;
|
gint32 last_seen;
|
||||||
guint8 strength;
|
guint8 strength;
|
||||||
|
NMWifiGeneration wifi_generation;
|
||||||
} NMAccessPointPrivate;
|
} NMAccessPointPrivate;
|
||||||
|
|
||||||
struct _NMAccessPoint {
|
struct _NMAccessPoint {
|
||||||
|
|
@ -256,6 +258,24 @@ nm_access_point_get_last_seen(NMAccessPoint *ap)
|
||||||
}
|
}
|
||||||
NM_BACKPORT_SYMBOL(libnm_1_0_6, int, nm_access_point_get_last_seen, (NMAccessPoint * ap), (ap));
|
NM_BACKPORT_SYMBOL(libnm_1_0_6, int, nm_access_point_get_last_seen, (NMAccessPoint * ap), (ap));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_access_point_get_wifi_generation:
|
||||||
|
* @ap: a #NMAccessPoint
|
||||||
|
*
|
||||||
|
* Gets the Wi-Fi Generation (Wi-Fi 4, Wi-Fi 5, etc.) of the access point.
|
||||||
|
*
|
||||||
|
* Returns: the Wi-Fi Generation
|
||||||
|
*
|
||||||
|
* Since: 1.58
|
||||||
|
**/
|
||||||
|
NMWifiGeneration
|
||||||
|
nm_access_point_get_wifi_generation(NMAccessPoint *ap)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail(NM_IS_ACCESS_POINT(ap), NM_WIFI_GENERATION_LEGACY);
|
||||||
|
|
||||||
|
return NM_ACCESS_POINT_GET_PRIVATE(ap)->wifi_generation;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_access_point_connection_valid:
|
* nm_access_point_connection_valid:
|
||||||
* @ap: an #NMAccessPoint to validate @connection against
|
* @ap: an #NMAccessPoint to validate @connection against
|
||||||
|
|
@ -496,6 +516,9 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||||
case PROP_LAST_SEEN:
|
case PROP_LAST_SEEN:
|
||||||
g_value_set_int(value, nm_access_point_get_last_seen(ap));
|
g_value_set_int(value, nm_access_point_get_last_seen(ap));
|
||||||
break;
|
break;
|
||||||
|
case PROP_WIFI_GENERATION:
|
||||||
|
g_value_set_uint(value, nm_access_point_get_wifi_generation(ap));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -523,6 +546,10 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_accesspoint = NML_DBUS_META_IFACE
|
||||||
NML_DBUS_META_PROPERTY_INIT_U("RsnFlags", PROP_RSN_FLAGS, NMAccessPoint, _priv.rsn_flags),
|
NML_DBUS_META_PROPERTY_INIT_U("RsnFlags", PROP_RSN_FLAGS, NMAccessPoint, _priv.rsn_flags),
|
||||||
NML_DBUS_META_PROPERTY_INIT_AY("Ssid", PROP_SSID, NMAccessPoint, _priv.ssid),
|
NML_DBUS_META_PROPERTY_INIT_AY("Ssid", PROP_SSID, NMAccessPoint, _priv.ssid),
|
||||||
NML_DBUS_META_PROPERTY_INIT_Y("Strength", PROP_STRENGTH, NMAccessPoint, _priv.strength),
|
NML_DBUS_META_PROPERTY_INIT_Y("Strength", PROP_STRENGTH, NMAccessPoint, _priv.strength),
|
||||||
|
NML_DBUS_META_PROPERTY_INIT_U("WifiGeneration",
|
||||||
|
PROP_WIFI_GENERATION,
|
||||||
|
NMAccessPoint,
|
||||||
|
_priv.wifi_generation),
|
||||||
NML_DBUS_META_PROPERTY_INIT_U("WpaFlags",
|
NML_DBUS_META_PROPERTY_INIT_U("WpaFlags",
|
||||||
PROP_WPA_FLAGS,
|
PROP_WPA_FLAGS,
|
||||||
NMAccessPoint,
|
NMAccessPoint,
|
||||||
|
|
@ -693,5 +720,21 @@ nm_access_point_class_init(NMAccessPointClass *ap_class)
|
||||||
-1,
|
-1,
|
||||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NMAccessPoint:wifi-generation:
|
||||||
|
*
|
||||||
|
* The Wi-Fi generation of the access point.
|
||||||
|
*
|
||||||
|
* Since: 1.58
|
||||||
|
**/
|
||||||
|
obj_properties[PROP_WIFI_GENERATION] =
|
||||||
|
g_param_spec_uint(NM_ACCESS_POINT_WIFI_GENERATION,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
NM_WIFI_GENERATION_LEGACY,
|
||||||
|
NM_WIFI_GENERATION_WIFI_7,
|
||||||
|
NM_WIFI_GENERATION_LEGACY,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
_nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_accesspoint);
|
_nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_accesspoint);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ G_BEGIN_DECLS
|
||||||
#define NM_ACCESS_POINT_STRENGTH "strength"
|
#define NM_ACCESS_POINT_STRENGTH "strength"
|
||||||
#define NM_ACCESS_POINT_LAST_SEEN "last-seen"
|
#define NM_ACCESS_POINT_LAST_SEEN "last-seen"
|
||||||
#define NM_ACCESS_POINT_BANDWIDTH "bandwidth"
|
#define NM_ACCESS_POINT_BANDWIDTH "bandwidth"
|
||||||
|
#define NM_ACCESS_POINT_WIFI_GENERATION "wifi-generation"
|
||||||
|
|
||||||
/* DEPRECATED */
|
/* DEPRECATED */
|
||||||
#define NM_ACCESS_POINT_HW_ADDRESS "hw-address"
|
#define NM_ACCESS_POINT_HW_ADDRESS "hw-address"
|
||||||
|
|
@ -63,6 +64,9 @@ int nm_access_point_get_last_seen(NMAccessPoint *ap);
|
||||||
NM_AVAILABLE_IN_1_46
|
NM_AVAILABLE_IN_1_46
|
||||||
guint32 nm_access_point_get_bandwidth(NMAccessPoint *ap);
|
guint32 nm_access_point_get_bandwidth(NMAccessPoint *ap);
|
||||||
|
|
||||||
|
NM_AVAILABLE_IN_1_58
|
||||||
|
NMWifiGeneration nm_access_point_get_wifi_generation(NMAccessPoint *ap);
|
||||||
|
|
||||||
GPtrArray *nm_access_point_filter_connections(NMAccessPoint *ap, const GPtrArray *connections);
|
GPtrArray *nm_access_point_filter_connections(NMAccessPoint *ap, const GPtrArray *connections);
|
||||||
|
|
||||||
gboolean nm_access_point_connection_valid(NMAccessPoint *ap, NMConnection *connection);
|
gboolean nm_access_point_connection_valid(NMAccessPoint *ap, NMConnection *connection);
|
||||||
|
|
|
||||||
|
|
@ -418,6 +418,26 @@ typedef enum /*< underscore_name=nm_802_11_ap_security_flags, flags >*/ {
|
||||||
NM_802_11_AP_SEC_KEY_MGMT_EAP_SUITE_B_192 = 0x00002000,
|
NM_802_11_AP_SEC_KEY_MGMT_EAP_SUITE_B_192 = 0x00002000,
|
||||||
} NM80211ApSecurityFlags;
|
} NM80211ApSecurityFlags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NMWifiGeneration:
|
||||||
|
* @NM_WIFI_GENERATION_LEGACY: pre-Wi-Fi 4 (802.11a/b/g)
|
||||||
|
* @NM_WIFI_GENERATION_WIFI_4: Wi-Fi 4 (802.11n)
|
||||||
|
* @NM_WIFI_GENERATION_WIFI_5: Wi-Fi 5 (802.11ac)
|
||||||
|
* @NM_WIFI_GENERATION_WIFI_6: Wi-Fi 6 (802.11ax)
|
||||||
|
* @NM_WIFI_GENERATION_WIFI_7: Wi-Fi 7 (802.11be)
|
||||||
|
*
|
||||||
|
* 802.11 Wi-Fi generation.
|
||||||
|
*
|
||||||
|
* Since: 1.58
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
NM_WIFI_GENERATION_LEGACY = 0,
|
||||||
|
NM_WIFI_GENERATION_WIFI_4 = 4,
|
||||||
|
NM_WIFI_GENERATION_WIFI_5 = 5,
|
||||||
|
NM_WIFI_GENERATION_WIFI_6 = 6,
|
||||||
|
NM_WIFI_GENERATION_WIFI_7 = 7,
|
||||||
|
} NMWifiGeneration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NM80211Mode:
|
* NM80211Mode:
|
||||||
* @NM_802_11_MODE_UNKNOWN: the device or access point mode is unknown
|
* @NM_802_11_MODE_UNKNOWN: the device or access point mode is unknown
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue