summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-03-03 20:57:01 +0100
committerThomas Haller <thaller@redhat.com>2021-03-05 11:09:14 +0100
commite691657da0436d2552758e0ee7b0be324e2e6bf4 (patch)
treed8a6ca8647ee53138fd339ae9fa82baf8d4c3a2b
parent82e2a694d765f3174b8208b39215a8308cfb00c1 (diff)
downloadNetworkManager-e691657da0436d2552758e0ee7b0be324e2e6bf4.tar.gz
core: use _NMVlanFlags instead of NMVlanFlags
-rw-r--r--src/core/devices/nm-device-vlan.c10
-rw-r--r--src/core/platform/nm-fake-platform.c4
-rw-r--r--src/core/platform/nm-linux-platform.c16
-rw-r--r--src/core/platform/nm-platform.c4
-rw-r--r--src/core/platform/nm-platform.h12
-rw-r--r--src/core/platform/tests/test-link.c14
-rw-r--r--src/core/tests/test-core.c2
7 files changed, 31 insertions, 31 deletions
diff --git a/src/core/devices/nm-device-vlan.c b/src/core/devices/nm-device-vlan.c
index 85edff5b0a..330b4212df 100644
--- a/src/core/devices/nm-device-vlan.c
+++ b/src/core/devices/nm-device-vlan.c
@@ -436,7 +436,7 @@ update_connection(NMDevice *device, NMConnection *connection)
const NMPlatformLink *plink;
const NMPObject * polnk;
guint vlan_id;
- guint vlan_flags;
+ _NMVlanFlags vlan_flags;
if (!s_vlan) {
s_vlan = (NMSettingVlan *) nm_setting_vlan_new();
@@ -463,9 +463,9 @@ update_connection(NMDevice *device, NMConnection *connection)
if (polnk)
vlan_flags = polnk->lnk_vlan.flags;
else
- vlan_flags = NM_VLAN_FLAG_REORDER_HEADERS;
- if (vlan_flags != nm_setting_vlan_get_flags(s_vlan))
- g_object_set(s_vlan, NM_SETTING_VLAN_FLAGS, (NMVlanFlags) vlan_flags, NULL);
+ vlan_flags = _NM_VLAN_FLAG_REORDER_HEADERS;
+ if (NM_VLAN_FLAGS_CAST(vlan_flags) != nm_setting_vlan_get_flags(s_vlan))
+ g_object_set(s_vlan, NM_SETTING_VLAN_FLAGS, NM_VLAN_FLAGS_CAST(vlan_flags), NULL);
if (polnk) {
_nm_setting_vlan_set_priorities(s_vlan,
@@ -507,7 +507,7 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
nm_platform_link_vlan_change(nm_device_get_platform(device),
nm_device_get_ifindex(device),
- NM_VLAN_FLAGS_ALL,
+ _NM_VLAN_FLAGS_ALL,
nm_setting_vlan_get_flags(s_vlan),
TRUE,
ingress_map,
diff --git a/src/core/platform/nm-fake-platform.c b/src/core/platform/nm-fake-platform.c
index 6baef64af9..236148cf5e 100644
--- a/src/core/platform/nm-fake-platform.c
+++ b/src/core/platform/nm-fake-platform.c
@@ -749,8 +749,8 @@ link_release(NMPlatform *platform, int master_idx, int slave_idx)
static gboolean
link_vlan_change(NMPlatform * platform,
int ifindex,
- NMVlanFlags flags_mask,
- NMVlanFlags flags_set,
+ _NMVlanFlags flags_mask,
+ _NMVlanFlags flags_set,
gboolean ingress_reset_all,
const NMVlanQosMapping *ingress_map,
gsize n_ingress_map,
diff --git a/src/core/platform/nm-linux-platform.c b/src/core/platform/nm-linux-platform.c
index e4cd459178..181e6a8e3b 100644
--- a/src/core/platform/nm-linux-platform.c
+++ b/src/core/platform/nm-linux-platform.c
@@ -4156,8 +4156,8 @@ _nl_msg_new_link_set_linkinfo(struct nl_msg *msg, NMLinkType link_type, gconstpo
{
struct ifla_vlan_flags flags = {
- .flags = props->flags & NM_VLAN_FLAGS_ALL,
- .mask = NM_VLAN_FLAGS_ALL,
+ .flags = props->flags & _NM_VLAN_FLAGS_ALL,
+ .mask = _NM_VLAN_FLAGS_ALL,
};
NLA_PUT(msg, IFLA_VLAN_FLAGS, sizeof(flags), &flags);
@@ -4433,10 +4433,10 @@ _nl_msg_new_link_set_linkinfo_vlan(struct nl_msg * msg,
guint i;
gboolean has_any_vlan_properties = FALSE;
- G_STATIC_ASSERT(NM_VLAN_FLAG_REORDER_HEADERS == (guint32) VLAN_FLAG_REORDER_HDR);
- G_STATIC_ASSERT(NM_VLAN_FLAG_GVRP == (guint32) VLAN_FLAG_GVRP);
- G_STATIC_ASSERT(NM_VLAN_FLAG_LOOSE_BINDING == (guint32) VLAN_FLAG_LOOSE_BINDING);
- G_STATIC_ASSERT(NM_VLAN_FLAG_MVRP == (guint32) VLAN_FLAG_MVRP);
+ G_STATIC_ASSERT(_NM_VLAN_FLAG_REORDER_HEADERS == (guint32) VLAN_FLAG_REORDER_HDR);
+ G_STATIC_ASSERT(_NM_VLAN_FLAG_GVRP == (guint32) VLAN_FLAG_GVRP);
+ G_STATIC_ASSERT(_NM_VLAN_FLAG_LOOSE_BINDING == (guint32) VLAN_FLAG_LOOSE_BINDING);
+ G_STATIC_ASSERT(_NM_VLAN_FLAG_MVRP == (guint32) VLAN_FLAG_MVRP);
#define VLAN_XGRESS_PRIO_VALID(from) (((from) & ~(guint32) 0x07) == 0)
@@ -8084,8 +8084,8 @@ _vlan_change_vlan_qos_mapping_create(gboolean is_ingress_map,
static gboolean
link_vlan_change(NMPlatform * platform,
int ifindex,
- NMVlanFlags flags_mask,
- NMVlanFlags flags_set,
+ _NMVlanFlags flags_mask,
+ _NMVlanFlags flags_set,
gboolean ingress_reset_all,
const NMVlanQosMapping *ingress_map,
gsize n_ingress_map,
diff --git a/src/core/platform/nm-platform.c b/src/core/platform/nm-platform.c
index 97759302f1..e27fab203a 100644
--- a/src/core/platform/nm-platform.c
+++ b/src/core/platform/nm-platform.c
@@ -2686,8 +2686,8 @@ nm_platform_sysctl_slave_get_option(NMPlatform *self, int ifindex, const char *o
gboolean
nm_platform_link_vlan_change(NMPlatform * self,
int ifindex,
- NMVlanFlags flags_mask,
- NMVlanFlags flags_set,
+ _NMVlanFlags flags_mask,
+ _NMVlanFlags flags_set,
gboolean ingress_reset_all,
const NMVlanQosMapping *ingress_map,
gsize n_ingress_map,
diff --git a/src/core/platform/nm-platform.h b/src/core/platform/nm-platform.h
index dc891d6bac..f4fd387850 100644
--- a/src/core/platform/nm-platform.h
+++ b/src/core/platform/nm-platform.h
@@ -939,8 +939,8 @@ typedef struct {
typedef struct {
/* rtnl_link_vlan_get_id(), IFLA_VLAN_ID */
- guint16 id;
- NMVlanFlags flags;
+ guint16 id;
+ _NMVlanFlags flags;
} NMPlatformLnkVlan;
typedef struct {
@@ -1156,8 +1156,8 @@ typedef struct {
gboolean (*link_vlan_change)(NMPlatform * self,
int ifindex,
- NMVlanFlags flags_mask,
- NMVlanFlags flags_set,
+ _NMVlanFlags flags_mask,
+ _NMVlanFlags flags_set,
gboolean ingress_reset_all,
const NMVlanQosMapping *ingress_map,
gsize n_ingress_map,
@@ -1937,8 +1937,8 @@ gboolean nm_platform_link_vlan_set_ingress_map(NMPlatform *self, int ifindex, in
gboolean nm_platform_link_vlan_set_egress_map(NMPlatform *self, int ifindex, int from, int to);
gboolean nm_platform_link_vlan_change(NMPlatform * self,
int ifindex,
- NMVlanFlags flags_mask,
- NMVlanFlags flags_set,
+ _NMVlanFlags flags_mask,
+ _NMVlanFlags flags_set,
gboolean ingress_reset_all,
const NMVlanQosMapping *ingress_map,
gsize n_ingress_map,
diff --git a/src/core/platform/tests/test-link.c b/src/core/platform/tests/test-link.c
index d1ca405f97..724af9f706 100644
--- a/src/core/platform/tests/test-link.c
+++ b/src/core/platform/tests/test-link.c
@@ -2049,7 +2049,7 @@ _assert_xgress_qos_mappings_impl(int ifindex, gboolean is_ingress_map, int n_ent
_assert_xgress_qos_mappings(ifindex, FALSE, n_entries, __VA_ARGS__)
static void
-_assert_vlan_flags(int ifindex, NMVlanFlags flags)
+_assert_vlan_flags(int ifindex, _NMVlanFlags flags)
{
const NMPlatformLnkVlan *plnk;
@@ -2362,8 +2362,8 @@ test_vlan_set_xgress(void)
g_assert(nm_platform_link_vlan_change(NM_PLATFORM_GET,
ifindex,
- NM_VLAN_FLAG_REORDER_HEADERS | NM_VLAN_FLAG_GVRP,
- NM_VLAN_FLAG_REORDER_HEADERS,
+ _NM_VLAN_FLAG_REORDER_HEADERS | _NM_VLAN_FLAG_GVRP,
+ _NM_VLAN_FLAG_REORDER_HEADERS,
TRUE,
ingress_map,
G_N_ELEMENTS(ingress_map),
@@ -2372,7 +2372,7 @@ test_vlan_set_xgress(void)
G_N_ELEMENTS(egress_map)));
_assert_ingress_qos_mappings(ifindex, 2, 4, 1, 6, 12);
_assert_egress_qos_mappings(ifindex, 2, 1, 5, 3232, 7);
- _assert_vlan_flags(ifindex, NM_VLAN_FLAG_REORDER_HEADERS);
+ _assert_vlan_flags(ifindex, _NM_VLAN_FLAG_REORDER_HEADERS);
}
{
@@ -2393,8 +2393,8 @@ test_vlan_set_xgress(void)
g_assert(nm_platform_link_vlan_change(NM_PLATFORM_GET,
ifindex,
- NM_VLAN_FLAG_GVRP,
- NM_VLAN_FLAG_GVRP,
+ _NM_VLAN_FLAG_GVRP,
+ _NM_VLAN_FLAG_GVRP,
FALSE,
ingress_map,
G_N_ELEMENTS(ingress_map),
@@ -2403,7 +2403,7 @@ test_vlan_set_xgress(void)
G_N_ELEMENTS(egress_map)));
_assert_ingress_qos_mappings(ifindex, 2, 4, 1, 6, 12);
_assert_egress_qos_mappings(ifindex, 2, 1, 7, 64, 4);
- _assert_vlan_flags(ifindex, NM_VLAN_FLAG_REORDER_HEADERS | NM_VLAN_FLAG_GVRP);
+ _assert_vlan_flags(ifindex, _NM_VLAN_FLAG_REORDER_HEADERS | _NM_VLAN_FLAG_GVRP);
}
nmtstp_link_delete(NULL, -1, ifindex, DEVICE_NAME, TRUE);
diff --git a/src/core/tests/test-core.c b/src/core/tests/test-core.c
index fc4a217e81..f212886331 100644
--- a/src/core/tests/test-core.c
+++ b/src/core/tests/test-core.c
@@ -867,7 +867,7 @@ test_connection_no_match_vlan(void)
/* Check that the connections do not match if VLAN flags differ */
s_vlan_orig = nm_connection_get_setting_vlan(orig);
g_assert(s_vlan_orig);
- g_object_set(G_OBJECT(s_vlan_orig), NM_SETTING_VLAN_FLAGS, NM_VLAN_FLAG_REORDER_HEADERS, NULL);
+ g_object_set(G_OBJECT(s_vlan_orig), NM_SETTING_VLAN_FLAGS, _NM_VLAN_FLAG_REORDER_HEADERS, NULL);
s_vlan_copy = nm_connection_get_setting_vlan(copy);
g_assert(s_vlan_copy);