1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 #include <linux/can/vxcan.h>
4 #include <linux/if_arp.h>
8 static int netdev_vxcan_fill_message_create(NetDev
*netdev
, Link
*link
, sd_netlink_message
*m
) {
12 VxCan
*v
= VXCAN(netdev
);
15 r
= sd_netlink_message_open_container(m
, VXCAN_INFO_PEER
);
20 r
= sd_netlink_message_append_string(m
, IFLA_IFNAME
, v
->ifname_peer
);
25 r
= sd_netlink_message_close_container(m
);
32 static int netdev_vxcan_verify(NetDev
*netdev
, const char *filename
) {
35 VxCan
*v
= VXCAN(netdev
);
38 return log_netdev_warning_errno(netdev
, SYNTHETIC_ERRNO(EINVAL
),
39 "VxCan NetDev without peer name configured in %s. Ignoring", filename
);
44 static void vxcan_done(NetDev
*netdev
) {
45 VxCan
*v
= VXCAN(netdev
);
50 const NetDevVTable vxcan_vtable
= {
51 .object_size
= sizeof(VxCan
),
52 .sections
= NETDEV_COMMON_SECTIONS
"VXCAN\0",
54 .fill_message_create
= netdev_vxcan_fill_message_create
,
55 .create_type
= NETDEV_CREATE_INDEPENDENT
,
56 .config_verify
= netdev_vxcan_verify
,