2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2016-06-10 01:57:51 +02:00
|
|
|
|
|
|
|
#include <net/if.h>
|
|
|
|
|
|
|
|
#include "missing.h"
|
2019-10-30 09:02:15 +01:00
|
|
|
#include "vrf.h"
|
2016-06-10 01:57:51 +02:00
|
|
|
|
|
|
|
static int netdev_vrf_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
|
|
|
|
Vrf *v;
|
|
|
|
int r;
|
|
|
|
|
|
|
|
assert(netdev);
|
|
|
|
assert(!link);
|
|
|
|
assert(m);
|
|
|
|
|
|
|
|
v = VRF(netdev);
|
|
|
|
|
|
|
|
assert(v);
|
|
|
|
|
2017-08-31 01:14:05 +02:00
|
|
|
r = sd_netlink_message_append_u32(m, IFLA_VRF_TABLE, v->table);
|
2016-06-10 01:57:51 +02:00
|
|
|
if (r < 0)
|
|
|
|
return log_netdev_error_errno(netdev, r, "Could not append IPLA_VRF_TABLE attribute: %m");
|
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
const NetDevVTable vrf_vtable = {
|
|
|
|
.object_size = sizeof(Vrf),
|
2018-11-03 08:29:49 +01:00
|
|
|
.sections = "Match\0NetDev\0VRF\0",
|
2016-06-10 01:57:51 +02:00
|
|
|
.fill_message_create = netdev_vrf_fill_message_create,
|
|
|
|
.create_type = NETDEV_CREATE_MASTER,
|
2019-05-23 04:27:12 +02:00
|
|
|
.generate_mac = true,
|
2016-06-10 01:57:51 +02:00
|
|
|
};
|