From a016f243532cf5f2b2e5d92b9e2796aeb6757327 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 4 Mar 2021 11:15:18 +0100 Subject: glib-aux: move NMIcmpv6RouterPref to libnm-glib-aux --- src/core/nm-core-utils.c | 7 ------- src/core/nm-core-utils.h | 14 -------------- src/libnm-glib-aux/nm-shared-utils.c | 9 +++++++++ src/libnm-glib-aux/nm-shared-utils.h | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 82360bdd8c..6d6c8ef920 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -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)"), diff --git a/src/core/nm-core-utils.h b/src/core/nm-core-utils.h index 1ab72c4ab8..91ebbe8d26 100644 --- a/src/core/nm-core-utils.h +++ b/src/core/nm-core-utils.h @@ -413,20 +413,6 @@ char * nm_utils_format_con_diff_for_audit(GHashTable *diff); /*****************************************************************************/ -/* this enum is compatible with ICMPV6_ROUTER_PREF_* (from , - * the values for netlink attribute RTA_PREF) and "enum ndp_route_preference" - * from . */ -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); /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-shared-utils.c b/src/libnm-glib-aux/nm-shared-utils.c index 08dec9c654..8abcc7842a 100644 --- a/src/libnm-glib-aux/nm-shared-utils.c +++ b/src/libnm-glib-aux/nm-shared-utils.c @@ -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 diff --git a/src/libnm-glib-aux/nm-shared-utils.h b/src/libnm-glib-aux/nm-shared-utils.h index 8bb94cb73e..1c39e1964a 100644 --- a/src/libnm-glib-aux/nm-shared-utils.h +++ b/src/libnm-glib-aux/nm-shared-utils.h @@ -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 , + * the values for netlink attribute RTA_PREF) and "enum ndp_route_preference" + * from . */ +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); /*****************************************************************************/ -- cgit v1.2.1