diff options
author | Hiram van Paassen <hiram.van.paassen@mastervolt.com> | 2018-04-10 17:26:20 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2018-06-09 15:12:31 +0200 |
commit | 06828bb617713d522775c725be5db9935e3aea6e (patch) | |
tree | e75b5f633bb0741d721694fd2a123c3b4912b746 /src/libsystemd/sd-netlink | |
parent | bd5038f8b76e2fc1b30e09b5a48d8f96e778f8b1 (diff) | |
download | systemd-06828bb617713d522775c725be5db9935e3aea6e.tar.gz |
networkd-link: add support to configure CAN interfaces
This patch adds support for kind "can". Fixes: #4042.
Diffstat (limited to 'src/libsystemd/sd-netlink')
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-types.c | 8 | ||||
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-types.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c index ddb4d90eaf..a82b1e1a89 100644 --- a/src/libsystemd/sd-netlink/netlink-types.c +++ b/src/libsystemd/sd-netlink/netlink-types.c @@ -300,6 +300,11 @@ static const NLType rtnl_link_info_data_geneve_types[] = { [IFLA_GENEVE_LABEL] = { .type = NETLINK_TYPE_U32 }, }; +static const NLType rtnl_link_info_data_can_types[] = { + [IFLA_CAN_BITTIMING] = { .size = sizeof(struct can_bittiming) }, + [IFLA_CAN_RESTART_MS] = { .type = NETLINK_TYPE_U32 }, +}; + /* 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", @@ -326,6 +331,7 @@ static const char* const nl_union_link_info_data_table[] = { [NL_UNION_LINK_INFO_DATA_VXCAN] = "vxcan", [NL_UNION_LINK_INFO_DATA_WIREGUARD] = "wireguard", [NL_UNION_LINK_INFO_DATA_NETDEVSIM] = "netdevsim", + [NL_UNION_LINK_INFO_DATA_CAN] = "can", }; DEFINE_STRING_TABLE_LOOKUP(nl_union_link_info_data, NLUnionLinkInfoData); @@ -371,6 +377,8 @@ static const NLTypeSystem rtnl_link_info_data_type_systems[] = { .types = rtnl_link_info_data_geneve_types }, [NL_UNION_LINK_INFO_DATA_VXCAN] = { .count = ELEMENTSOF(rtnl_link_info_data_vxcan_types), .types = rtnl_link_info_data_vxcan_types }, + [NL_UNION_LINK_INFO_DATA_CAN] = { .count = ELEMENTSOF(rtnl_link_info_data_can_types), + .types = rtnl_link_info_data_can_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 a7542eb33d..559976c24c 100644 --- a/src/libsystemd/sd-netlink/netlink-types.h +++ b/src/libsystemd/sd-netlink/netlink-types.h @@ -83,6 +83,7 @@ typedef enum NLUnionLinkInfoData { NL_UNION_LINK_INFO_DATA_VXCAN, NL_UNION_LINK_INFO_DATA_WIREGUARD, NL_UNION_LINK_INFO_DATA_NETDEVSIM, + NL_UNION_LINK_INFO_DATA_CAN, _NL_UNION_LINK_INFO_DATA_MAX, _NL_UNION_LINK_INFO_DATA_INVALID = -1 } NLUnionLinkInfoData; |