core: use _NMVlanFlags instead of NMVlanFlags

This commit is contained in:
Thomas Haller 2021-03-03 20:57:01 +01:00
parent 82e2a694d7
commit e691657da0
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
7 changed files with 31 additions and 31 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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);

View file

@ -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);