From af818d0344c13e1c6bf5c9683ded1be2f84d7aee Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Mon, 14 Sep 2020 03:42:35 +0000 Subject: [PATCH] sd-netlink: Add support for bare UDP --- src/libsystemd/sd-netlink/netlink-types.c | 9 +++++++++ src/libsystemd/sd-netlink/netlink-types.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c index 23d2025156..c0e63ee7dc 100644 --- a/src/libsystemd/sd-netlink/netlink-types.c +++ b/src/libsystemd/sd-netlink/netlink-types.c @@ -351,6 +351,12 @@ static const NLType rtnl_link_info_data_xfrm_types[] = { [IFLA_XFRM_IF_ID] = { .type = NETLINK_TYPE_U32 } }; +static const NLType rtnl_link_info_data_bareudp_types[] = { + [IFLA_BAREUDP_PORT] = { .type = NETLINK_TYPE_U16 }, + [IFLA_BAREUDP_ETHERTYPE] = { .type = NETLINK_TYPE_U16 }, + [IFLA_BAREUDP_SRCPORT_MIN] = { .type = NETLINK_TYPE_U16 }, + [IFLA_BAREUDP_MULTIPROTO_MODE] = { .type = NETLINK_TYPE_FLAG }, +}; /* these strings must match the .kind entries in the kernel */ static const char* const nl_union_link_info_data_table[] = { [NL_UNION_LINK_INFO_DATA_BOND] = "bond", @@ -384,6 +390,7 @@ static const char* const nl_union_link_info_data_table[] = { [NL_UNION_LINK_INFO_DATA_NLMON] = "nlmon", [NL_UNION_LINK_INFO_DATA_XFRM] = "xfrm", [NL_UNION_LINK_INFO_DATA_IFB] = "ifb", + [NL_UNION_LINK_INFO_DATA_BAREUDP] = "bareudp", }; DEFINE_STRING_TABLE_LOOKUP(nl_union_link_info_data, NLUnionLinkInfoData); @@ -439,6 +446,8 @@ static const NLTypeSystem rtnl_link_info_data_type_systems[] = { .types = rtnl_link_info_data_macsec_types }, [NL_UNION_LINK_INFO_DATA_XFRM] = { .count = ELEMENTSOF(rtnl_link_info_data_xfrm_types), .types = rtnl_link_info_data_xfrm_types }, + [NL_UNION_LINK_INFO_DATA_BAREUDP] = { .count = ELEMENTSOF(rtnl_link_info_data_bareudp_types), + .types = rtnl_link_info_data_bareudp_types }, }; static const NLTypeSystemUnion rtnl_link_info_data_type_system_union = { diff --git a/src/libsystemd/sd-netlink/netlink-types.h b/src/libsystemd/sd-netlink/netlink-types.h index 058747a2e9..b814b3d80f 100644 --- a/src/libsystemd/sd-netlink/netlink-types.h +++ b/src/libsystemd/sd-netlink/netlink-types.h @@ -88,6 +88,7 @@ typedef enum NLUnionLinkInfoData { NL_UNION_LINK_INFO_DATA_NLMON, NL_UNION_LINK_INFO_DATA_XFRM, NL_UNION_LINK_INFO_DATA_IFB, + NL_UNION_LINK_INFO_DATA_BAREUDP, _NL_UNION_LINK_INFO_DATA_MAX, _NL_UNION_LINK_INFO_DATA_INVALID = -1 } NLUnionLinkInfoData;