mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 09:28:06 +02:00
supplicant: expose nm_supplicant_driver_to_string() helper function
Will be useful later.
This commit is contained in:
parent
d36df06c24
commit
984e94f01d
3 changed files with 15 additions and 12 deletions
|
|
@ -1805,19 +1805,9 @@ on_wpas_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_d
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (priv->dev != NULL) {
|
if (priv->dev != NULL) {
|
||||||
const char *driver_name = NULL;
|
const char *driver_name;
|
||||||
|
|
||||||
switch (priv->driver) {
|
driver_name = nm_supplicant_driver_to_string (priv->driver);
|
||||||
case NM_SUPPLICANT_DRIVER_WIRELESS:
|
|
||||||
driver_name = NM_WPAS_DEFAULT_WIFI_DRIVER;
|
|
||||||
break;
|
|
||||||
case NM_SUPPLICANT_DRIVER_WIRED:
|
|
||||||
driver_name = "wired";
|
|
||||||
break;
|
|
||||||
case NM_SUPPLICANT_DRIVER_MACSEC:
|
|
||||||
driver_name = "macsec_linux";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_return_if_fail (driver_name);
|
g_return_if_fail (driver_name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,16 @@ NM_CACHED_QUARK_FCN ("nm-supplicant-error-quark", nm_supplicant_error_quark)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
NM_UTILS_LOOKUP_STR_DEFINE (nm_supplicant_driver_to_string, NMSupplicantDriver,
|
||||||
|
NM_UTILS_LOOKUP_DEFAULT_WARN (NULL),
|
||||||
|
NM_UTILS_LOOKUP_ITEM (NM_SUPPLICANT_DRIVER_UNKNOWN, "???"),
|
||||||
|
NM_UTILS_LOOKUP_ITEM (NM_SUPPLICANT_DRIVER_WIRELESS, NM_WPAS_DEFAULT_WIFI_DRIVER),
|
||||||
|
NM_UTILS_LOOKUP_ITEM (NM_SUPPLICANT_DRIVER_WIRED, "wired"),
|
||||||
|
NM_UTILS_LOOKUP_ITEM (NM_SUPPLICANT_DRIVER_MACSEC, "macsec_linux"),
|
||||||
|
);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_caps_set (NMSupplicantManagerPrivate *priv,
|
_caps_set (NMSupplicantManagerPrivate *priv,
|
||||||
NMSupplCapType type,
|
NMSupplCapType type,
|
||||||
|
|
|
||||||
|
|
@ -127,11 +127,14 @@ typedef enum {
|
||||||
} NMSupplicantError;
|
} NMSupplicantError;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
NM_SUPPLICANT_DRIVER_UNKNOWN,
|
||||||
NM_SUPPLICANT_DRIVER_WIRELESS,
|
NM_SUPPLICANT_DRIVER_WIRELESS,
|
||||||
NM_SUPPLICANT_DRIVER_WIRED,
|
NM_SUPPLICANT_DRIVER_WIRED,
|
||||||
NM_SUPPLICANT_DRIVER_MACSEC,
|
NM_SUPPLICANT_DRIVER_MACSEC,
|
||||||
} NMSupplicantDriver;
|
} NMSupplicantDriver;
|
||||||
|
|
||||||
|
const char *nm_supplicant_driver_to_string (NMSupplicantDriver driver);
|
||||||
|
|
||||||
#define NM_SUPPLICANT_ERROR (nm_supplicant_error_quark ())
|
#define NM_SUPPLICANT_ERROR (nm_supplicant_error_quark ())
|
||||||
GQuark nm_supplicant_error_quark (void);
|
GQuark nm_supplicant_error_quark (void);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue