mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 21:10:08 +01:00
platform: support VTI6 tunnels
This commit is contained in:
parent
1cf8df2f35
commit
b669a3ae46
11 changed files with 269 additions and 3 deletions
|
|
@ -2158,6 +2158,47 @@ nmtstp_link_vti_add(NMPlatform *platform,
|
|||
return pllink;
|
||||
}
|
||||
|
||||
const NMPlatformLink *
|
||||
nmtstp_link_vti6_add(NMPlatform *platform,
|
||||
gboolean external_command,
|
||||
const char *name,
|
||||
const NMPlatformLnkVti6 *lnk)
|
||||
{
|
||||
const NMPlatformLink *pllink = NULL;
|
||||
gboolean success;
|
||||
char b1[INET6_ADDRSTRLEN];
|
||||
char b2[INET6_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 vti6 %s local %s remote %s ikey %u okey %u fwmark 0x%x",
|
||||
name,
|
||||
dev ?: "",
|
||||
nm_inet6_ntop(&lnk->local, b1),
|
||||
nm_inet6_ntop(&lnk->remote, b2),
|
||||
lnk->ikey,
|
||||
lnk->okey,
|
||||
lnk->fwmark);
|
||||
if (success)
|
||||
pllink = nmtstp_assert_wait_for_link(platform, name, NM_LINK_TYPE_VTI6, 100);
|
||||
} else
|
||||
success = NMTST_NM_ERR_SUCCESS(nm_platform_link_vti6_add(platform, name, lnk, &pllink));
|
||||
|
||||
_assert_pllink(platform, success, pllink, name, NM_LINK_TYPE_VTI6);
|
||||
|
||||
return pllink;
|
||||
}
|
||||
|
||||
const NMPlatformLink *
|
||||
nmtstp_link_vrf_add(NMPlatform *platform,
|
||||
int external_command,
|
||||
|
|
|
|||
|
|
@ -508,6 +508,10 @@ const NMPlatformLink *nmtstp_link_vti_add(NMPlatform *platform,
|
|||
gboolean external_command,
|
||||
const char *name,
|
||||
const NMPlatformLnkVti *lnk);
|
||||
const NMPlatformLink *nmtstp_link_vti6_add(NMPlatform *platform,
|
||||
gboolean external_command,
|
||||
const char *name,
|
||||
const NMPlatformLnkVti6 *lnk);
|
||||
const NMPlatformLink *nmtstp_link_vrf_add(NMPlatform *platform,
|
||||
int external_command,
|
||||
const char *name,
|
||||
|
|
|
|||
|
|
@ -1286,9 +1286,10 @@ test_software_detect(gconstpointer user_data)
|
|||
const gboolean ext = test_data->external_command;
|
||||
NMPlatformLnkBridge lnk_bridge = {};
|
||||
NMPlatformLnkTun lnk_tun;
|
||||
NMPlatformLnkGre lnk_gre = {};
|
||||
NMPlatformLnkVti lnk_vti = {};
|
||||
nm_auto_close int tun_fd = -1;
|
||||
NMPlatformLnkGre lnk_gre = {};
|
||||
NMPlatformLnkVti lnk_vti = {};
|
||||
NMPlatformLnkVti6 lnk_vti6 = {};
|
||||
nm_auto_close int tun_fd = -1;
|
||||
|
||||
nmtstp_run_command_check("ip link add %s type dummy", PARENT_NAME);
|
||||
ifindex_parent =
|
||||
|
|
@ -1642,6 +1643,32 @@ test_software_detect(gconstpointer user_data)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VTI6:
|
||||
{
|
||||
gboolean gracefully_skip = FALSE;
|
||||
|
||||
if (!nm_platform_link_get_by_ifname(NM_PLATFORM_GET, "ip6_vti0")) {
|
||||
/* Seems that the ip6_vti module is not loaded... try to load it. */
|
||||
gracefully_skip = nmp_utils_modprobe(NULL, TRUE, "ip6_vti", NULL) != 0;
|
||||
}
|
||||
|
||||
lnk_vti6.local = nmtst_inet6_from_string("fd01::1");
|
||||
lnk_vti6.remote = nmtst_inet6_from_string("fd02::2");
|
||||
lnk_vti6.parent_ifindex = ifindex_parent;
|
||||
lnk_vti6.fwmark = 0x43;
|
||||
lnk_vti6.ikey = 13;
|
||||
lnk_vti6.okey = 14;
|
||||
|
||||
if (!nmtstp_link_vti6_add(NULL, ext, DEVICE_NAME, &lnk_vti6)) {
|
||||
if (gracefully_skip) {
|
||||
g_test_skip(
|
||||
"Cannot create vti6 tunnel because of missing vti module (modprobe ip_vti)");
|
||||
goto out_delete_parent;
|
||||
}
|
||||
g_error("Failed adding VTI6 tunnel");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VXLAN:
|
||||
{
|
||||
NMPlatformLnkVxlan lnk_vxlan = {};
|
||||
|
|
@ -1992,6 +2019,14 @@ test_software_detect(gconstpointer user_data)
|
|||
g_assert(nm_platform_lnk_vti_cmp(plnk, &lnk_vti) == 0);
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VTI6:
|
||||
{
|
||||
const NMPlatformLnkVti6 *plnk = &lnk->lnk_vti6;
|
||||
|
||||
g_assert(plnk == nm_platform_link_get_lnk_vti6(NM_PLATFORM_GET, ifindex, NULL));
|
||||
g_assert(nm_platform_lnk_vti6_cmp(plnk, &lnk_vti6) == 0);
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VXLAN:
|
||||
{
|
||||
const NMPlatformLnkVxlan *plnk = &lnk->lnk_vxlan;
|
||||
|
|
@ -3897,6 +3932,7 @@ _nmtstp_setup_tests(void)
|
|||
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/vti6", NM_LINK_TYPE_VTI6, 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);
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ typedef enum {
|
|||
NM_LINK_TYPE_VLAN,
|
||||
NM_LINK_TYPE_VRF,
|
||||
NM_LINK_TYPE_VTI,
|
||||
NM_LINK_TYPE_VTI6,
|
||||
NM_LINK_TYPE_VXLAN,
|
||||
NM_LINK_TYPE_WIREGUARD,
|
||||
#define _NM_LINK_TYPE_SW_LAST NM_LINK_TYPE_WIREGUARD
|
||||
|
|
|
|||
|
|
@ -809,6 +809,7 @@ static const LinkDesc link_descs[] = {
|
|||
[NM_LINK_TYPE_VLAN] = {"vlan", "vlan", "vlan"},
|
||||
[NM_LINK_TYPE_VRF] = {"vrf", "vrf", "vrf"},
|
||||
[NM_LINK_TYPE_VTI] = {"vti", "vti", NULL},
|
||||
[NM_LINK_TYPE_VTI6] = {"vti6", "vti6", NULL},
|
||||
[NM_LINK_TYPE_VXLAN] = {"vxlan", "vxlan", "vxlan"},
|
||||
[NM_LINK_TYPE_WIREGUARD] = {"wireguard", "wireguard", "wireguard"},
|
||||
|
||||
|
|
@ -852,6 +853,7 @@ _link_type_from_rtnl_type(const char *name)
|
|||
NM_LINK_TYPE_VLAN, /* "vlan" */
|
||||
NM_LINK_TYPE_VRF, /* "vrf" */
|
||||
NM_LINK_TYPE_VTI, /* "vti" */
|
||||
NM_LINK_TYPE_VTI6, /* "vti6" */
|
||||
NM_LINK_TYPE_VXLAN, /* "vxlan" */
|
||||
NM_LINK_TYPE_WIMAX, /* "wimax" */
|
||||
NM_LINK_TYPE_WIREGUARD, /* "wireguard" */
|
||||
|
|
@ -2440,6 +2442,42 @@ _parse_lnk_vti(const char *kind, struct nlattr *info_data)
|
|||
return obj;
|
||||
}
|
||||
|
||||
static NMPObject *
|
||||
_parse_lnk_vti6(const char *kind, struct nlattr *info_data)
|
||||
{
|
||||
static const struct nla_policy policy[] = {
|
||||
[IFLA_VTI_LINK] = {.type = NLA_U32},
|
||||
[IFLA_VTI_LOCAL] = {.minlen = sizeof(struct in6_addr)},
|
||||
[IFLA_VTI_REMOTE] = {.minlen = sizeof(struct in6_addr)},
|
||||
[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;
|
||||
NMPlatformLnkVti6 *props;
|
||||
|
||||
if (!info_data || !nm_streq0(kind, "vti6"))
|
||||
return NULL;
|
||||
|
||||
if (nla_parse_nested_arr(tb, info_data, policy) < 0)
|
||||
return NULL;
|
||||
|
||||
obj = nmp_object_new(NMP_OBJECT_TYPE_LNK_VTI6, NULL);
|
||||
props = &obj->lnk_vti6;
|
||||
|
||||
props->parent_ifindex = tb[IFLA_VTI_LINK] ? nla_get_u32(tb[IFLA_VTI_LINK]) : 0;
|
||||
if (tb[IFLA_VTI_LOCAL])
|
||||
props->local = *nla_data_as(struct in6_addr, tb[IFLA_VTI_LOCAL]);
|
||||
if (tb[IFLA_VTI_REMOTE])
|
||||
props->remote = *nla_data_as(struct in6_addr, tb[IFLA_VTI_REMOTE]);
|
||||
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)
|
||||
{
|
||||
|
|
@ -3433,6 +3471,9 @@ _new_from_nl_link(NMPlatform *platform,
|
|||
case NM_LINK_TYPE_VTI:
|
||||
lnk_data = _parse_lnk_vti(nl_info_kind, nl_info_data);
|
||||
break;
|
||||
case NM_LINK_TYPE_VTI6:
|
||||
lnk_data = _parse_lnk_vti6(nl_info_kind, nl_info_data);
|
||||
break;
|
||||
case NM_LINK_TYPE_VXLAN:
|
||||
lnk_data = _parse_lnk_vxlan(nl_info_kind, nl_info_data);
|
||||
break;
|
||||
|
|
@ -4977,6 +5018,26 @@ _nl_msg_new_link_set_linkinfo(struct nl_msg *msg, NMLinkType link_type, gconstpo
|
|||
NLA_PUT_U32(msg, IFLA_VTI_FWMARK, props->fwmark);
|
||||
break;
|
||||
}
|
||||
case NM_LINK_TYPE_VTI6:
|
||||
{
|
||||
const NMPlatformLnkVti6 *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);
|
||||
if (!IN6_IS_ADDR_UNSPECIFIED(&props->local))
|
||||
NLA_PUT(msg, IFLA_VTI_LOCAL, sizeof(props->local), &props->local);
|
||||
if (!IN6_IS_ADDR_UNSPECIFIED(&props->remote))
|
||||
NLA_PUT(msg, IFLA_VTI_REMOTE, sizeof(props->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;
|
||||
|
|
|
|||
|
|
@ -1376,6 +1376,12 @@ nm_platform_link_add(NMPlatform *self,
|
|||
buf_p,
|
||||
buf_len);
|
||||
break;
|
||||
case NM_LINK_TYPE_VTI6:
|
||||
nm_strbuf_append_str(&buf_p, &buf_len, ", ");
|
||||
nm_platform_lnk_vti6_to_string((const NMPlatformLnkVti6 *) 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,
|
||||
|
|
@ -2430,6 +2436,12 @@ nm_platform_link_get_lnk_vti(NMPlatform *self, int ifindex, const NMPlatformLink
|
|||
return _link_get_lnk(self, ifindex, NM_LINK_TYPE_VTI, out_link);
|
||||
}
|
||||
|
||||
const NMPlatformLnkVti6 *
|
||||
nm_platform_link_get_lnk_vti6(NMPlatform *self, int ifindex, const NMPlatformLink **out_link)
|
||||
{
|
||||
return _link_get_lnk(self, ifindex, NM_LINK_TYPE_VTI6, out_link);
|
||||
}
|
||||
|
||||
const NMPlatformLnkVxlan *
|
||||
nm_platform_link_get_lnk_vxlan(NMPlatform *self, int ifindex, const NMPlatformLink **out_link)
|
||||
{
|
||||
|
|
@ -6547,6 +6559,46 @@ nm_platform_lnk_vti_to_string(const NMPlatformLnkVti *lnk, char *buf, gsize len)
|
|||
return buf;
|
||||
}
|
||||
|
||||
const char *
|
||||
nm_platform_lnk_vti6_to_string(const NMPlatformLnkVti6 *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,
|
||||
"vti6"
|
||||
"%s" /* remote */
|
||||
"%s" /* local */
|
||||
"%s" /* parent_ifindex */
|
||||
"%s" /* ikey */
|
||||
"%s" /* okey */
|
||||
"%s" /* fwmark */
|
||||
"",
|
||||
IN6_IS_ADDR_UNSPECIFIED(&lnk->remote)
|
||||
? ""
|
||||
: nm_sprintf_buf(str_remote, " remote %s", nm_inet6_ntop(&lnk->remote, str_remote1)),
|
||||
IN6_IS_ADDR_UNSPECIFIED(&lnk->local)
|
||||
? ""
|
||||
: nm_sprintf_buf(str_local, " local %s", nm_inet6_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)
|
||||
{
|
||||
|
|
@ -8261,6 +8313,31 @@ nm_platform_lnk_vti_cmp(const NMPlatformLnkVti *a, const NMPlatformLnkVti *b)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
nm_platform_lnk_vti6_hash_update(const NMPlatformLnkVti6 *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_vti6_cmp(const NMPlatformLnkVti6 *a, const NMPlatformLnkVti6 *b)
|
||||
{
|
||||
NM_CMP_SELF(a, b);
|
||||
NM_CMP_FIELD(a, b, parent_ifindex);
|
||||
NM_CMP_FIELD_MEMCMP(a, b, local);
|
||||
NM_CMP_FIELD_MEMCMP(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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -822,6 +822,15 @@ typedef struct {
|
|||
guint32 fwmark;
|
||||
} _nm_alignas(NMPlatformObject) NMPlatformLnkVti;
|
||||
|
||||
typedef struct {
|
||||
int parent_ifindex;
|
||||
struct in6_addr local;
|
||||
struct in6_addr remote;
|
||||
guint32 ikey;
|
||||
guint32 okey;
|
||||
guint32 fwmark;
|
||||
} _nm_alignas(NMPlatformObject) NMPlatformLnkVti6;
|
||||
|
||||
typedef struct {
|
||||
int parent_ifindex;
|
||||
guint64 sci; /* host byte order */
|
||||
|
|
@ -1696,6 +1705,15 @@ nm_platform_link_vti_add(NMPlatform *self,
|
|||
return nm_platform_link_add(self, NM_LINK_TYPE_VTI, name, 0, NULL, 0, 0, props, out_link);
|
||||
}
|
||||
|
||||
static inline int
|
||||
nm_platform_link_vti6_add(NMPlatform *self,
|
||||
const char *name,
|
||||
const NMPlatformLnkVti6 *props,
|
||||
const NMPlatformLink **out_link)
|
||||
{
|
||||
return nm_platform_link_add(self, NM_LINK_TYPE_VTI6, name, 0, NULL, 0, 0, props, out_link);
|
||||
}
|
||||
|
||||
static inline int
|
||||
nm_platform_link_vxlan_add(NMPlatform *self,
|
||||
const char *name,
|
||||
|
|
@ -1987,6 +2005,8 @@ 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 NMPlatformLnkVti6 *
|
||||
nm_platform_link_get_lnk_vti6(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 *
|
||||
|
|
@ -2276,6 +2296,7 @@ const char *nm_platform_lnk_tun_to_string(const NMPlatformLnkTun *lnk, char *buf
|
|||
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_vti6_to_string(const NMPlatformLnkVti6 *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);
|
||||
|
|
@ -2327,6 +2348,7 @@ 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_vti6_cmp(const NMPlatformLnkVti6 *a, const NMPlatformLnkVti6 *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);
|
||||
|
||||
|
|
@ -2390,6 +2412,7 @@ 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_vti6_hash_update(const NMPlatformLnkVti6 *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);
|
||||
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ typedef enum _nm_packed {
|
|||
NMP_OBJECT_TYPE_LNK_VLAN,
|
||||
NMP_OBJECT_TYPE_LNK_VRF,
|
||||
NMP_OBJECT_TYPE_LNK_VTI,
|
||||
NMP_OBJECT_TYPE_LNK_VTI6,
|
||||
NMP_OBJECT_TYPE_LNK_VXLAN,
|
||||
NMP_OBJECT_TYPE_LNK_WIREGUARD,
|
||||
NMP_OBJECT_TYPE_LNK_BOND,
|
||||
|
|
|
|||
|
|
@ -3613,6 +3613,18 @@ const NMPClass _nmp_classes[NMP_OBJECT_TYPE_MAX] = {
|
|||
.cmd_plobj_hash_update = (CmdPlobjHashUpdateFunc) nm_platform_lnk_vti_hash_update,
|
||||
.cmd_plobj_cmp = (CmdPlobjCmpFunc) nm_platform_lnk_vti_cmp,
|
||||
},
|
||||
[NMP_OBJECT_TYPE_LNK_VTI6 - 1] =
|
||||
{
|
||||
.parent = DEDUP_MULTI_OBJ_CLASS_INIT(),
|
||||
.obj_type = NMP_OBJECT_TYPE_LNK_VTI6,
|
||||
.sizeof_data = sizeof(NMPObjectLnkVti6),
|
||||
.sizeof_public = sizeof(NMPlatformLnkVti6),
|
||||
.obj_type_name = "vti6",
|
||||
.lnk_link_type = NM_LINK_TYPE_VTI6,
|
||||
.cmd_plobj_to_string = (CmdPlobjToStringFunc) nm_platform_lnk_vti6_to_string,
|
||||
.cmd_plobj_hash_update = (CmdPlobjHashUpdateFunc) nm_platform_lnk_vti6_hash_update,
|
||||
.cmd_plobj_cmp = (CmdPlobjCmpFunc) nm_platform_lnk_vti6_cmp,
|
||||
},
|
||||
[NMP_OBJECT_TYPE_LNK_VXLAN - 1] =
|
||||
{
|
||||
.parent = DEDUP_MULTI_OBJ_CLASS_INIT(),
|
||||
|
|
|
|||
|
|
@ -300,6 +300,10 @@ typedef struct {
|
|||
NMPlatformLnkVti _public;
|
||||
} NMPObjectLnkVti;
|
||||
|
||||
typedef struct {
|
||||
NMPlatformLnkVti6 _public;
|
||||
} NMPObjectLnkVti6;
|
||||
|
||||
typedef struct {
|
||||
NMPlatformLnkVxlan _public;
|
||||
} NMPObjectLnkVxlan;
|
||||
|
|
@ -403,6 +407,9 @@ struct _NMPObject {
|
|||
NMPlatformLnkVti lnk_vti;
|
||||
NMPObjectLnkVti _lnk_vti;
|
||||
|
||||
NMPlatformLnkVti6 lnk_vti6;
|
||||
NMPObjectLnkVti6 _lnk_vti6;
|
||||
|
||||
NMPlatformLnkVxlan lnk_vxlan;
|
||||
NMPObjectLnkVxlan _lnk_vxlan;
|
||||
|
||||
|
|
@ -536,6 +543,7 @@ _NMP_OBJECT_TYPE_IS_OBJ_WITH_IFINDEX(NMPObjectType obj_type)
|
|||
case NMP_OBJECT_TYPE_LNK_VLAN:
|
||||
case NMP_OBJECT_TYPE_LNK_VRF:
|
||||
case NMP_OBJECT_TYPE_LNK_VTI:
|
||||
case NMP_OBJECT_TYPE_LNK_VTI6:
|
||||
case NMP_OBJECT_TYPE_LNK_VXLAN:
|
||||
case NMP_OBJECT_TYPE_LNK_WIREGUARD:
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ 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(NMPObjectLnkVti6));
|
||||
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));
|
||||
|
|
@ -59,6 +60,7 @@ 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(NMPlatformLnkVti6));
|
||||
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));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue