platform: support VTI tunnels
This commit is contained in:
@@ -2117,6 +2117,47 @@ nmtstp_link_vlan_add(NMPlatform *platform,
|
||||
return pllink;
|
||||
}
|
||||
|
||||
const NMPlatformLink *
|
||||
nmtstp_link_vti_add(NMPlatform *platform,
|
||||
gboolean external_command,
|
||||
const char *name,
|
||||
const NMPlatformLnkVti *lnk)
|
||||
{
|
||||
const NMPlatformLink *pllink = NULL;
|
||||
gboolean success;
|
||||
char b1[INET_ADDRSTRLEN];
|
||||
char b2[INET_ADDRSTRLEN];
|
||||
|
||||
g_assert(nm_utils_ifname_valid_kernel(name, NULL));
|
||||
external_command = nmtstp_run_command_check_external(external_command);
|
||||
_init_platform(&platform, external_command);
|
||||
|
||||
if (external_command) {
|
||||
gs_free char *dev = NULL;
|
||||
|
||||
if (lnk->parent_ifindex)
|
||||
dev =
|
||||
g_strdup_printf("dev %s", nm_platform_link_get_name(platform, lnk->parent_ifindex));
|
||||
|
||||
success = !nmtstp_run_command(
|
||||
"ip link add %s type vti %s local %s remote %s ikey %u okey %u fwmark 0x%x",
|
||||
name,
|
||||
dev ?: "",
|
||||
nm_inet4_ntop(lnk->local, b1),
|
||||
nm_inet4_ntop(lnk->remote, b2),
|
||||
lnk->ikey,
|
||||
lnk->okey,
|
||||
lnk->fwmark);
|
||||
if (success)
|
||||
pllink = nmtstp_assert_wait_for_link(platform, name, NM_LINK_TYPE_VTI, 100);
|
||||
} else
|
||||
success = NMTST_NM_ERR_SUCCESS(nm_platform_link_vti_add(platform, name, lnk, &pllink));
|
||||
|
||||
_assert_pllink(platform, success, pllink, name, NM_LINK_TYPE_VTI);
|
||||
|
||||
return pllink;
|
||||
}
|
||||
|
||||
const NMPlatformLink *
|
||||
nmtstp_link_vrf_add(NMPlatform *platform,
|
||||
int external_command,
|
||||
|
@@ -504,6 +504,10 @@ const NMPlatformLink *nmtstp_link_vlan_add(NMPlatform *platform,
|
||||
const char *name,
|
||||
int parent,
|
||||
const NMPlatformLnkVlan *lnk);
|
||||
const NMPlatformLink *nmtstp_link_vti_add(NMPlatform *platform,
|
||||
gboolean external_command,
|
||||
const char *name,
|
||||
const NMPlatformLnkVti *lnk);
|
||||
const NMPlatformLink *nmtstp_link_vrf_add(NMPlatform *platform,
|
||||
int external_command,
|
||||
const char *name,
|
||||
|
@@ -1287,6 +1287,7 @@ test_software_detect(gconstpointer user_data)
|
||||
NMPlatformLnkBridge lnk_bridge = {};
|
||||
NMPlatformLnkTun lnk_tun;
|
||||
NMPlatformLnkGre lnk_gre = {};
|
||||
NMPlatformLnkVti lnk_vti = {};
|
||||
nm_auto_close int tun_fd = -1;
|
||||
|
||||
nmtstp_run_command_check("ip link add %s type dummy", PARENT_NAME);
|
||||
@@ -1615,6 +1616,32 @@ test_software_detect(gconstpointer user_data)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VTI:
|
||||
{
|
||||
gboolean gracefully_skip = FALSE;
|
||||
|
||||
if (!nm_platform_link_get_by_ifname(NM_PLATFORM_GET, "ip_vti0")) {
|
||||
/* Seems that the ip_vti module is not loaded... try to load it. */
|
||||
gracefully_skip = nmp_utils_modprobe(NULL, TRUE, "ip_vti", NULL) != 0;
|
||||
}
|
||||
|
||||
lnk_vti.local = nmtst_inet4_from_string("192.168.212.204");
|
||||
lnk_vti.remote = nmtst_inet4_from_string("172.168.11.25");
|
||||
lnk_vti.parent_ifindex = ifindex_parent;
|
||||
lnk_vti.fwmark = 0x42;
|
||||
lnk_vti.ikey = 12;
|
||||
lnk_vti.okey = 13;
|
||||
|
||||
if (!nmtstp_link_vti_add(NULL, ext, DEVICE_NAME, &lnk_vti)) {
|
||||
if (gracefully_skip) {
|
||||
g_test_skip(
|
||||
"Cannot create vti tunnel because of missing vti module (modprobe ip_vti)");
|
||||
goto out_delete_parent;
|
||||
}
|
||||
g_error("Failed adding VTI tunnel");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VXLAN:
|
||||
{
|
||||
NMPlatformLnkVxlan lnk_vxlan = {};
|
||||
@@ -1957,6 +1984,14 @@ test_software_detect(gconstpointer user_data)
|
||||
g_assert_cmpint(plnk->table, ==, 9876);
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VTI:
|
||||
{
|
||||
const NMPlatformLnkVti *plnk = &lnk->lnk_vti;
|
||||
|
||||
g_assert(plnk == nm_platform_link_get_lnk_vti(NM_PLATFORM_GET, ifindex, NULL));
|
||||
g_assert(nm_platform_lnk_vti_cmp(plnk, &lnk_vti) == 0);
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VXLAN:
|
||||
{
|
||||
const NMPlatformLnkVxlan *plnk = &lnk->lnk_vxlan;
|
||||
@@ -3861,6 +3896,7 @@ _nmtstp_setup_tests(void)
|
||||
test_software_detect_add("/link/software/detect/tun", NM_LINK_TYPE_TUN, 0);
|
||||
test_software_detect_add("/link/software/detect/vlan/0", NM_LINK_TYPE_VLAN, 0);
|
||||
test_software_detect_add("/link/software/detect/vlan/1", NM_LINK_TYPE_VLAN, 1);
|
||||
test_software_detect_add("/link/software/detect/vti", NM_LINK_TYPE_VTI, 0);
|
||||
test_software_detect_add("/link/software/detect/vrf", NM_LINK_TYPE_VRF, 0);
|
||||
test_software_detect_add("/link/software/detect/vxlan/0", NM_LINK_TYPE_VXLAN, 0);
|
||||
test_software_detect_add("/link/software/detect/vxlan/1", NM_LINK_TYPE_VXLAN, 1);
|
||||
|
@@ -139,6 +139,7 @@ typedef enum {
|
||||
NM_LINK_TYPE_VETH,
|
||||
NM_LINK_TYPE_VLAN,
|
||||
NM_LINK_TYPE_VRF,
|
||||
NM_LINK_TYPE_VTI,
|
||||
NM_LINK_TYPE_VXLAN,
|
||||
NM_LINK_TYPE_WIREGUARD,
|
||||
#define _NM_LINK_TYPE_SW_LAST NM_LINK_TYPE_WIREGUARD
|
||||
|
@@ -808,6 +808,7 @@ static const LinkDesc link_descs[] = {
|
||||
[NM_LINK_TYPE_VETH] = {"veth", "veth", NULL},
|
||||
[NM_LINK_TYPE_VLAN] = {"vlan", "vlan", "vlan"},
|
||||
[NM_LINK_TYPE_VRF] = {"vrf", "vrf", "vrf"},
|
||||
[NM_LINK_TYPE_VTI] = {"vti", "vti", NULL},
|
||||
[NM_LINK_TYPE_VXLAN] = {"vxlan", "vxlan", "vxlan"},
|
||||
[NM_LINK_TYPE_WIREGUARD] = {"wireguard", "wireguard", "wireguard"},
|
||||
|
||||
@@ -850,6 +851,7 @@ _link_type_from_rtnl_type(const char *name)
|
||||
NM_LINK_TYPE_VETH, /* "veth" */
|
||||
NM_LINK_TYPE_VLAN, /* "vlan" */
|
||||
NM_LINK_TYPE_VRF, /* "vrf" */
|
||||
NM_LINK_TYPE_VTI, /* "vti" */
|
||||
NM_LINK_TYPE_VXLAN, /* "vxlan" */
|
||||
NM_LINK_TYPE_WIMAX, /* "wimax" */
|
||||
NM_LINK_TYPE_WIREGUARD, /* "wireguard" */
|
||||
@@ -2404,6 +2406,40 @@ _parse_lnk_vxlan(const char *kind, struct nlattr *info_data)
|
||||
return obj;
|
||||
}
|
||||
|
||||
static NMPObject *
|
||||
_parse_lnk_vti(const char *kind, struct nlattr *info_data)
|
||||
{
|
||||
static const struct nla_policy policy[] = {
|
||||
[IFLA_VTI_LINK] = {.type = NLA_U32},
|
||||
[IFLA_VTI_LOCAL] = {.type = NLA_U32},
|
||||
[IFLA_VTI_REMOTE] = {.type = NLA_U32},
|
||||
[IFLA_VTI_IKEY] = {.type = NLA_U32},
|
||||
[IFLA_VTI_OKEY] = {.type = NLA_U32},
|
||||
[IFLA_VTI_FWMARK] = {.type = NLA_U32},
|
||||
};
|
||||
struct nlattr *tb[G_N_ELEMENTS(policy)];
|
||||
NMPObject *obj;
|
||||
NMPlatformLnkVti *props;
|
||||
|
||||
if (!info_data || !nm_streq0(kind, "vti"))
|
||||
return NULL;
|
||||
|
||||
if (nla_parse_nested_arr(tb, info_data, policy) < 0)
|
||||
return NULL;
|
||||
|
||||
obj = nmp_object_new(NMP_OBJECT_TYPE_LNK_VTI, NULL);
|
||||
props = &obj->lnk_vti;
|
||||
|
||||
props->parent_ifindex = tb[IFLA_VTI_LINK] ? nla_get_u32(tb[IFLA_VTI_LINK]) : 0;
|
||||
props->local = tb[IFLA_VTI_LOCAL] ? nla_get_u32(tb[IFLA_VTI_LOCAL]) : 0;
|
||||
props->remote = tb[IFLA_VTI_REMOTE] ? nla_get_u32(tb[IFLA_VTI_REMOTE]) : 0;
|
||||
props->ikey = tb[IFLA_VTI_IKEY] ? ntohl(nla_get_u32(tb[IFLA_VTI_IKEY])) : 0;
|
||||
props->okey = tb[IFLA_VTI_OKEY] ? ntohl(nla_get_u32(tb[IFLA_VTI_OKEY])) : 0;
|
||||
props->fwmark = tb[IFLA_VTI_FWMARK] ? nla_get_u32(tb[IFLA_VTI_FWMARK]) : 0;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
static NMPObject *
|
||||
_parse_lnk_vrf(const char *kind, struct nlattr *info_data)
|
||||
{
|
||||
@@ -3394,6 +3430,9 @@ _new_from_nl_link(NMPlatform *platform,
|
||||
case NM_LINK_TYPE_VRF:
|
||||
lnk_data = _parse_lnk_vrf(nl_info_kind, nl_info_data);
|
||||
break;
|
||||
case NM_LINK_TYPE_VTI:
|
||||
lnk_data = _parse_lnk_vti(nl_info_kind, nl_info_data);
|
||||
break;
|
||||
case NM_LINK_TYPE_VXLAN:
|
||||
lnk_data = _parse_lnk_vxlan(nl_info_kind, nl_info_data);
|
||||
break;
|
||||
@@ -4920,6 +4959,24 @@ _nl_msg_new_link_set_linkinfo(struct nl_msg *msg, NMLinkType link_type, gconstpo
|
||||
NLA_PUT_U16(msg, IFLA_MACVLAN_FLAGS, props->no_promisc ? MACVLAN_FLAG_NOPROMISC : 0);
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VTI:
|
||||
{
|
||||
const NMPlatformLnkVti *props = extra_data;
|
||||
|
||||
nm_assert(props);
|
||||
|
||||
if (!(data = nla_nest_start(msg, IFLA_INFO_DATA)))
|
||||
goto nla_put_failure;
|
||||
|
||||
if (props->parent_ifindex > 0)
|
||||
NLA_PUT_U32(msg, IFLA_VTI_LINK, props->parent_ifindex);
|
||||
NLA_PUT_U32(msg, IFLA_VTI_LOCAL, props->local);
|
||||
NLA_PUT_U32(msg, IFLA_VTI_REMOTE, props->remote);
|
||||
NLA_PUT_U32(msg, IFLA_VTI_IKEY, htonl(props->ikey));
|
||||
NLA_PUT_U32(msg, IFLA_VTI_OKEY, htonl(props->okey));
|
||||
NLA_PUT_U32(msg, IFLA_VTI_FWMARK, props->fwmark);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
nm_assert(!extra_data);
|
||||
break;
|
||||
|
@@ -1370,6 +1370,12 @@ nm_platform_link_add(NMPlatform *self,
|
||||
buf_p,
|
||||
buf_len);
|
||||
break;
|
||||
case NM_LINK_TYPE_VTI:
|
||||
nm_strbuf_append_str(&buf_p, &buf_len, ", ");
|
||||
nm_platform_lnk_vti_to_string((const NMPlatformLnkVti *) extra_data,
|
||||
buf_p,
|
||||
buf_len);
|
||||
break;
|
||||
case NM_LINK_TYPE_BOND:
|
||||
nm_strbuf_append_str(&buf_p, &buf_len, ", ");
|
||||
nm_platform_lnk_bond_to_string((const NMPlatformLnkBond *) extra_data,
|
||||
@@ -2418,6 +2424,12 @@ nm_platform_link_get_lnk_vrf(NMPlatform *self, int ifindex, const NMPlatformLink
|
||||
return _link_get_lnk(self, ifindex, NM_LINK_TYPE_VRF, out_link);
|
||||
}
|
||||
|
||||
const NMPlatformLnkVti *
|
||||
nm_platform_link_get_lnk_vti(NMPlatform *self, int ifindex, const NMPlatformLink **out_link)
|
||||
{
|
||||
return _link_get_lnk(self, ifindex, NM_LINK_TYPE_VTI, out_link);
|
||||
}
|
||||
|
||||
const NMPlatformLnkVxlan *
|
||||
nm_platform_link_get_lnk_vxlan(NMPlatform *self, int ifindex, const NMPlatformLink **out_link)
|
||||
{
|
||||
@@ -6496,6 +6508,45 @@ nm_platform_lnk_vlan_to_string(const NMPlatformLnkVlan *lnk, char *buf, gsize le
|
||||
return buf;
|
||||
}
|
||||
|
||||
const char *
|
||||
nm_platform_lnk_vti_to_string(const NMPlatformLnkVti *lnk, char *buf, gsize len)
|
||||
{
|
||||
char str_local[30 + NM_INET_ADDRSTRLEN];
|
||||
char str_local1[NM_INET_ADDRSTRLEN];
|
||||
char str_remote[30 + NM_INET_ADDRSTRLEN];
|
||||
char str_remote1[NM_INET_ADDRSTRLEN];
|
||||
char str_ikey[30];
|
||||
char str_okey[30];
|
||||
char str_fwmark[30];
|
||||
char str_parent_ifindex[30];
|
||||
|
||||
if (!nm_utils_to_string_buffer_init_null(lnk, &buf, &len))
|
||||
return buf;
|
||||
|
||||
g_snprintf(
|
||||
buf,
|
||||
len,
|
||||
"vti"
|
||||
"%s" /* remote */
|
||||
"%s" /* local */
|
||||
"%s" /* parent_ifindex */
|
||||
"%s" /* ikey */
|
||||
"%s" /* okey */
|
||||
"%s" /* fwmark */
|
||||
"",
|
||||
lnk->remote
|
||||
? nm_sprintf_buf(str_remote, " remote %s", nm_inet4_ntop(lnk->remote, str_remote1))
|
||||
: "",
|
||||
lnk->local ? nm_sprintf_buf(str_local, " local %s", nm_inet4_ntop(lnk->local, str_local1))
|
||||
: "",
|
||||
lnk->parent_ifindex ? nm_sprintf_buf(str_parent_ifindex, " dev %d", lnk->parent_ifindex)
|
||||
: "",
|
||||
lnk->ikey ? nm_sprintf_buf(str_ikey, " ikey %u", lnk->ikey) : "",
|
||||
lnk->okey ? nm_sprintf_buf(str_okey, " okey %u", lnk->okey) : "",
|
||||
lnk->fwmark ? nm_sprintf_buf(str_fwmark, " fwmark 0x%x", lnk->fwmark) : "");
|
||||
return buf;
|
||||
}
|
||||
|
||||
const char *
|
||||
nm_platform_lnk_vrf_to_string(const NMPlatformLnkVrf *lnk, char *buf, gsize len)
|
||||
{
|
||||
@@ -8185,6 +8236,31 @@ nm_platform_lnk_vrf_cmp(const NMPlatformLnkVrf *a, const NMPlatformLnkVrf *b)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
nm_platform_lnk_vti_hash_update(const NMPlatformLnkVti *obj, NMHashState *h)
|
||||
{
|
||||
nm_hash_update_vals(h,
|
||||
obj->local,
|
||||
obj->remote,
|
||||
obj->parent_ifindex,
|
||||
obj->ikey,
|
||||
obj->okey,
|
||||
obj->fwmark);
|
||||
}
|
||||
|
||||
int
|
||||
nm_platform_lnk_vti_cmp(const NMPlatformLnkVti *a, const NMPlatformLnkVti *b)
|
||||
{
|
||||
NM_CMP_SELF(a, b);
|
||||
NM_CMP_FIELD(a, b, parent_ifindex);
|
||||
NM_CMP_FIELD(a, b, local);
|
||||
NM_CMP_FIELD(a, b, remote);
|
||||
NM_CMP_FIELD(a, b, ikey);
|
||||
NM_CMP_FIELD(a, b, okey);
|
||||
NM_CMP_FIELD(a, b, fwmark);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
nm_platform_lnk_vxlan_hash_update(const NMPlatformLnkVxlan *obj, NMHashState *h)
|
||||
{
|
||||
|
@@ -814,6 +814,16 @@ typedef struct {
|
||||
} _nm_alignas(NMPlatformObject) NMPlatformLnkIpIp;
|
||||
|
||||
typedef struct {
|
||||
int parent_ifindex;
|
||||
in_addr_t local;
|
||||
in_addr_t remote;
|
||||
guint32 ikey;
|
||||
guint32 okey;
|
||||
guint32 fwmark;
|
||||
} _nm_alignas(NMPlatformObject) NMPlatformLnkVti;
|
||||
|
||||
typedef struct {
|
||||
int parent_ifindex;
|
||||
guint64 sci; /* host byte order */
|
||||
guint64 cipher_suite;
|
||||
guint32 window;
|
||||
@@ -1677,6 +1687,15 @@ nm_platform_link_vrf_add(NMPlatform *self,
|
||||
return nm_platform_link_add(self, NM_LINK_TYPE_VRF, name, 0, NULL, 0, 0, props, out_link);
|
||||
}
|
||||
|
||||
static inline int
|
||||
nm_platform_link_vti_add(NMPlatform *self,
|
||||
const char *name,
|
||||
const NMPlatformLnkVti *props,
|
||||
const NMPlatformLink **out_link)
|
||||
{
|
||||
return nm_platform_link_add(self, NM_LINK_TYPE_VTI, name, 0, NULL, 0, 0, props, out_link);
|
||||
}
|
||||
|
||||
static inline int
|
||||
nm_platform_link_vxlan_add(NMPlatform *self,
|
||||
const char *name,
|
||||
@@ -1966,6 +1985,8 @@ const NMPlatformLnkVlan *
|
||||
nm_platform_link_get_lnk_vlan(NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
|
||||
const NMPlatformLnkVrf *
|
||||
nm_platform_link_get_lnk_vrf(NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
|
||||
const NMPlatformLnkVti *
|
||||
nm_platform_link_get_lnk_vti(NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
|
||||
const NMPlatformLnkVxlan *
|
||||
nm_platform_link_get_lnk_vxlan(NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
|
||||
const NMPlatformLnkWireGuard *
|
||||
@@ -2254,6 +2275,7 @@ const char *nm_platform_lnk_sit_to_string(const NMPlatformLnkSit *lnk, char *buf
|
||||
const char *nm_platform_lnk_tun_to_string(const NMPlatformLnkTun *lnk, char *buf, gsize len);
|
||||
const char *nm_platform_lnk_vlan_to_string(const NMPlatformLnkVlan *lnk, char *buf, gsize len);
|
||||
const char *nm_platform_lnk_vrf_to_string(const NMPlatformLnkVrf *lnk, char *buf, gsize len);
|
||||
const char *nm_platform_lnk_vti_to_string(const NMPlatformLnkVti *lnk, char *buf, gsize len);
|
||||
const char *nm_platform_lnk_vxlan_to_string(const NMPlatformLnkVxlan *lnk, char *buf, gsize len);
|
||||
const char *
|
||||
nm_platform_lnk_wireguard_to_string(const NMPlatformLnkWireGuard *lnk, char *buf, gsize len);
|
||||
@@ -2304,6 +2326,7 @@ int nm_platform_lnk_sit_cmp(const NMPlatformLnkSit *a, const NMPlatformLnkSit *b
|
||||
int nm_platform_lnk_tun_cmp(const NMPlatformLnkTun *a, const NMPlatformLnkTun *b);
|
||||
int nm_platform_lnk_vlan_cmp(const NMPlatformLnkVlan *a, const NMPlatformLnkVlan *b);
|
||||
int nm_platform_lnk_vrf_cmp(const NMPlatformLnkVrf *a, const NMPlatformLnkVrf *b);
|
||||
int nm_platform_lnk_vti_cmp(const NMPlatformLnkVti *a, const NMPlatformLnkVti *b);
|
||||
int nm_platform_lnk_vxlan_cmp(const NMPlatformLnkVxlan *a, const NMPlatformLnkVxlan *b);
|
||||
int nm_platform_lnk_wireguard_cmp(const NMPlatformLnkWireGuard *a, const NMPlatformLnkWireGuard *b);
|
||||
|
||||
@@ -2366,6 +2389,7 @@ void nm_platform_lnk_sit_hash_update(const NMPlatformLnkSit *obj, NMHashState *h
|
||||
void nm_platform_lnk_tun_hash_update(const NMPlatformLnkTun *obj, NMHashState *h);
|
||||
void nm_platform_lnk_vlan_hash_update(const NMPlatformLnkVlan *obj, NMHashState *h);
|
||||
void nm_platform_lnk_vrf_hash_update(const NMPlatformLnkVrf *obj, NMHashState *h);
|
||||
void nm_platform_lnk_vti_hash_update(const NMPlatformLnkVti *obj, NMHashState *h);
|
||||
void nm_platform_lnk_vxlan_hash_update(const NMPlatformLnkVxlan *obj, NMHashState *h);
|
||||
void nm_platform_lnk_wireguard_hash_update(const NMPlatformLnkWireGuard *obj, NMHashState *h);
|
||||
|
||||
|
@@ -161,6 +161,7 @@ typedef enum _nm_packed {
|
||||
NMP_OBJECT_TYPE_LNK_TUN,
|
||||
NMP_OBJECT_TYPE_LNK_VLAN,
|
||||
NMP_OBJECT_TYPE_LNK_VRF,
|
||||
NMP_OBJECT_TYPE_LNK_VTI,
|
||||
NMP_OBJECT_TYPE_LNK_VXLAN,
|
||||
NMP_OBJECT_TYPE_LNK_WIREGUARD,
|
||||
NMP_OBJECT_TYPE_LNK_BOND,
|
||||
|
@@ -3601,6 +3601,18 @@ const NMPClass _nmp_classes[NMP_OBJECT_TYPE_MAX] = {
|
||||
.cmd_plobj_hash_update = (CmdPlobjHashUpdateFunc) nm_platform_lnk_vrf_hash_update,
|
||||
.cmd_plobj_cmp = (CmdPlobjCmpFunc) nm_platform_lnk_vrf_cmp,
|
||||
},
|
||||
[NMP_OBJECT_TYPE_LNK_VTI - 1] =
|
||||
{
|
||||
.parent = DEDUP_MULTI_OBJ_CLASS_INIT(),
|
||||
.obj_type = NMP_OBJECT_TYPE_LNK_VTI,
|
||||
.sizeof_data = sizeof(NMPObjectLnkVti),
|
||||
.sizeof_public = sizeof(NMPlatformLnkVti),
|
||||
.obj_type_name = "vti",
|
||||
.lnk_link_type = NM_LINK_TYPE_VTI,
|
||||
.cmd_plobj_to_string = (CmdPlobjToStringFunc) nm_platform_lnk_vti_to_string,
|
||||
.cmd_plobj_hash_update = (CmdPlobjHashUpdateFunc) nm_platform_lnk_vti_hash_update,
|
||||
.cmd_plobj_cmp = (CmdPlobjCmpFunc) nm_platform_lnk_vti_cmp,
|
||||
},
|
||||
[NMP_OBJECT_TYPE_LNK_VXLAN - 1] =
|
||||
{
|
||||
.parent = DEDUP_MULTI_OBJ_CLASS_INIT(),
|
||||
|
@@ -296,6 +296,10 @@ typedef struct {
|
||||
NMPlatformLnkVrf _public;
|
||||
} NMPObjectLnkVrf;
|
||||
|
||||
typedef struct {
|
||||
NMPlatformLnkVti _public;
|
||||
} NMPObjectLnkVti;
|
||||
|
||||
typedef struct {
|
||||
NMPlatformLnkVxlan _public;
|
||||
} NMPObjectLnkVxlan;
|
||||
@@ -396,6 +400,9 @@ struct _NMPObject {
|
||||
NMPlatformLnkVrf lnk_vrf;
|
||||
NMPObjectLnkVrf _lnk_vrf;
|
||||
|
||||
NMPlatformLnkVti lnk_vti;
|
||||
NMPObjectLnkVti _lnk_vti;
|
||||
|
||||
NMPlatformLnkVxlan lnk_vxlan;
|
||||
NMPObjectLnkVxlan _lnk_vxlan;
|
||||
|
||||
@@ -528,6 +535,7 @@ _NMP_OBJECT_TYPE_IS_OBJ_WITH_IFINDEX(NMPObjectType obj_type)
|
||||
case NMP_OBJECT_TYPE_LNK_TUN:
|
||||
case NMP_OBJECT_TYPE_LNK_VLAN:
|
||||
case NMP_OBJECT_TYPE_LNK_VRF:
|
||||
case NMP_OBJECT_TYPE_LNK_VTI:
|
||||
case NMP_OBJECT_TYPE_LNK_VXLAN:
|
||||
case NMP_OBJECT_TYPE_LNK_WIREGUARD:
|
||||
|
||||
|
@@ -29,6 +29,7 @@ G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPObjectLnkSit));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPObjectLnkTun));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPObjectLnkVlan));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPObjectLnkVrf));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPObjectLnkVti));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPObjectLnkVxlan));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPObjectLnkWireGuard));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPObjectQdisc));
|
||||
@@ -57,6 +58,7 @@ G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPlatformLnkSit));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPlatformLnkTun));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPlatformLnkVlan));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPlatformLnkVrf));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPlatformLnkVti));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPlatformLnkVxlan));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPlatformLnkWireGuard));
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPlatformObject) == _nm_alignof(NMPlatformObjWithIfindex));
|
||||
|
Reference in New Issue
Block a user