mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
networkd: netdev - introduce vtable for netdev kinds
Split each netdev kind into its own .h/.c.
This commit is contained in:
30
Makefile.am
30
Makefile.am
@@ -4590,17 +4590,27 @@ libsystemd_networkd_core_la_CFLAGS = \
|
||||
libsystemd_networkd_core_la_SOURCES = \
|
||||
src/libsystemd-network/network-internal.h \
|
||||
src/network/networkd.h \
|
||||
src/network/networkd-link.c \
|
||||
src/network/networkd-netdev.h \
|
||||
src/network/networkd-netdev-tunnel.h \
|
||||
src/network/networkd-netdev-veth.h \
|
||||
src/network/networkd-netdev-vxlan.h \
|
||||
src/network/networkd-netdev-vlan.h \
|
||||
src/network/networkd-netdev-macvlan.h \
|
||||
src/network/networkd-netdev-dummy.h \
|
||||
src/network/networkd-netdev-tuntap.h \
|
||||
src/network/networkd-netdev-bond.h \
|
||||
src/network/networkd-netdev-bridge.h \
|
||||
src/network/networkd-netdev.c \
|
||||
src/network/networkd-tunnel.c \
|
||||
src/network/networkd-veth.c \
|
||||
src/network/networkd-vxlan.c \
|
||||
src/network/networkd-vlan.c \
|
||||
src/network/networkd-macvlan.c \
|
||||
src/network/networkd-dummy.c \
|
||||
src/network/networkd-tuntap.c \
|
||||
src/network/networkd-bond.c \
|
||||
src/network/networkd-bridge.c \
|
||||
src/network/networkd-netdev-tunnel.c \
|
||||
src/network/networkd-netdev-veth.c \
|
||||
src/network/networkd-netdev-vxlan.c \
|
||||
src/network/networkd-netdev-vlan.c \
|
||||
src/network/networkd-netdev-macvlan.c \
|
||||
src/network/networkd-netdev-dummy.c \
|
||||
src/network/networkd-netdev-tuntap.c \
|
||||
src/network/networkd-netdev-bond.c \
|
||||
src/network/networkd-netdev-bridge.c \
|
||||
src/network/networkd-link.c \
|
||||
src/network/networkd-network.c \
|
||||
src/network/networkd-address.c \
|
||||
src/network/networkd-route.c \
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev.h"
|
||||
#include "libudev-private.h"
|
||||
#include "udev-util.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "conf-parser.h"
|
||||
#include "path-util.h"
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev.h"
|
||||
#include "network-internal.h"
|
||||
#include "libudev-private.h"
|
||||
#include "udev-util.h"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "sd-rtnl.h"
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev-bond.h"
|
||||
#include "missing.h"
|
||||
|
||||
static const char* const bond_mode_table[_NETDEV_BOND_MODE_MAX] = {
|
||||
@@ -63,7 +63,7 @@ static uint8_t bond_mode_to_kernel(BondMode mode) {
|
||||
}
|
||||
}
|
||||
|
||||
static int netdev_fill_bond_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
static int netdev_bond_fill_message_create(NetDev *netdev, sd_rtnl_message *m) {
|
||||
int r;
|
||||
|
||||
assert(m);
|
||||
@@ -123,41 +123,7 @@ static int netdev_fill_bond_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
int netdev_create_bond(NetDev *netdev, sd_rtnl_message_handler_t callback) {
|
||||
_cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->kind == NETDEV_KIND_BOND);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
|
||||
r = sd_rtnl_message_new_link(netdev->manager->rtnl, &m, RTM_NEWLINK, 0);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not allocate RTM_NEWLINK message: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
r = netdev_fill_bond_rtnl_message(netdev, m);
|
||||
if(r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_rtnl_call_async(netdev->manager->rtnl, m, callback, netdev, 0, NULL);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not send rtnetlink message: %s", strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
netdev_ref(netdev);
|
||||
|
||||
log_debug_netdev(netdev, "Creating bond netdev: %s",
|
||||
netdev_kind_to_string(netdev->kind));
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
const NetDevVTable bond_vtable = {
|
||||
.fill_message_create = netdev_bond_fill_message_create,
|
||||
.enslave = netdev_enslave,
|
||||
};
|
||||
43
src/network/networkd-netdev-bond.h
Normal file
43
src/network/networkd-netdev-bond.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2014 Tom Gundersen <teg@jklm.no>
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
systemd is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "networkd-netdev.h"
|
||||
|
||||
extern const NetDevVTable bond_vtable;
|
||||
|
||||
typedef enum BondMode {
|
||||
NETDEV_BOND_MODE_BALANCE_RR,
|
||||
NETDEV_BOND_MODE_ACTIVE_BACKUP,
|
||||
NETDEV_BOND_MODE_BALANCE_XOR,
|
||||
NETDEV_BOND_MODE_BROADCAST,
|
||||
NETDEV_BOND_MODE_802_3AD,
|
||||
NETDEV_BOND_MODE_BALANCE_TLB,
|
||||
NETDEV_BOND_MODE_BALANCE_ALB,
|
||||
_NETDEV_BOND_MODE_MAX,
|
||||
_NETDEV_BOND_MODE_INVALID = -1
|
||||
} BondMode;
|
||||
|
||||
const char *bond_mode_to_string(BondMode d) _const_;
|
||||
BondMode bond_mode_from_string(const char *d) _pure_;
|
||||
|
||||
int config_parse_bond_mode(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
@@ -25,12 +25,14 @@
|
||||
#include <net/if.h>
|
||||
|
||||
#include "sd-rtnl.h"
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev-bridge.h"
|
||||
#include "missing.h"
|
||||
|
||||
static int netdev_fill_bridge_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
static int netdev_bridge_fill_message_create(NetDev *netdev, sd_rtnl_message *m) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->ifname);
|
||||
assert(m);
|
||||
|
||||
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
|
||||
@@ -49,8 +51,7 @@ static int netdev_fill_bridge_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA,
|
||||
netdev_kind_to_string(netdev->kind));
|
||||
r = sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA, "bridge");
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not append IFLA_INFO_DATA attribute: %s",
|
||||
@@ -77,40 +78,7 @@ static int netdev_fill_bridge_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
int netdev_create_bridge(NetDev *netdev, sd_rtnl_message_handler_t callback) {
|
||||
_cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->kind == NETDEV_KIND_BRIDGE);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
|
||||
r = sd_rtnl_message_new_link(netdev->manager->rtnl, &m, RTM_NEWLINK, 0);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not allocate RTM_NEWLINK message: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
r = netdev_fill_bridge_rtnl_message(netdev, m);
|
||||
if(r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_rtnl_call_async(netdev->manager->rtnl, m, callback, netdev, 0, NULL);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not send rtnetlink message: %s", strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
netdev_ref(netdev);
|
||||
|
||||
log_debug_netdev(netdev, "Creating bridge netdev.");
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
const NetDevVTable bridge_vtable = {
|
||||
.fill_message_create = netdev_bridge_fill_message_create,
|
||||
.enslave = netdev_enslave,
|
||||
};
|
||||
26
src/network/networkd-netdev-bridge.h
Normal file
26
src/network/networkd-netdev-bridge.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2014 Tom Gundersen <teg@jklm.no>
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
systemd is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "networkd-netdev.h"
|
||||
|
||||
extern const NetDevVTable bridge_vtable;
|
||||
@@ -26,13 +26,13 @@
|
||||
#include <linux/veth.h>
|
||||
|
||||
#include "sd-rtnl.h"
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev-dummy.h"
|
||||
|
||||
|
||||
static int netdev_fill_dummy_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
static int netdev_dummy_fill_message_create(NetDev *netdev, sd_rtnl_message *m) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->ifname);
|
||||
assert(m);
|
||||
|
||||
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
|
||||
@@ -61,8 +61,7 @@ static int netdev_fill_dummy_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA,
|
||||
netdev_kind_to_string(netdev->kind));
|
||||
r = sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA, "dummy");
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not append IFLA_INFO_DATA attribute: %s",
|
||||
@@ -81,42 +80,6 @@ static int netdev_fill_dummy_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
int netdev_create_dummy(NetDev *netdev, sd_rtnl_message_handler_t callback) {
|
||||
_cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
|
||||
r = sd_rtnl_message_new_link(netdev->manager->rtnl, &m, RTM_NEWLINK, 0);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not allocate RTM_NEWLINK message: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
if(netdev->kind != NETDEV_KIND_DUMMY)
|
||||
return -ENOTSUP;
|
||||
|
||||
r = netdev_fill_dummy_rtnl_message(netdev, m);
|
||||
if(r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_rtnl_call_async(netdev->manager->rtnl, m, callback, netdev, 0, NULL);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not send rtnetlink message: %s", strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
netdev_ref(netdev);
|
||||
|
||||
log_debug_netdev(netdev, "Creating dummy netdev.");
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
const NetDevVTable dummy_vtable = {
|
||||
.fill_message_create = netdev_dummy_fill_message_create,
|
||||
};
|
||||
26
src/network/networkd-netdev-dummy.h
Normal file
26
src/network/networkd-netdev-dummy.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2014 Tom Gundersen <teg@jklm.no>
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
systemd is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "networkd-netdev.h"
|
||||
|
||||
extern const NetDevVTable dummy_vtable;
|
||||
@@ -1,7 +1,10 @@
|
||||
%{
|
||||
#include <stddef.h>
|
||||
#include "conf-parser.h"
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev.h"
|
||||
#include "networkd-netdev-tunnel.h"
|
||||
#include "networkd-netdev-bond.h"
|
||||
#include "networkd-netdev-macvlan.h"
|
||||
#include "network-internal.h"
|
||||
%}
|
||||
struct ConfigPerfItem;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev-macvlan.h"
|
||||
#include "network-internal.h"
|
||||
#include "conf-parser.h"
|
||||
#include "list.h"
|
||||
@@ -36,37 +36,22 @@ static const char* const macvlan_mode_table[_NETDEV_MACVLAN_MODE_MAX] = {
|
||||
DEFINE_STRING_TABLE_LOOKUP(macvlan_mode, MacVlanMode);
|
||||
DEFINE_CONFIG_PARSE_ENUM(config_parse_macvlan_mode, macvlan_mode, MacVlanMode, "Failed to parse macvlan mode");
|
||||
|
||||
int netdev_create_macvlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t callback) {
|
||||
_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
|
||||
const char *kind;
|
||||
static int netdev_macvlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *req) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->kind == NETDEV_KIND_MACVLAN);
|
||||
assert(link);
|
||||
assert(callback);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
|
||||
r = sd_rtnl_message_new_link(netdev->manager->rtnl, &req, RTM_NEWLINK, 0);
|
||||
r = sd_rtnl_message_append_u32(req, IFLA_LINK, link->ifindex);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not allocate RTM_NEWLINK message: %s",
|
||||
"Could not append IFLA_LINK attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
if (link) {
|
||||
r = sd_rtnl_message_append_u32(req, IFLA_LINK, link->ifindex);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not append IFLA_LINK attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_append_string(req, IFLA_IFNAME, netdev->ifname);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
@@ -103,13 +88,7 @@ int netdev_create_macvlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t
|
||||
return r;
|
||||
}
|
||||
|
||||
kind = netdev_kind_to_string(netdev->kind);
|
||||
if (!kind) {
|
||||
log_error_netdev(netdev, "Invalid kind");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_open_container_union(req, IFLA_INFO_DATA, kind);
|
||||
r = sd_rtnl_message_open_container_union(req, IFLA_INFO_DATA, "macvlan");
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not open IFLA_INFO_DATA container: %s",
|
||||
@@ -143,18 +122,9 @@ int netdev_create_macvlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_rtnl_call_async(netdev->manager->rtnl, req, callback, link, 0, NULL);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not send rtnetlink message: %s", strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
link_ref(link);
|
||||
|
||||
log_debug_netdev(netdev, "creating netdev");
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const NetDevVTable macvlan_vtable = {
|
||||
.fill_message_create_on_link = netdev_macvlan_fill_message_create,
|
||||
};
|
||||
40
src/network/networkd-netdev-macvlan.h
Normal file
40
src/network/networkd-netdev-macvlan.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2014 Tom Gundersen <teg@jklm.no>
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
systemd is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "networkd-netdev.h"
|
||||
|
||||
extern const NetDevVTable macvlan_vtable;
|
||||
|
||||
typedef enum MacVlanMode {
|
||||
NETDEV_MACVLAN_MODE_PRIVATE = MACVLAN_MODE_PRIVATE,
|
||||
NETDEV_MACVLAN_MODE_VEPA = MACVLAN_MODE_VEPA,
|
||||
NETDEV_MACVLAN_MODE_BRIDGE = MACVLAN_MODE_BRIDGE,
|
||||
NETDEV_MACVLAN_MODE_PASSTHRU = MACVLAN_MODE_PASSTHRU,
|
||||
_NETDEV_MACVLAN_MODE_MAX,
|
||||
_NETDEV_MACVLAN_MODE_INVALID = -1
|
||||
} MacVlanMode;
|
||||
|
||||
const char *macvlan_mode_to_string(MacVlanMode d) _const_;
|
||||
MacVlanMode macvlan_mode_from_string(const char *d) _pure_;
|
||||
|
||||
int config_parse_macvlan_mode(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
@@ -26,24 +26,22 @@
|
||||
#include <linux/if_tunnel.h>
|
||||
|
||||
#include "sd-rtnl.h"
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev-tunnel.h"
|
||||
#include "network-internal.h"
|
||||
#include "util.h"
|
||||
#include "missing.h"
|
||||
#include "conf-parser.h"
|
||||
|
||||
|
||||
static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
NetDev *netdev;
|
||||
static int netdev_ipip_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->kind == NETDEV_KIND_IPIP);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
assert(link);
|
||||
assert(link->network);
|
||||
assert(link->network->tunnel);
|
||||
assert(m);
|
||||
|
||||
netdev = link->network->tunnel;
|
||||
|
||||
assert(netdev->family == AF_INET);
|
||||
|
||||
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
|
||||
@@ -142,17 +140,16 @@ static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
NetDev *netdev;
|
||||
static int netdev_sit_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->kind == NETDEV_KIND_SIT);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
assert(link);
|
||||
assert(link->network);
|
||||
assert(link->network->tunnel);
|
||||
assert(m);
|
||||
|
||||
netdev = link->network->tunnel;
|
||||
|
||||
assert(netdev->family == AF_INET);
|
||||
|
||||
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
|
||||
@@ -224,18 +221,10 @@ static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_append_u8(m, IFLA_IPTUN_TOS, netdev->tos);
|
||||
r = sd_rtnl_message_append_u8(m, IFLA_IPTUN_TTL, netdev->ttl);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not append IFLA_IPTUN_TOS attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_append_u8(m, IFLA_IPTUN_PMTUDISC, netdev->tunnel_pmtudisc);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not append IFLA_IPTUN_PMTUDISC attribute: %s",
|
||||
"Could not append IFLA_IPTUN_TTL attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
@@ -259,17 +248,16 @@ static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
static int netdev_fill_ipgre_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
NetDev *netdev;
|
||||
static int netdev_gre_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->kind == NETDEV_KIND_GRE);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
assert(link);
|
||||
assert(link->network);
|
||||
assert(link->network->tunnel);
|
||||
assert(m);
|
||||
|
||||
netdev = link->network->tunnel;
|
||||
|
||||
assert(netdev->family == AF_INET);
|
||||
|
||||
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
|
||||
@@ -376,17 +364,16 @@ static int netdev_fill_ipgre_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
static int netdev_fill_vti_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
NetDev *netdev;
|
||||
static int netdev_vti_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->kind == NETDEV_KIND_VTI);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
assert(link);
|
||||
assert(link->network);
|
||||
assert(link->network->tunnel);
|
||||
assert(m);
|
||||
|
||||
netdev = link->network->tunnel;
|
||||
|
||||
assert(netdev->family == AF_INET);
|
||||
|
||||
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
|
||||
@@ -477,65 +464,25 @@ static int netdev_fill_vti_rtnl_message(Link *link, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
int netdev_create_tunnel(NetDev *netdev, Link *link, sd_rtnl_message_handler_t callback) {
|
||||
_cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
|
||||
int r;
|
||||
|
||||
static int netdev_tunnel_verify(NetDev *netdev, const char *filename) {
|
||||
assert(netdev);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
assert(link);
|
||||
assert(link->network);
|
||||
assert(link->network->tunnel == netdev);
|
||||
assert(filename);
|
||||
|
||||
r = sd_rtnl_message_new_link(netdev->manager->rtnl, &m, RTM_NEWLINK, 0);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not allocate RTM_NEWLINK message: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
if (netdev->local.in.s_addr == INADDR_ANY) {
|
||||
log_warning("Tunnel without local address configured in %s. Ignoring", filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch(netdev->kind) {
|
||||
case NETDEV_KIND_IPIP:
|
||||
r = netdev_fill_ipip_rtnl_message(link, m);
|
||||
if(r < 0)
|
||||
return r;
|
||||
break;
|
||||
case NETDEV_KIND_SIT:
|
||||
r = netdev_fill_sit_rtnl_message(link, m);
|
||||
if(r < 0)
|
||||
return r;
|
||||
break;
|
||||
case NETDEV_KIND_VTI:
|
||||
netdev_fill_vti_rtnl_message(link, m);
|
||||
if(r < 0)
|
||||
return r;
|
||||
break;
|
||||
case NETDEV_KIND_GRE:
|
||||
r = netdev_fill_ipgre_rtnl_message(link, m);
|
||||
if(r < 0)
|
||||
return r;
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
if (netdev->remote.in.s_addr == INADDR_ANY) {
|
||||
log_warning("Tunnel without remote address configured in %s. Ignoring", filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = sd_rtnl_call_async(netdev->manager->rtnl, m, callback, link, 0, NULL);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not send rtnetlink message: %s", strerror(-r));
|
||||
return r;
|
||||
if (netdev->family != AF_INET) {
|
||||
log_warning("Tunnel with invalid address family configured in %s. Ignoring", filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
link_ref(link);
|
||||
|
||||
log_debug_netdev(netdev, "Creating tunnel netdev: %s",
|
||||
netdev_kind_to_string(netdev->kind));
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -567,3 +514,23 @@ int config_parse_tunnel_address(const char *unit,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const NetDevVTable ipip_vtable = {
|
||||
.fill_message_create_on_link = netdev_ipip_fill_message_create,
|
||||
.config_verify = netdev_tunnel_verify,
|
||||
};
|
||||
|
||||
const NetDevVTable sit_vtable = {
|
||||
.fill_message_create_on_link = netdev_sit_fill_message_create,
|
||||
.config_verify = netdev_tunnel_verify,
|
||||
};
|
||||
|
||||
const NetDevVTable vti_vtable = {
|
||||
.fill_message_create_on_link = netdev_vti_fill_message_create,
|
||||
.config_verify = netdev_tunnel_verify,
|
||||
};
|
||||
|
||||
const NetDevVTable gre_vtable = {
|
||||
.fill_message_create_on_link = netdev_gre_fill_message_create,
|
||||
.config_verify = netdev_tunnel_verify,
|
||||
};
|
||||
29
src/network/networkd-netdev-tunnel.h
Normal file
29
src/network/networkd-netdev-tunnel.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2014 Tom Gundersen <teg@jklm.no>
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
systemd is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "networkd-netdev.h"
|
||||
|
||||
extern const NetDevVTable ipip_vtable;
|
||||
extern const NetDevVTable sit_vtable;
|
||||
extern const NetDevVTable vti_vtable;
|
||||
extern const NetDevVTable gre_vtable;
|
||||
@@ -23,11 +23,10 @@
|
||||
#include <net/if.h>
|
||||
#include <linux/if_tun.h>
|
||||
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev-tuntap.h"
|
||||
|
||||
#define TUN_DEV "/dev/net/tun"
|
||||
|
||||
|
||||
static int netdev_fill_tuntap_message(NetDev *netdev, struct ifreq *ifr) {
|
||||
|
||||
assert(netdev);
|
||||
@@ -129,7 +128,7 @@ static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) {
|
||||
return r;
|
||||
}
|
||||
|
||||
int netdev_create_tuntap(NetDev *netdev) {
|
||||
static int netdev_create_tuntap(NetDev *netdev) {
|
||||
struct ifreq ifr;
|
||||
int r;
|
||||
|
||||
@@ -153,3 +152,11 @@ int netdev_create_tuntap(NetDev *netdev) {
|
||||
|
||||
return netdev_tuntap_add(netdev, &ifr);
|
||||
}
|
||||
|
||||
const NetDevVTable tun_vtable = {
|
||||
.create = netdev_create_tuntap,
|
||||
};
|
||||
|
||||
const NetDevVTable tap_vtable = {
|
||||
.create = netdev_create_tuntap,
|
||||
};
|
||||
27
src/network/networkd-netdev-tuntap.h
Normal file
27
src/network/networkd-netdev-tuntap.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2014 Tom Gundersen <teg@jklm.no>
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
systemd is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "networkd-netdev.h"
|
||||
|
||||
extern const NetDevVTable tun_vtable;
|
||||
extern const NetDevVTable tap_vtable;
|
||||
@@ -25,13 +25,13 @@
|
||||
#include <linux/veth.h>
|
||||
|
||||
#include "sd-rtnl.h"
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev-veth.h"
|
||||
|
||||
|
||||
static int netdev_fill_veth_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
static int netdev_veth_fill_message_create(NetDev *netdev, sd_rtnl_message *m) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->ifname);
|
||||
assert(m);
|
||||
|
||||
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
|
||||
@@ -60,8 +60,7 @@ static int netdev_fill_veth_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA,
|
||||
netdev_kind_to_string(netdev->kind));
|
||||
r = sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA, "veth");
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not append IFLA_INFO_DATA attribute: %s",
|
||||
@@ -114,41 +113,31 @@ static int netdev_fill_veth_rtnl_message(NetDev *netdev, sd_rtnl_message *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
int netdev_create_veth(NetDev *netdev, sd_rtnl_message_handler_t callback) {
|
||||
_cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
|
||||
static int netdev_veth_verify(NetDev *netdev, const char *filename) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
assert(netdev->kind == NETDEV_KIND_VETH);
|
||||
assert(filename);
|
||||
|
||||
r = sd_rtnl_message_new_link(netdev->manager->rtnl, &m, RTM_NEWLINK, 0);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not allocate RTM_NEWLINK message: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
if (!netdev->ifname_peer) {
|
||||
log_warning("Veth NetDev without peer name configured in %s. Ignoring",
|
||||
filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = netdev_fill_veth_rtnl_message(netdev, m);
|
||||
if(r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_rtnl_call_async(netdev->manager->rtnl, m, callback, netdev, 0, NULL);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not send rtnetlink message: %s", strerror(-r));
|
||||
return r;
|
||||
if (!netdev->mac_peer) {
|
||||
r = netdev_get_mac(netdev->ifname_peer, &netdev->mac_peer);
|
||||
if (r < 0) {
|
||||
log_warning("Failed to generate predictable MAC address for %s. Ignoring",
|
||||
netdev->ifname_peer);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
netdev_ref(netdev);
|
||||
|
||||
log_debug_netdev(netdev, "Creating veth netdev: %s",
|
||||
netdev_kind_to_string(netdev->kind));
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const NetDevVTable veth_vtable = {
|
||||
.fill_message_create = netdev_veth_fill_message_create,
|
||||
.config_verify = netdev_veth_verify,
|
||||
};
|
||||
26
src/network/networkd-netdev-veth.h
Normal file
26
src/network/networkd-netdev-veth.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2014 Tom Gundersen <teg@jklm.no>
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
systemd is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "networkd-netdev.h"
|
||||
|
||||
extern const NetDevVTable veth_vtable;
|
||||
@@ -21,41 +21,27 @@
|
||||
|
||||
#include <net/if.h>
|
||||
|
||||
#include "networkd.h"
|
||||
#include "networkd-netdev-vlan.h"
|
||||
#include "network-internal.h"
|
||||
#include "list.h"
|
||||
|
||||
int netdev_create_vlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t callback) {
|
||||
_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
|
||||
const char *kind;
|
||||
static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *req) {
|
||||
int r;
|
||||
|
||||
assert(netdev);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->kind == NETDEV_KIND_VLAN);
|
||||
assert(link);
|
||||
assert(callback);
|
||||
assert(netdev->ifname);
|
||||
assert(netdev->manager);
|
||||
assert(netdev->manager->rtnl);
|
||||
assert(req);
|
||||
|
||||
r = sd_rtnl_message_new_link(netdev->manager->rtnl, &req, RTM_NEWLINK, 0);
|
||||
r = sd_rtnl_message_append_u32(req, IFLA_LINK, link->ifindex);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not allocate RTM_NEWLINK message: %s",
|
||||
"Could not append IFLA_LINK attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
if (link) {
|
||||
r = sd_rtnl_message_append_u32(req, IFLA_LINK, link->ifindex);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not append IFLA_LINK attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_append_string(req, IFLA_IFNAME, netdev->ifname);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
@@ -92,13 +78,7 @@ int netdev_create_vlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t cal
|
||||
return r;
|
||||
}
|
||||
|
||||
kind = netdev_kind_to_string(netdev->kind);
|
||||
if (!kind) {
|
||||
log_error_netdev(netdev, "Invalid kind");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_open_container_union(req, IFLA_INFO_DATA, kind);
|
||||
r = sd_rtnl_message_open_container_union(req, IFLA_INFO_DATA, "vlan");
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not open IFLA_INFO_DATA container: %s",
|
||||
@@ -132,18 +112,22 @@ int netdev_create_vlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t cal
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_rtnl_call_async(netdev->manager->rtnl, req, callback, link, 0, NULL);
|
||||
if (r < 0) {
|
||||
log_error_netdev(netdev,
|
||||
"Could not send rtnetlink message: %s", strerror(-r));
|
||||
return r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int netdev_vlan_verify(NetDev *netdev, const char *filename) {
|
||||
assert(netdev);
|
||||
assert(filename);
|
||||
|
||||
if (netdev->vlanid > VLANID_MAX) {
|
||||
log_warning("VLAN without valid Id configured in %s. Ignoring", filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
link_ref(link);
|
||||
|
||||
log_debug_netdev(netdev, "creating netdev");
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const NetDevVTable vlan_vtable = {
|
||||
.fill_message_create_on_link = netdev_vlan_fill_message_create,
|
||||
.config_verify = netdev_vlan_verify,
|
||||
};
|
||||
28
src/network/networkd-netdev-vlan.h
Normal file
28
src/network/networkd-netdev-vlan.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2014 Tom Gundersen <teg@jklm.no>
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
systemd is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "networkd-netdev.h"
|
||||
|
||||
#define VLANID_MAX 4094
|
||||
|
||||
extern const NetDevVTable vlan_vtable;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user