diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-01-23 18:38:34 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-07-29 10:28:22 +0200 |
commit | 67797338702d6f0af88ed57888a63ba8b74c8675 (patch) | |
tree | d8048a8568f5fbb650ae5a0db7292372f2e9e6fc | |
parent | 2ae515fffb0785b6bfdbb3e38256d6706affdf19 (diff) | |
download | NetworkManager-67797338702d6f0af88ed57888a63ba8b74c8675.tar.gz |
supplicant-interface: detect mesh support
This ensures that we know whether wpa_supplicant was built with
CONFIG_MESH enabled.
[andreas.kling@peiker-cee.de: add add PROP_MESH_SUPPORT to
set_property()]
-rw-r--r-- | src/supplicant/nm-supplicant-interface.c | 31 | ||||
-rw-r--r-- | src/supplicant/nm-supplicant-interface.h | 6 | ||||
-rw-r--r-- | src/supplicant/nm-supplicant-manager.c | 11 |
3 files changed, 48 insertions, 0 deletions
diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c index 124e216787..079afca3b5 100644 --- a/src/supplicant/nm-supplicant-interface.c +++ b/src/supplicant/nm-supplicant-interface.c @@ -118,6 +118,7 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSupplicantInterface, PROP_PMF_SUPPORT, PROP_FILS_SUPPORT, PROP_P2P_SUPPORT, + PROP_MESH_SUPPORT, PROP_WFD_SUPPORT, PROP_FT_SUPPORT, PROP_SHA384_SUPPORT, @@ -132,6 +133,7 @@ typedef struct { NMSupplicantFeature pmf_support; NMSupplicantFeature fils_support; NMSupplicantFeature p2p_support; + NMSupplicantFeature mesh_support; NMSupplicantFeature wfd_support; NMSupplicantFeature ft_support; NMSupplicantFeature sha384_support; @@ -791,6 +793,12 @@ nm_supplicant_interface_get_p2p_support (NMSupplicantInterface *self) } NMSupplicantFeature +nm_supplicant_interface_get_mesh_support (NMSupplicantInterface *self) +{ + return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->mesh_support; +} + +NMSupplicantFeature nm_supplicant_interface_get_wfd_support (NMSupplicantInterface *self) { return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->wfd_support; @@ -858,6 +866,15 @@ nm_supplicant_interface_set_p2p_support (NMSupplicantInterface *self, } void +nm_supplicant_interface_set_mesh_support (NMSupplicantInterface *self, + NMSupplicantFeature mesh_support) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + priv->mesh_support = mesh_support; +} + +void nm_supplicant_interface_set_wfd_support (NMSupplicantInterface *self, NMSupplicantFeature wfd_support) { @@ -2774,6 +2791,10 @@ set_property (GObject *object, /* construct-only */ priv->p2p_support = g_value_get_int (value); break; + case PROP_MESH_SUPPORT: + /* construct-only */ + priv->mesh_support = g_value_get_int (value); + break; case PROP_WFD_SUPPORT: /* construct-only */ priv->wfd_support = g_value_get_int (value); @@ -2811,6 +2832,7 @@ nm_supplicant_interface_new (const char *ifname, NMSupplicantFeature pmf_support, NMSupplicantFeature fils_support, NMSupplicantFeature p2p_support, + NMSupplicantFeature mesh_support, NMSupplicantFeature wfd_support, NMSupplicantFeature ft_support, NMSupplicantFeature sha384_support) @@ -2828,6 +2850,7 @@ nm_supplicant_interface_new (const char *ifname, NM_SUPPLICANT_INTERFACE_PMF_SUPPORT, (int) pmf_support, NM_SUPPLICANT_INTERFACE_FILS_SUPPORT, (int) fils_support, NM_SUPPLICANT_INTERFACE_P2P_SUPPORT, (int) p2p_support, + NM_SUPPLICANT_INTERFACE_MESH_SUPPORT, (int) mesh_support, NM_SUPPLICANT_INTERFACE_WFD_SUPPORT, (int) wfd_support, NM_SUPPLICANT_INTERFACE_FT_SUPPORT, (int) ft_support, NM_SUPPLICANT_INTERFACE_SHA384_SUPPORT, (int) sha384_support, @@ -2981,6 +3004,14 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + obj_properties[PROP_MESH_SUPPORT] = + g_param_spec_int (NM_SUPPLICANT_INTERFACE_MESH_SUPPORT, "", "", + NM_SUPPLICANT_FEATURE_UNKNOWN, + NM_SUPPLICANT_FEATURE_YES, + NM_SUPPLICANT_FEATURE_UNKNOWN, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); obj_properties[PROP_WFD_SUPPORT] = g_param_spec_int (NM_SUPPLICANT_INTERFACE_WFD_SUPPORT, "", "", NM_SUPPLICANT_FEATURE_UNKNOWN, diff --git a/src/supplicant/nm-supplicant-interface.h b/src/supplicant/nm-supplicant-interface.h index d6d226cbbf..653830dabf 100644 --- a/src/supplicant/nm-supplicant-interface.h +++ b/src/supplicant/nm-supplicant-interface.h @@ -67,6 +67,7 @@ typedef enum { #define NM_SUPPLICANT_INTERFACE_PMF_SUPPORT "pmf-support" #define NM_SUPPLICANT_INTERFACE_FILS_SUPPORT "fils-support" #define NM_SUPPLICANT_INTERFACE_P2P_SUPPORT "p2p-support" +#define NM_SUPPLICANT_INTERFACE_MESH_SUPPORT "mesh-support" #define NM_SUPPLICANT_INTERFACE_WFD_SUPPORT "wfd-support" #define NM_SUPPLICANT_INTERFACE_FT_SUPPORT "ft-support" #define NM_SUPPLICANT_INTERFACE_SHA384_SUPPORT "sha384-support" @@ -97,6 +98,7 @@ NMSupplicantInterface * nm_supplicant_interface_new (const char *ifname, NMSupplicantFeature pmf_support, NMSupplicantFeature fils_support, NMSupplicantFeature p2p_support, + NMSupplicantFeature mesh_support, NMSupplicantFeature wfd_support, NMSupplicantFeature ft_support, NMSupplicantFeature sha384_support); @@ -174,6 +176,7 @@ NMSupplicantFeature nm_supplicant_interface_get_ap_support (NMSupplicantInterfac NMSupplicantFeature nm_supplicant_interface_get_pmf_support (NMSupplicantInterface *self); NMSupplicantFeature nm_supplicant_interface_get_fils_support (NMSupplicantInterface *self); NMSupplicantFeature nm_supplicant_interface_get_p2p_support (NMSupplicantInterface *self); +NMSupplicantFeature nm_supplicant_interface_get_mesh_support (NMSupplicantInterface *self); NMSupplicantFeature nm_supplicant_interface_get_wfd_support (NMSupplicantInterface *self); NMSupplicantFeature nm_supplicant_interface_get_ft_support (NMSupplicantInterface *self); NMSupplicantFeature nm_supplicant_interface_get_sha384_support (NMSupplicantInterface *self); @@ -193,6 +196,9 @@ void nm_supplicant_interface_set_fils_support (NMSupplicantInterface *self, void nm_supplicant_interface_set_p2p_support (NMSupplicantInterface *self, NMSupplicantFeature p2p_support); +void nm_supplicant_interface_set_mesh_support (NMSupplicantInterface *self, + NMSupplicantFeature mesh_support); + void nm_supplicant_interface_set_wfd_support (NMSupplicantInterface *self, NMSupplicantFeature wfd_support); diff --git a/src/supplicant/nm-supplicant-manager.c b/src/supplicant/nm-supplicant-manager.c index d4b5bd8313..df641c5162 100644 --- a/src/supplicant/nm-supplicant-manager.c +++ b/src/supplicant/nm-supplicant-manager.c @@ -39,6 +39,7 @@ typedef struct { NMSupplicantFeature pmf_support; NMSupplicantFeature fils_support; NMSupplicantFeature p2p_support; + NMSupplicantFeature mesh_support; NMSupplicantFeature wfd_support; NMSupplicantFeature ft_support; NMSupplicantFeature sha384_support; @@ -233,6 +234,7 @@ nm_supplicant_manager_create_interface (NMSupplicantManager *self, priv->pmf_support, priv->fils_support, priv->p2p_support, + priv->mesh_support, priv->wfd_support, priv->ft_support, priv->sha384_support); @@ -292,6 +294,7 @@ nm_supplicant_manager_create_interface_from_path (NMSupplicantManager *self, priv->pmf_support, priv->fils_support, priv->p2p_support, + priv->mesh_support, priv->wfd_support, priv->ft_support, priv->sha384_support); @@ -334,6 +337,7 @@ update_capabilities (NMSupplicantManager *self) priv->p2p_support = NM_SUPPLICANT_FEATURE_NO; priv->ft_support = NM_SUPPLICANT_FEATURE_NO; priv->sha384_support = NM_SUPPLICANT_FEATURE_NO; + priv->mesh_support = NM_SUPPLICANT_FEATURE_NO; value = g_dbus_proxy_get_cached_property (priv->proxy, "Capabilities"); if (value) { @@ -345,6 +349,7 @@ update_capabilities (NMSupplicantManager *self) priv->p2p_support = NM_SUPPLICANT_FEATURE_NO; priv->ft_support = NM_SUPPLICANT_FEATURE_NO; priv->sha384_support = NM_SUPPLICANT_FEATURE_NO; + priv->mesh_support = NM_SUPPLICANT_FEATURE_NO; if (array) { if (g_strv_contains (array, "ap")) priv->ap_support = NM_SUPPLICANT_FEATURE_YES; @@ -358,6 +363,8 @@ update_capabilities (NMSupplicantManager *self) priv->ft_support = NM_SUPPLICANT_FEATURE_YES; if (g_strv_contains (array, "sha384")) priv->sha384_support = NM_SUPPLICANT_FEATURE_YES; + if (g_strv_contains (array, "mesh")) + priv->mesh_support = NM_SUPPLICANT_FEATURE_YES; g_free (array); } } @@ -372,6 +379,7 @@ update_capabilities (NMSupplicantManager *self) nm_supplicant_interface_set_p2p_support (ifaces->data, priv->p2p_support); nm_supplicant_interface_set_ft_support (ifaces->data, priv->ft_support); nm_supplicant_interface_set_sha384_support (ifaces->data, priv->sha384_support); + nm_supplicant_interface_set_mesh_support (ifaces->data, priv->mesh_support); } _LOGD ("AP mode is %ssupported", @@ -392,6 +400,9 @@ update_capabilities (NMSupplicantManager *self) _LOGD ("SHA384 is %ssupported", (priv->sha384_support == NM_SUPPLICANT_FEATURE_YES) ? "" : (priv->sha384_support == NM_SUPPLICANT_FEATURE_NO) ? "not " : "possibly "); + _LOGD ("Mesh is %ssupported", + (priv->mesh_support == NM_SUPPLICANT_FEATURE_YES) ? "" : + (priv->mesh_support == NM_SUPPLICANT_FEATURE_NO) ? "not " : "possibly "); /* EAP-FAST */ priv->fast_support = NM_SUPPLICANT_FEATURE_NO; |