]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
20897a0d AR |
2 | |
3 | #include <net/if.h> | |
4 | ||
5 | #include "sd-netlink.h" | |
6 | #include "missing.h" | |
441e9ae4 | 7 | #include "netdev/vrf.h" |
20897a0d AR |
8 | |
9 | static int netdev_vrf_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) { | |
10 | Vrf *v; | |
11 | int r; | |
12 | ||
13 | assert(netdev); | |
14 | assert(!link); | |
15 | assert(m); | |
16 | ||
17 | v = VRF(netdev); | |
18 | ||
19 | assert(v); | |
20 | ||
62b83cf6 | 21 | r = sd_netlink_message_append_u32(m, IFLA_VRF_TABLE, v->table); |
20897a0d AR |
22 | if (r < 0) |
23 | return log_netdev_error_errno(netdev, r, "Could not append IPLA_VRF_TABLE attribute: %m"); | |
24 | ||
25 | return r; | |
26 | } | |
27 | ||
28 | const NetDevVTable vrf_vtable = { | |
29 | .object_size = sizeof(Vrf), | |
6cb955c6 | 30 | .sections = "NetDev\0VRF\0", |
20897a0d AR |
31 | .fill_message_create = netdev_vrf_fill_message_create, |
32 | .create_type = NETDEV_CREATE_MASTER, | |
33 | }; |