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