Commit 67797338 authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

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()]
parent 2ae515ff
......@@ -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;
......@@ -790,6 +792,12 @@ nm_supplicant_interface_get_p2p_support (NMSupplicantInterface *self)
return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->p2p_support;
}
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)
{
......@@ -857,6 +865,15 @@ nm_supplicant_interface_set_p2p_support (NMSupplicantInterface *self,
priv->p2p_support = p2p_support;
}
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,
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment