Line data Source code
1 : /* SPDX-License-Identifier: LGPL-2.1+ */ 2 : 3 : #include "missing_network.h" 4 : #include "netdev/xfrm.h" 5 : 6 0 : static int xfrm_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *message) { 7 : Xfrm *x; 8 : int r; 9 : 10 0 : assert(netdev); 11 0 : assert(message); 12 : 13 0 : x = XFRM(netdev); 14 : 15 0 : assert(link || x->independent); 16 : 17 0 : r = sd_netlink_message_append_u32(message, IFLA_XFRM_LINK, link ? link->ifindex : LOOPBACK_IFINDEX); 18 0 : if (r < 0) 19 0 : return log_netdev_error_errno(netdev, r, "Could not append IFLA_XFRM_LINK: %m"); 20 : 21 0 : r = sd_netlink_message_append_u32(message, IFLA_XFRM_IF_ID, x->if_id); 22 0 : if (r < 0) 23 0 : return log_netdev_error_errno(netdev, r, "Could not append IFLA_XFRM_IF_ID: %m"); 24 : 25 0 : return 0; 26 : } 27 : 28 : const NetDevVTable xfrm_vtable = { 29 : .object_size = sizeof(Xfrm), 30 : .sections = "Match\0NetDev\0Xfrm\0", 31 : .fill_message_create = xfrm_fill_message_create, 32 : .create_type = NETDEV_CREATE_STACKED 33 : };