if conf.get('ENABLE_NETWORKD') == 1
executable('systemd-networkd',
systemd_networkd_sources,
- include_directories : includes,
+ include_directories : network_include_dir,
link_with : [libnetworkd_core,
libsystemd_network,
libudev_static,
generator/network-generator.h
'''.split())
-network_include_dir = include_directories('.')
+network_include_dir = [includes, include_directories(['.', 'netdev', 'tc'])]
if conf.get('ENABLE_NETWORKD') == 1
networkd_gperf_c = custom_target(
networkd_gperf_c,
networkd_network_gperf_c,
netdev_gperf_c,
- include_directories : includes,
+ include_directories : network_include_dir,
link_with : [libshared])
install_data('org.freedesktop.network1.conf',
libudev_static,
libsystemd_network,
libshared],
- [threads]],
+ [threads],
+ [],
+ network_include_dir],
[['src/network/fuzz-network-parser.c',
'src/fuzz/fuzz.h'],
libudev_static,
libsystemd_network,
libshared],
- [threads]]
+ [threads],
+ [],
+ network_include_dir],
]
tests += [
[libnetworkd_core,
libsystemd_network,
libudev],
- []],
+ [], '', '', [], network_include_dir],
[['src/network/test-network.c'],
[libnetworkd_core,
libudev_static,
libsystemd_network,
libshared],
- [threads]],
+ [threads],
+ '', '', [], network_include_dir],
[['src/network/test-routing-policy-rule.c'],
[libnetworkd_core,
libsystemd_network,
libudev],
- []],
+ [], '', '', [], network_include_dir],
[['src/network/test-network-tables.c',
test_tables_h],
'src/network/generator/network-generator.c',
'src/network/generator/network-generator.h'],
[libshared],
- []],
+ [], '', '', [], network_include_dir],
]
endif
/* SPDX-License-Identifier: LGPL-2.1+ */
-#include "sd-netlink.h"
-
#include "alloc-util.h"
#include "bond.h"
#include "conf-parser.h"
#include <net/if.h>
+#include "bridge.h"
#include "missing.h"
#include "netlink-util.h"
-#include "netdev/bridge.h"
#include "network-internal.h"
#include "networkd-manager.h"
#include "string-table.h"
/* SPDX-License-Identifier: LGPL-2.1+ */
-#include "netdev/dummy.h"
+#include "dummy.h"
const NetDevVTable dummy_vtable = {
.object_size = sizeof(Dummy),
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-#include "netdev/netdev.h"
+#include "netdev.h"
typedef struct Dummy {
NetDev meta;
#include <linux/ip.h>
#include "conf-parser.h"
+#include "fou-tunnel.h"
#include "ip-protocol-list.h"
#include "missing.h"
-#include "netdev/fou-tunnel.h"
#include "netlink-util.h"
-#include "networkd-link.h"
#include "networkd-manager.h"
#include "parse-util.h"
-#include "sd-netlink.h"
#include "string-table.h"
#include "string-util.h"
#include "util.h"
#include <linux/fou.h>
#include "in-addr-util.h"
-#include "netdev/netdev.h"
+#include "netdev.h"
typedef enum FooOverUDPEncapType {
NETDEV_FOO_OVER_UDP_ENCAP_UNSPEC = FOU_ENCAP_UNSPEC,
#include <net/if.h>
-#include "sd-netlink.h"
-
#include "alloc-util.h"
#include "conf-parser.h"
#include "extract-word.h"
#include "geneve.h"
+#include "missing.h"
#include "netlink-util.h"
+#include "networkd-manager.h"
#include "parse-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
-#include "missing.h"
-#include "networkd-manager.h"
#define GENEVE_FLOW_LABEL_MAX_MASK 0xFFFFFU
#define DEFAULT_GENEVE_DESTINATION_PORT 6081
#include "in-addr-util.h"
#include "netdev.h"
-#include "networkd-link.h"
#include "networkd-network.h"
#define GENEVE_VID_MAX (1u << 24) - 1
#include <net/if.h>
#include "conf-parser.h"
-#include "netdev/ipvlan.h"
+#include "ipvlan.h"
#include "networkd-link.h"
#include "string-table.h"
#include <netinet/in.h>
#include <linux/if_link.h>
-#include "netdev/netdev.h"
+#include "netdev.h"
typedef enum IPVlanMode {
NETDEV_IPVLAN_MODE_L2 = IPVLAN_MODE_L2,
#include <linux/l2tp.h>
#include <linux/genetlink.h>
-#include "sd-netlink.h"
-
#include "conf-parser.h"
#include "hashmap.h"
#include "l2tp-tunnel.h"
#include "networkd-address.h"
#include "networkd-manager.h"
#include "path-util.h"
-#include "sd-netlink.h"
#include "socket-util.h"
#include "string-table.h"
#include "string-util.h"
#include <net/if.h>
#include "conf-parser.h"
-#include "netdev/macvlan.h"
+#include "macvlan.h"
#include "string-table.h"
static const char* const macvlan_mode_table[_NETDEV_MACVLAN_MODE_MAX] = {
typedef struct MacVlan MacVlan;
-#include "netdev/netdev.h"
+#include "netdev.h"
typedef enum MacVlanMode {
NETDEV_MACVLAN_MODE_PRIVATE = MACVLAN_MODE_PRIVATE,
_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
#endif
#include <stddef.h>
+#include "bond.h"
+#include "bridge.h"
#include "conf-parser.h"
-#include "network-internal.h"
-#include "netdev/bond.h"
-#include "netdev/bridge.h"
-#include "netdev/geneve.h"
-#include "netdev/ipvlan.h"
-#include "netdev/macsec.h"
-#include "netdev/macvlan.h"
-#include "netdev/tunnel.h"
-#include "netdev/tuntap.h"
-#include "netdev/veth.h"
-#include "netdev/vlan.h"
-#include "netdev/vxlan.h"
-#include "netdev/vrf.h"
-#include "netdev/netdev.h"
-#include "netdev/vxcan.h"
-#include "netdev/wireguard.h"
-#include "netdev/fou-tunnel.h"
-#include "netdev/l2tp-tunnel.h"
-#include "netdev/xfrm.h"
+#include "geneve.h"
+#include "ipvlan.h"
+#include "macsec.h"
+#include "macvlan.h"
+#include "tunnel.h"
+#include "tuntap.h"
+#include "veth.h"
#include "vlan-util.h"
+#include "vlan.h"
+#include "vxlan.h"
+#include "vrf.h"
+#include "netdev.h"
+#include "network-internal.h"
+#include "vxcan.h"
+#include "wireguard.h"
+#include "fou-tunnel.h"
+#include "l2tp-tunnel.h"
+#include "xfrm.h"
%}
struct ConfigPerfItem;
%null_strings
#include <netinet/in.h>
#include "alloc-util.h"
+#include "bond.h"
+#include "bridge.h"
#include "conf-files.h"
#include "conf-parser.h"
+#include "dummy.h"
#include "fd-util.h"
+#include "fou-tunnel.h"
+#include "geneve.h"
+#include "ipvlan.h"
+#include "l2tp-tunnel.h"
#include "list.h"
-#include "netdev/bond.h"
-#include "netdev/bridge.h"
-#include "netdev/dummy.h"
-#include "netdev/fou-tunnel.h"
-#include "netdev/geneve.h"
-#include "netdev/ipvlan.h"
-#include "netdev/l2tp-tunnel.h"
-#include "netdev/macsec.h"
-#include "netdev/macvlan.h"
-#include "netdev/netdev.h"
-#include "netdev/netdevsim.h"
-#include "netdev/nlmon.h"
-#include "netdev/tunnel.h"
-#include "netdev/tuntap.h"
-#include "netdev/vcan.h"
-#include "netdev/veth.h"
-#include "netdev/vlan.h"
-#include "netdev/vrf.h"
-#include "netdev/vxcan.h"
-#include "netdev/vxlan.h"
-#include "netdev/wireguard.h"
-#include "netdev/xfrm.h"
+#include "macsec.h"
+#include "macvlan.h"
+#include "netdev.h"
+#include "netdevsim.h"
#include "netlink-util.h"
#include "network-internal.h"
-#include "networkd-link.h"
#include "networkd-manager.h"
+#include "nlmon.h"
#include "siphash24.h"
#include "stat-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
+#include "tunnel.h"
+#include "tuntap.h"
+#include "vcan.h"
+#include "veth.h"
+#include "vlan.h"
+#include "vrf.h"
+#include "vxcan.h"
+#include "vxlan.h"
+#include "wireguard.h"
+#include "xfrm.h"
const NetDevVTable * const netdev_vtable[_NETDEV_KIND_MAX] = {
[NETDEV_KIND_BRIDGE] = &bridge_vtable,
#include "conf-parser.h"
#include "list.h"
-#include "../networkd-link.h"
+#include "networkd-link.h"
#include "time-util.h"
typedef struct netdev_join_callback netdev_join_callback;
/* SPDX-License-Identifier: LGPL-2.1+ */
-#include "netdev/netdevsim.h"
#include "missing.h"
+#include "netdevsim.h"
const NetDevVTable netdevsim_vtable = {
.object_size = sizeof(NetDevSim),
typedef struct NetDevSim NetDevSim;
-#include "netdev/netdev.h"
+#include "netdev.h"
struct NetDevSim {
NetDev meta;
/* SPDX-License-Identifier: LGPL-2.1+ */
-#include "netdev/nlmon.h"
+#include "nlmon.h"
static int netdev_nlmon_verify(NetDev *netdev, const char *filename) {
assert(netdev);
typedef struct NLMon NLMon;
-#include "netdev/netdev.h"
+#include "netdev.h"
struct NLMon {
NetDev meta;
#include <linux/if_tunnel.h>
#include <linux/ip6_tunnel.h>
-#include "sd-netlink.h"
-
#include "conf-parser.h"
#include "missing.h"
#include "netlink-util.h"
-#include "networkd-link.h"
-#include "netdev/tunnel.h"
#include "parse-util.h"
#include "string-table.h"
#include "string-util.h"
+#include "tunnel.h"
#include "util.h"
#define DEFAULT_TNL_HOP_LIMIT 64
#include "in-addr-util.h"
#include "conf-parser.h"
-#include "netdev/netdev.h"
-#include "netdev/fou-tunnel.h"
+#include "fou-tunnel.h"
+#include "netdev.h"
typedef enum Ip6TnlMode {
NETDEV_IP6_TNL_MODE_IP6IP6,
#include "alloc-util.h"
#include "fd-util.h"
-#include "netdev/tuntap.h"
+#include "tuntap.h"
#include "user-util.h"
#define TUN_DEV "/dev/net/tun"
typedef struct TunTap TunTap;
-#include "netdev/netdev.h"
+#include "netdev.h"
struct TunTap {
NetDev meta;
/* SPDX-License-Identifier: LGPL-2.1+ */
-#include "netdev/vcan.h"
+#include "vcan.h"
const NetDevVTable vcan_vtable = {
.object_size = sizeof(VCan),
#include <netinet/in.h>
#include <linux/can/netlink.h>
-#include "netdev/netdev.h"
+#include "netdev.h"
struct VCan {
NetDev meta;
#include <net/if.h>
#include <linux/veth.h>
-#include "sd-netlink.h"
-
-#include "netdev/veth.h"
+#include "veth.h"
static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
Veth *v;
typedef struct Veth Veth;
-#include "netdev/netdev.h"
+#include "netdev.h"
struct Veth {
NetDev meta;
#include <net/if.h>
#include <linux/if_vlan.h>
-#include "netdev/vlan.h"
#include "vlan-util.h"
+#include "vlan.h"
static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *req) {
struct ifla_vlan_flags flags = {};
typedef struct VLan VLan;
-#include "netdev/netdev.h"
+#include "netdev.h"
struct VLan {
NetDev meta;
#include <net/if.h>
-#include "sd-netlink.h"
#include "missing.h"
-#include "netdev/vrf.h"
+#include "vrf.h"
static int netdev_vrf_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
Vrf *v;
typedef struct Vrf Vrf;
-#include "netdev/netdev.h"
+#include "netdev.h"
struct Vrf {
NetDev meta;
#include <linux/can/vxcan.h>
-#include "netdev/vxcan.h"
+#include "vxcan.h"
static int netdev_vxcan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
VxCan *v;
typedef struct VxCan VxCan;
-#include "netdev/netdev.h"
+#include "netdev.h"
struct VxCan {
NetDev meta;
#include <net/if.h>
-#include "sd-netlink.h"
-
#include "conf-parser.h"
#include "alloc-util.h"
#include "extract-word.h"
#include "strv.h"
#include "parse-util.h"
#include "missing.h"
-
-#include "networkd-link.h"
-#include "netdev/vxlan.h"
+#include "vxlan.h"
static const char* const df_table[_NETDEV_VXLAN_DF_MAX] = {
[NETDEV_VXLAN_DF_NO] = "no",
#include <linux/if_link.h>
#include "in-addr-util.h"
-#include "netdev/netdev.h"
+#include "netdev.h"
#define VXLAN_VID_MAX (1u << 24) - 1
#define VXLAN_FLOW_LABEL_MAX_MASK 0xFFFFFU
#include "hexdecoct.h"
#include "memory-util.h"
#include "netlink-util.h"
-#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-util.h"
#include "parse-util.h"
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "missing_network.h"
-#include "netdev/xfrm.h"
+#include "xfrm.h"
static int xfrm_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *message) {
Xfrm *x;
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-#include "netdev/netdev.h"
+#include "netdev.h"
typedef struct Xfrm {
NetDev meta;
#include <net/if.h>
#include "alloc-util.h"
+#include "bridge.h"
#include "conf-parser.h"
-#include "netdev/bridge.h"
-#include "netdev/vxlan.h"
#include "netlink-util.h"
#include "networkd-fdb.h"
#include "networkd-manager.h"
#include "string-table.h"
#include "util.h"
#include "vlan-util.h"
+#include "vxlan.h"
#define STATIC_FDB_ENTRIES_PER_NETWORK_MAX 1024U
#include <unistd.h>
#include "alloc-util.h"
+#include "bond.h"
+#include "bridge.h"
#include "bus-util.h"
#include "dhcp-identifier.h"
#include "dhcp-lease-internal.h"
#include "env-file.h"
#include "fd-util.h"
#include "fileio.h"
+#include "ipvlan.h"
#include "missing_network.h"
-#include "netdev/bond.h"
-#include "netdev/bridge.h"
-#include "netdev/ipvlan.h"
-#include "netdev/vrf.h"
#include "netlink-util.h"
#include "network-internal.h"
#include "networkd-can.h"
#include "networkd-radv.h"
#include "networkd-routing-policy-rule.h"
#include "networkd-wifi.h"
+#include "qdisc.h"
#include "set.h"
#include "socket-util.h"
#include "stdio-util.h"
#include "tmpfile-util.h"
#include "udev-util.h"
#include "util.h"
-#include "tc/qdisc.h"
#include "virt.h"
+#include "vrf.h"
uint32_t link_get_vrf_table(Link *link) {
return link->network->vrf ? VRF(link->network->vrf)->table : RT_TABLE_MAIN;
#endif
#include <stddef.h>
#include "conf-parser.h"
+#include "netem.h"
#include "network-internal.h"
#include "networkd-conf.h"
#include "networkd-dhcp-common.h"
#include "networkd-ipv4ll.h"
#include "networkd-ndisc.h"
#include "networkd-network.h"
+#include "qdisc.h"
#include "vlan-util.h"
-#include "tc/qdisc.h"
-#include "tc/netem.h"
%}
struct ConfigPerfItem;
%null_strings
#include "sd-bus.h"
#include "sd-device.h"
+#include "bridge.h"
#include "condition.h"
#include "conf-parser.h"
#include "hashmap.h"
-#include "netdev/bridge.h"
-#include "netdev/netdev.h"
+#include "netdev.h"
#include "networkd-address-label.h"
#include "networkd-address.h"
#include "networkd-brvlan.h"
#include "networkd-routing-policy-rule.h"
#include "networkd-util.h"
#include "ordered-set.h"
+#include "qdisc.h"
#include "resolve-util.h"
-#include "tc/qdisc.h"
typedef enum IPv6PrivacyExtensions {
/* The values map to the kernel's /proc/sys/net/ipv6/conf/xxx/use_tempaddr values */
#include "sd-netlink.h"
#include "conf-parser.h"
-#include "macro.h"
-#include "../networkd-link.h"
+#include "networkd-link.h"
#include "time-util.h"
-typedef struct NetworkEmulator NetworkEmulator;
typedef struct QDiscs QDiscs;
-struct NetworkEmulator {
+typedef struct NetworkEmulator {
usec_t delay;
usec_t jitter;
uint32_t limit;
uint32_t loss;
-};
+} NetworkEmulator;
int network_emulator_new(NetworkEmulator **ret);
int network_emulator_fill_message(Link *link, QDiscs *qdisc, sd_netlink_message *req);
#pragma once
#include "conf-parser.h"
-#include "macro.h"
#include "netem.h"
-#include "../networkd-util.h"
+#include "networkd-link.h"
+#include "networkd-network.h"
+#include "networkd-util.h"
-typedef struct QDiscs QDiscs;
-
-struct QDiscs {
+typedef struct QDiscs {
NetworkConfigSection *section;
Network *network;
bool has_network_emulator:1;
NetworkEmulator ne;
-};
+} QDiscs;
void qdisc_free(QDiscs *qdisc);
int qdisc_new_static(Network *network, const char *filename, unsigned section_line, QDiscs **ret);
+#include "bond.h"
#include "dhcp6-internal.h"
#include "dhcp6-protocol.h"
#include "ethtool-util.h"
+#include "ipvlan.h"
#include "lldp-internal.h"
+#include "macvlan.h"
#include "ndisc-internal.h"
-#include "netdev/bond.h"
-#include "netdev/ipvlan.h"
-#include "netdev/macvlan.h"
-#include "netdev/tunnel.h"
#include "netlink-internal.h"
#include "networkd-link.h"
#include "networkd-network.h"
#include "networkd-util.h"
#include "test-tables.h"
+#include "tunnel.h"
int main(int argc, char **argv) {
test_table(bond_ad_select, NETDEV_BOND_AD_SELECT);