glib-aux: move NMIcmpv6RouterPref to libnm-glib-aux

This commit is contained in:
Thomas Haller 2021-03-04 11:15:18 +01:00
parent 3c733cc32e
commit a016f24353
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
4 changed files with 23 additions and 21 deletions

View file

@ -4860,13 +4860,6 @@ nm_wifi_utils_level_to_quality(int val)
/*****************************************************************************/
NM_UTILS_ENUM2STR_DEFINE(nm_icmpv6_router_pref_to_string,
NMIcmpv6RouterPref,
NM_UTILS_ENUM2STR(NM_ICMPV6_ROUTER_PREF_LOW, "low"),
NM_UTILS_ENUM2STR(NM_ICMPV6_ROUTER_PREF_MEDIUM, "medium"),
NM_UTILS_ENUM2STR(NM_ICMPV6_ROUTER_PREF_HIGH, "high"),
NM_UTILS_ENUM2STR(NM_ICMPV6_ROUTER_PREF_INVALID, "invalid"), );
NM_UTILS_LOOKUP_STR_DEFINE(nm_activation_type_to_string,
NMActivationType,
NM_UTILS_LOOKUP_DEFAULT_WARN("(unknown)"),

View file

@ -413,20 +413,6 @@ char * nm_utils_format_con_diff_for_audit(GHashTable *diff);
/*****************************************************************************/
/* this enum is compatible with ICMPV6_ROUTER_PREF_* (from <linux/icmpv6.h>,
* the values for netlink attribute RTA_PREF) and "enum ndp_route_preference"
* from <ndp.h>. */
typedef enum _nm_packed {
NM_ICMPV6_ROUTER_PREF_MEDIUM = 0x0, /* ICMPV6_ROUTER_PREF_MEDIUM */
NM_ICMPV6_ROUTER_PREF_LOW = 0x3, /* ICMPV6_ROUTER_PREF_LOW */
NM_ICMPV6_ROUTER_PREF_HIGH = 0x1, /* ICMPV6_ROUTER_PREF_HIGH */
NM_ICMPV6_ROUTER_PREF_INVALID = 0x2, /* ICMPV6_ROUTER_PREF_INVALID */
} NMIcmpv6RouterPref;
const char *nm_icmpv6_router_pref_to_string(NMIcmpv6RouterPref pref, char *buf, gsize len);
/*****************************************************************************/
const char *nm_activation_type_to_string(NMActivationType activation_type);
/*****************************************************************************/

View file

@ -1152,6 +1152,15 @@ nm_utils_ipaddr_is_normalized(int addr_family, const char *str_addr)
/*****************************************************************************/
NM_UTILS_ENUM2STR_DEFINE(nm_icmpv6_router_pref_to_string,
NMIcmpv6RouterPref,
NM_UTILS_ENUM2STR(NM_ICMPV6_ROUTER_PREF_LOW, "low"),
NM_UTILS_ENUM2STR(NM_ICMPV6_ROUTER_PREF_MEDIUM, "medium"),
NM_UTILS_ENUM2STR(NM_ICMPV6_ROUTER_PREF_HIGH, "high"),
NM_UTILS_ENUM2STR(NM_ICMPV6_ROUTER_PREF_INVALID, "invalid"), );
/*****************************************************************************/
/**
* nm_g_ascii_strtoll()
* @nptr: the string to parse

View file

@ -501,6 +501,20 @@ gboolean nm_utils_ipaddr_is_normalized(int addr_family, const char *str_addr);
/*****************************************************************************/
/* this enum is compatible with ICMPV6_ROUTER_PREF_* (from <linux/icmpv6.h>,
* the values for netlink attribute RTA_PREF) and "enum ndp_route_preference"
* from <ndp.h>. */
typedef enum _nm_packed {
NM_ICMPV6_ROUTER_PREF_MEDIUM = 0x0, /* ICMPV6_ROUTER_PREF_MEDIUM */
NM_ICMPV6_ROUTER_PREF_LOW = 0x3, /* ICMPV6_ROUTER_PREF_LOW */
NM_ICMPV6_ROUTER_PREF_HIGH = 0x1, /* ICMPV6_ROUTER_PREF_HIGH */
NM_ICMPV6_ROUTER_PREF_INVALID = 0x2, /* ICMPV6_ROUTER_PREF_INVALID */
} NMIcmpv6RouterPref;
const char *nm_icmpv6_router_pref_to_string(NMIcmpv6RouterPref pref, char *buf, gsize len);
/*****************************************************************************/
gboolean nm_utils_memeqzero(gconstpointer data, gsize length);
/*****************************************************************************/