From 75b3107b098cd451226f3227c0ba41d29e13df71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 24 Aug 2015 11:02:34 +0200 Subject: [PATCH] libnm-util: fix flags for GObject introspection (rh #1255436) Without marking the enumeration as flags, the types will be "enumeration" instead of "bitfield". And python raises ValueError exception. Example: from gi.repository import NMClient, NetworkManager client = NMClient.Client.new() for dev in client.get_devices(): if dev.get_device_type() == NetworkManager.DeviceType.WIFI: for ap in dev.get_access_points(): ap.get_rsn_flags() raises "ValueError: invalid enum value: 648" https://bugzilla.redhat.com/show_bug.cgi?id=1255436 --- libnm-util/NetworkManager.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libnm-util/NetworkManager.h b/libnm-util/NetworkManager.h index c55bd463cb..b6827c2cbc 100644 --- a/libnm-util/NetworkManager.h +++ b/libnm-util/NetworkManager.h @@ -185,7 +185,7 @@ typedef enum { * * (Corresponds to the NM_DEVICE_CAP type in nm-device-wifi.xml.) **/ -typedef enum { +typedef enum { /*< flags >*/ NM_DEVICE_CAP_NONE = 0x00000000, NM_DEVICE_CAP_NM_SUPPORTED = 0x00000001, NM_DEVICE_CAP_CARRIER_DETECT = 0x00000002, @@ -212,7 +212,7 @@ typedef enum { * * (Corresponds to the NM_802_11_DEVICE_CAP type in nm-device-wifi.xml.) **/ -typedef enum { +typedef enum { /*< flags >*/ NM_WIFI_DEVICE_CAP_NONE = 0x00000000, NM_WIFI_DEVICE_CAP_CIPHER_WEP40 = 0x00000001, NM_WIFI_DEVICE_CAP_CIPHER_WEP104 = 0x00000002, @@ -238,7 +238,7 @@ typedef enum { * * (Corresponds to the NM_802_11_AP_FLAGS type in nm-access-point.xml.) **/ -typedef enum { +typedef enum { /*< underscore_name=nm_802_11_ap_flags, flags >*/ NM_802_11_AP_FLAGS_NONE = 0x00000000, NM_802_11_AP_FLAGS_PRIVACY = 0x00000001 } NM80211ApFlags; @@ -270,7 +270,7 @@ typedef enum { * * (Corresponds to the NM_802_11_AP_SEC type in nm-access-point.xml.) **/ -typedef enum { +typedef enum { /*< underscore_name=nm_802_11_ap_security_flags, flags >*/ NM_802_11_AP_SEC_NONE = 0x00000000, NM_802_11_AP_SEC_PAIR_WEP40 = 0x00000001, NM_802_11_AP_SEC_PAIR_WEP104 = 0x00000002, @@ -301,7 +301,7 @@ typedef enum { * * (Corresponds to the NM_802_11_MODE type in generic-types.xml.) **/ -typedef enum { +typedef enum { /*< underscore_name=nm_802_11_mode >*/ NM_802_11_MODE_UNKNOWN = 0, NM_802_11_MODE_ADHOC, NM_802_11_MODE_INFRA, @@ -319,7 +319,7 @@ typedef enum { * * (Corresponds to the NM_BT_CAPABILITY type in nm-device-bt.xml.) **/ -typedef enum { +typedef enum { /*< flags >*/ NM_BT_CAPABILITY_NONE = 0x00000000, NM_BT_CAPABILITY_DUN = 0x00000001, NM_BT_CAPABILITY_NAP = 0x00000002, @@ -343,7 +343,7 @@ typedef enum { * * (Corresponds to the NM_DEVICE_MODEM_CAPABILITY type in nm-device-modem.xml.) **/ -typedef enum { +typedef enum { /*< flags >*/ NM_DEVICE_MODEM_CAPABILITY_NONE = 0x00000000, NM_DEVICE_MODEM_CAPABILITY_POTS = 0x00000001, NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO = 0x00000002,