Split out of #37344.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "fd-util.h"
-#include "fs-util.h"
#include "fuzz.h"
#include "networkd-manager.h"
#include "tmpfile-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "fd-util.h"
-#include "fs-util.h"
#include "fuzz.h"
#include "networkd-manager.h"
#include "tmpfile-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
+#include <sys/stat.h>
#include "alloc-util.h"
#include "build.h"
#include "fd-util.h"
#include "fs-util.h"
#include "generator.h"
-#include "macro.h"
+#include "log.h"
#include "main-func.h"
#include "mkdir.h"
#include "network-generator.h"
#include "path-util.h"
#include "proc-cmdline.h"
+#include "string-util.h"
#define NETWORK_UNIT_DIRECTORY "/run/systemd/network/"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
#include "alloc-util.h"
#include "extract-word.h"
-#include "fd-util.h"
-#include "fileio.h"
#include "hostname-util.h"
#include "log.h"
-#include "macro.h"
#include "memstream-util.h"
#include "netif-naming-scheme.h"
#include "network-generator.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "macro.h"
#include "network-generator.h"
-#include "string-util.h"
#include "tests.h"
static void test_network_one(const char *ifname, const char *key, const char *value, const char *expected) {
* Copyright © 2020 VMware, Inc. */
#include <linux/if_arp.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "bareudp.h"
-#include "netlink-util.h"
-#include "networkd-manager.h"
+#include "conf-parser.h"
#include "string-table.h"
static const char* const bare_udp_protocol_table[_BARE_UDP_PROTOCOL_MAX] = {
* Copyright © 2020 VMware, Inc. */
#pragma once
-typedef struct BareUDP BareUDP;
-
-#include <linux/if_ether.h>
-
-#include "conf-parser.h"
+#include "forward.h"
#include "netdev.h"
typedef enum BareUDPProtocol {
_BARE_UDP_PROTOCOL_INVALID = -EINVAL,
} BareUDPProtocol;
-struct BareUDP {
+typedef struct BareUDP {
NetDev meta;
BareUDPProtocol iftype;
uint16_t dest_port;
uint16_t min_port;
-};
+} BareUDP;
DEFINE_NETDEV_CAST(BAREUDP, BareUDP);
extern const NetDevVTable bare_udp_vtable;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <inttypes.h>
-#include <linux/genetlink.h>
#include <linux/if_arp.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "batadv.h"
-#include "fileio.h"
+#include "conf-parser.h"
#include "netlink-util.h"
-#include "network-internal.h"
#include "networkd-manager.h"
#include "parse-util.h"
-#include "stdio-util.h"
#include "string-table.h"
-#include "string-util.h"
static void batadv_init(NetDev *n) {
BatmanAdvanced *b = BATADV(n);
#include <linux/batman_adv.h>
-#include "conf-parser.h"
+#include "forward.h"
#include "netdev.h"
#define BATADV_GENL_NAME "batadv"
#include <linux/if_arp.h>
#include <netinet/in.h>
+#include "sd-netlink.h"
+
#include "alloc-util.h"
#include "bond.h"
#include "bond-util.h"
#include "conf-parser.h"
#include "ether-addr-util.h"
#include "extract-word.h"
-#include "netlink-util.h"
-#include "networkd-manager.h"
-#include "string-table.h"
-
+#include "in-addr-util.h"
+#include "networkd-link.h"
+#include "ordered-set.h"
+#include "set.h"
+#include "string-util.h"
+#include "time-util.h"
/*
* Number of seconds between instances where the bonding
* driver sends learning packets to each slaves peer switch
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <linux/if_bonding.h>
-#include <netinet/in.h>
-
#include "bond-util.h"
-#include "macro.h"
+#include "forward.h"
#include "netdev.h"
-#include "ordered-set.h"
typedef struct Bond {
NetDev meta;
#include <linux/if_arp.h>
#include <linux/if_bridge.h>
-#include <net/if.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "bridge.h"
+#include "conf-parser.h"
#include "netlink-util.h"
#include "networkd-manager.h"
#include "string-table.h"
+#include "string-util.h"
#include "vlan-util.h"
assert_cc((int) MULTICAST_ROUTER_NONE == (int) MDB_RTR_TYPE_DISABLED);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "netdev.h"
#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128U
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "forward.h"
#include "netdev.h"
typedef struct Dummy {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/fou.h>
-#include <linux/ip.h>
-#include <net/if.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "conf-parser.h"
#include "fou-tunnel.h"
-#include "ip-protocol-list.h"
#include "netlink-util.h"
#include "networkd-manager.h"
-#include "parse-util.h"
#include "string-table.h"
#include "string-util.h"
#pragma once
#include <linux/fou.h>
-#include <netinet/in.h>
#include "in-addr-util.h"
+#include "forward.h"
#include "netdev.h"
typedef enum FooOverUDPEncapType {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_arp.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include "alloc-util.h"
+#include "sd-netlink.h"
+
#include "conf-parser.h"
-#include "extract-word.h"
#include "geneve.h"
-#include "netlink-util.h"
-#include "networkd-manager.h"
#include "parse-util.h"
#include "string-table.h"
#include "string-util.h"
-#include "strv.h"
#define GENEVE_FLOW_LABEL_MAX_MASK 0xFFFFFU
#define DEFAULT_GENEVE_DESTINATION_PORT 6081
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Geneve Geneve;
+#include <linux/if_link.h>
+#include "forward.h"
#include "in-addr-util.h"
#include "netdev.h"
-#include "networkd-network.h"
#define GENEVE_VID_MAX (1u << 24) - 1
_NETDEV_GENEVE_DF_INVALID = -EINVAL,
} GeneveDF;
-struct Geneve {
+typedef struct Geneve {
NetDev meta;
uint32_t id;
union in_addr_union remote;
bool inherit_inner_protocol;
-};
+} Geneve;
DEFINE_NETDEV_CAST(GENEVE, Geneve);
extern const NetDevVTable geneve_vtable;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_arp.h>
-#include <net/if.h>
-#include <netinet/in.h>
+#include "sd-netlink.h"
+
+#include "conf-parser.h"
#include "hsr.h"
-#include "netlink-util.h"
-#include "networkd-manager.h"
+#include "networkd-link.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Hsr Hsr;
-
#include <linux/if_link.h>
#include "netdev.h"
_NETDEV_HSR_PROTOCOL_INVALID = -EINVAL,
} HsrProtocol;
-struct Hsr {
+typedef struct Hsr {
NetDev meta;
char **ports;
HsrProtocol protocol;
uint8_t supervision;
-};
+} Hsr;
DEFINE_NETDEV_CAST(HSR, Hsr);
extern const NetDevVTable hsr_vtable;
#include <linux/if_arp.h>
#include <linux/if_link.h>
+#include "sd-netlink.h"
+
+#include "conf-parser.h"
#include "ipoib.h"
#include "networkd-network.h"
#include "parse-util.h"
#include "string-table.h"
+#include "string-util.h"
assert_cc((int) IP_OVER_INFINIBAND_MODE_DATAGRAM == (int) IPOIB_MODE_DATAGRAM);
assert_cc((int) IP_OVER_INFINIBAND_MODE_CONNECTED == (int) IPOIB_MODE_CONNECTED);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <errno.h>
-
-#include "conf-parser.h"
#include "netdev.h"
typedef enum IPoIBMode {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_arp.h>
-#include <net/if.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "conf-parser.h"
#include "ipvlan.h"
#include "ipvlan-util.h"
#include "networkd-link.h"
-#include "string-util.h"
DEFINE_CONFIG_PARSE_ENUM(config_parse_ipvlan_mode, ipvlan_mode, IPVlanMode);
DEFINE_CONFIG_PARSE_ENUM(config_parse_ipvlan_flags, ipvlan_flags, IPVlanFlags);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <linux/if_link.h>
-#include <netinet/in.h>
#include "ipvlan-util.h"
#include "netdev.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/genetlink.h>
#include <linux/if_arp.h>
#include <linux/l2tp.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "alloc-util.h"
#include "conf-parser.h"
+#include "extract-word.h"
#include "hashmap.h"
#include "l2tp-tunnel.h"
#include "netlink-util.h"
#include "networkd-address.h"
#include "networkd-manager.h"
#include "networkd-route-util.h"
-#include "parse-util.h"
+#include "set.h"
#include "socket-util.h"
#include "string-table.h"
#include "string-util.h"
#pragma once
#include <linux/l2tp.h>
-#include <netinet/in.h>
#include "in-addr-util.h"
+#include "forward.h"
#include "netdev.h"
-#include "networkd-util.h"
typedef enum L2tpL2specType {
NETDEV_L2TP_L2SPECTYPE_NONE = L2TP_L2SPECTYPE_NONE,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/genetlink.h>
#include <linux/if_arp.h>
-#include <linux/if_ether.h>
#include <linux/if_macsec.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "alloc-util.h"
#include "conf-parser.h"
#include "networkd-manager.h"
#include "parse-helpers.h"
#include "parse-util.h"
-#include "socket-util.h"
-#include "string-table.h"
#include "string-util.h"
#include "unaligned.h"
#pragma once
#include <linux/if_macsec.h>
-#include <netinet/in.h>
+#include <net/ethernet.h>
-#include "ether-addr-util.h"
-#include "in-addr-util.h"
+#include "forward.h"
#include "netdev.h"
-#include "networkd-util.h"
#include "sparse-endian.h"
/* See the definition of MACSEC_NUM_AN in kernel's drivers/net/macsec.c */
unsigned n_rxsa;
} ReceiveChannel;
-struct MACsec {
+typedef struct MACsec {
NetDev meta;
uint16_t port;
OrderedHashmap *receive_channels_by_section;
OrderedHashmap *transmit_associations_by_section;
OrderedHashmap *receive_associations_by_section;
-};
+} MACsec;
DEFINE_NETDEV_CAST(MACSEC, MACsec);
extern const NetDevVTable macsec_vtable;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_arp.h>
-#include <net/if.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "conf-parser.h"
#include "macvlan.h"
#include "macvlan-util.h"
#include "networkd-network.h"
#include "parse-util.h"
+#include "set.h"
+#include "string-util.h"
typedef enum BCQueueThreshold {
BC_QUEUE_THRESHOLD_UNDEF = INT32_MIN,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct MacVlan MacVlan;
-
#include "macvlan-util.h"
#include "netdev.h"
-#include "set.h"
-struct MacVlan {
+typedef struct MacVlan {
NetDev meta;
MacVlanMode mode;
uint32_t bc_queue_length;
int32_t bc_queue_threshold;
-};
+} MacVlan;
DEFINE_NETDEV_CAST(MACVLAN, MacVlan);
DEFINE_NETDEV_CAST(MACVTAP, MacVlan);
#include "batadv.h"
#include "bond.h"
#include "bridge.h"
+#include "condition.h"
#include "conf-parser.h"
#include "fou-tunnel.h"
#include "geneve.h"
#include "netdev-util.h"
#include "networkd-address.h"
#include "networkd-link.h"
+#include "set.h"
#include "string-table.h"
static const char * const netdev_local_address_type_table[_NETDEV_LOCAL_ADDRESS_TYPE_MAX] = {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <errno.h>
-
-#include "in-addr-util.h"
-#include "macro.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
typedef enum NetDevLocalAddressType {
NETDEV_LOCAL_ADDRESS_IPV4LL,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_arp.h>
-#include <net/if.h>
-#include <netinet/in.h>
#include <unistd.h>
+#include "sd-netlink.h"
+
#include "alloc-util.h"
#include "arphrd-util.h"
#include "bareudp.h"
#include "batadv.h"
#include "bond.h"
#include "bridge.h"
+#include "condition.h"
#include "conf-files.h"
#include "conf-parser.h"
#include "dummy.h"
-#include "fd-util.h"
#include "fou-tunnel.h"
#include "geneve.h"
+#include "hashmap.h"
#include "hsr.h"
#include "ifb.h"
#include "ipoib.h"
#include "ipvlan.h"
#include "l2tp-tunnel.h"
-#include "list.h"
#include "macsec.h"
#include "macvlan.h"
#include "netdev.h"
#include "network-util.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
-#include "networkd-setlink.h"
#include "networkd-sriov.h"
#include "networkd-state-file.h"
#include "nlmon.h"
-#include "path-lookup.h"
-#include "siphash24.h"
#include "stat-util.h"
#include "string-table.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
#include "ether-addr-util.h"
-#include "hash-funcs.h"
#include "list.h"
#include "log-link.h"
#include "netdev-util.h"
-#include "time-util.h"
+#include "networkd-forward.h"
/* Special hardware address value to suppress generating persistent hardware address for the netdev. */
#define HW_ADDR_NONE ((struct hw_addr_data) { .length = 1, })
_NETDEV_CREATE_INVALID = -EINVAL,
} NetDevCreateType;
-typedef struct Manager Manager;
-typedef struct Condition Condition;
-
typedef struct NetDev {
Manager *manager;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct NLMon NLMon;
-
#include "netdev.h"
-struct NLMon {
+typedef struct NLMon {
NetDev meta;
-};
+} NLMon;
DEFINE_NETDEV_CAST(NLMON, NLMon);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/fou.h>
#include <linux/if_arp.h>
#include <linux/if_tunnel.h>
-#include <linux/ip.h>
#include <linux/ip6_tunnel.h>
#include <netinet/in.h>
-#include "af-list.h"
+#include "sd-netlink.h"
+
#include "alloc-util.h"
#include "conf-parser.h"
#include "hexdecoct.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "fou-tunnel.h"
-#include "in-addr-util.h"
#include "netdev.h"
-#include "netdev-util.h"
#include "networkd-link.h"
typedef enum Ip6TnlMode {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <fcntl.h>
#include <linux/if_tun.h>
#include <net/if.h>
-#include <netinet/if_ether.h>
+#include <net/if_arp.h>
#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include "alloc-util.h"
#include "daemon-util.h"
#include "fd-util.h"
-#include "networkd-link.h"
+#include "hashmap.h"
#include "networkd-manager.h"
#include "socket-util.h"
+#include "string-util.h"
#include "tuntap.h"
+#include "user-record.h"
+#include "user-util.h"
#include "userdb.h"
#define TUN_DEV "/dev/net/tun"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "forward.h"
#include "netdev.h"
-#include "user-util.h"
typedef struct TunTap {
NetDev meta;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct VCan VCan;
-
-#include <linux/can/netlink.h>
-#include <netinet/in.h>
-
#include "netdev.h"
-struct VCan {
+typedef struct VCan {
NetDev meta;
-};
+} VCan;
DEFINE_NETDEV_CAST(VCAN, VCan);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <linux/if_arp.h>
#include <linux/veth.h>
-#include <net/if.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "netlink-util.h"
+#include "string-util.h"
#include "veth.h"
static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Veth Veth;
-
#include "netdev.h"
-struct Veth {
+typedef struct Veth {
NetDev meta;
char *ifname_peer;
struct hw_addr_data hw_addr_peer;
int ifindex_peer;
-};
+} Veth;
DEFINE_NETDEV_CAST(VETH, Veth);
extern const NetDevVTable veth_vtable;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <linux/if_arp.h>
#include <linux/if_vlan.h>
-#include <net/if.h>
+
+#include "sd-netlink.h"
#include "alloc-util.h"
+#include "extract-word.h"
#include "parse-util.h"
+#include "set.h"
+#include "siphash24.h"
+#include "string-util.h"
#include "vlan.h"
#include "vlan-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct VLan VLan;
-
+#include "forward.h"
#include "netdev.h"
-#include "set.h"
-struct VLan {
+typedef struct VLan {
NetDev meta;
uint16_t id;
Set *egress_qos_maps;
Set *ingress_qos_maps;
-};
+} VLan;
DEFINE_NETDEV_CAST(VLAN, VLan);
extern const NetDevVTable vlan_vtable;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_arp.h>
-#include <net/if.h>
-#include <netinet/in.h>
+
+#include "sd-netlink.h"
#include "vrf.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Vrf Vrf;
-
#include "netdev.h"
-struct Vrf {
+typedef struct Vrf {
NetDev meta;
uint32_t table;
-};
+} Vrf;
DEFINE_NETDEV_CAST(VRF, Vrf);
extern const NetDevVTable vrf_vtable;
#include <linux/can/vxcan.h>
#include <linux/if_arp.h>
+#include "sd-netlink.h"
+
+#include "string-util.h"
#include "vxcan.h"
static int netdev_vxcan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct VxCan VxCan;
-
#include "netdev.h"
-struct VxCan {
+typedef struct VxCan {
NetDev meta;
char *ifname_peer;
int ifindex_peer;
-};
+} VxCan;
DEFINE_NETDEV_CAST(VXCAN, VxCan);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_arp.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include "alloc-util.h"
+#include "sd-netlink.h"
+
#include "conf-parser.h"
-#include "extract-word.h"
+#include "in-addr-util.h"
#include "networkd-link.h"
#include "parse-util.h"
#include "string-table.h"
#include "string-util.h"
-#include "strv.h"
+#include "time-util.h"
#include "vxlan.h"
static const char* const df_table[_NETDEV_VXLAN_DF_MAX] = {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct VxLan VxLan;
-
#include <linux/if_link.h>
#include "in-addr-util.h"
#include "netdev.h"
-#include "netdev-util.h"
#define VXLAN_VID_MAX (1u << 24) - 1
#define VXLAN_FLOW_LABEL_MAX_MASK 0xFFFFFU
_NETDEV_VXLAN_DF_INVALID = -EINVAL,
} VxLanDF;
-struct VxLan {
+typedef struct VxLan {
NetDev meta;
uint32_t vni;
bool vnifilter;
struct ifla_vxlan_port_range port_range;
-};
+} VxLan;
DEFINE_NETDEV_CAST(VXLAN, VxLan);
extern const NetDevVTable vxlan_vtable;
***/
#include <linux/if_arp.h>
-#include <linux/ipv6_route.h>
-#include <net/if.h>
+#include <netdb.h>
#include <netinet/in.h>
-#include <sys/ioctl.h>
+#include "sd-netlink.h"
#include "sd-resolve.h"
#include "alloc-util.h"
+#include "conf-parser.h"
#include "creds-util.h"
#include "dns-domain.h"
#include "event-util.h"
-#include "fd-util.h"
+#include "extract-word.h"
#include "fileio.h"
+#include "hashmap.h"
#include "hexdecoct.h"
#include "memory-util.h"
#include "netlink-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "random-util.h"
-#include "resolve-private.h"
+#include "set.h"
#include "string-util.h"
-#include "strv.h"
#include "wireguard.h"
static void wireguard_resolve_endpoints(NetDev *netdev);
#pragma once
-typedef struct Wireguard Wireguard;
-
#include <linux/wireguard.h>
-#include <netinet/in.h>
-
-#include "sd-event.h"
-#include "sd-resolve.h"
#include "in-addr-util.h"
+#include "list.h"
#include "netdev.h"
+#include "networkd-forward.h"
#include "socket-util.h"
typedef struct WireguardIPmask {
LIST_FIELDS(struct WireguardPeer, peers);
} WireguardPeer;
-struct Wireguard {
+typedef struct Wireguard {
NetDev meta;
unsigned last_peer_section;
Set *routes;
uint32_t route_table;
uint32_t route_priority;
-};
+} Wireguard;
DEFINE_NETDEV_CAST(WIREGUARD, Wireguard);
extern const NetDevVTable wireguard_vtable;
#include "networkd-manager.h"
#include "networkd-wiphy.h"
#include "parse-util.h"
+#include "string-util.h"
#include "wifi-util.h"
#include "wlan.h"
#include <linux/nl80211.h>
-#include "conf-parser.h"
+#include "forward.h"
#include "netdev.h"
typedef struct WLan {
#include <linux/if_arp.h>
+#include "sd-netlink.h"
+
#include "missing_network.h"
#include "networkd-link.h"
#include "xfrm.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "forward.h"
#include "netdev.h"
typedef struct Xfrm {
#include <unistd.h>
+#include "sd-bus.h"
#include "sd-daemon.h"
#include "sd-device.h"
#include "sd-netlink.h"
#include "bus-wait-for-jobs.h"
#include "conf-files.h"
#include "edit-util.h"
+#include "errno-util.h"
#include "extract-word.h"
#include "log.h"
#include "mkdir-label.h"
#include "networkctl-config-file.h"
#include "networkctl-util.h"
#include "pager.h"
-#include "path-lookup.h"
#include "path-util.h"
#include "pretty-print.h"
#include "selinux-util.h"
+#include "socket-util.h"
#include "stat-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "strv.h"
+#include "terminal-util.h"
#include "virt.h"
typedef enum ReloadFlags {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
#include "bus-error.h"
#include "bus-locator.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-dhcp-lease.h"
+#include "sd-hwdb.h"
+#include "sd-netlink.h"
+
#include "alloc-util.h"
+#include "ether-addr-util.h"
#include "format-ifname.h"
+#include "format-table.h"
#include "in-addr-util.h"
#include "local-addresses.h"
#include "log.h"
#include "networkctl-dump-util.h"
#include "stdio-util.h"
+#include "string-util.h"
#include "strv.h"
int dump_list(Table *table, const char *key, char * const *l) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-dhcp-lease.h"
-#include "sd-hwdb.h"
-#include "sd-netlink.h"
-
-#include "ether-addr-util.h"
-#include "format-table.h"
+#include "forward.h"
int dump_list(Table *table, const char *key, char * const *l);
int ieee_oui(sd_hwdb *hwdb, const struct ether_addr *mac, char **ret);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-journal.h"
+
#include "ansi-color.h"
#include "journal-internal.h"
#include "log.h"
#include <linux/if_tunnel.h>
+#include "sd-bus.h"
+#include "sd-netlink.h"
+
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-error.h"
#include "networkctl-link-info.h"
#include "networkctl-util.h"
#include "sort-util.h"
+#include "stdio-util.h"
+#include "string-util.h"
#include "strv.h"
#include "strxcpyx.h"
#include "wifi-util.h"
#include <linux/if.h>
#include <linux/if_link.h>
#include <linux/nl80211.h>
-#include <stdint.h>
-
-#include "sd-bus.h"
-#include "sd-device.h"
-#include "sd-netlink.h"
#include "ether-addr-util.h"
#include "ethtool-util.h"
+#include "forward.h"
#include "in-addr-util.h"
typedef struct VxLanInfo {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+#include "sd-netlink.h"
#include "sd-network.h"
#include "alloc-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
+#include "format-table.h"
#include "json-util.h"
#include "log.h"
#include "networkctl.h"
#include "networkctl-lldp.h"
#include "networkctl-util.h"
#include "stdio-util.h"
+#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "varlink-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-varlink.h"
-
-#include "format-table.h"
+#include "forward.h"
int dump_lldp_neighbors(sd_varlink *vl, Table *table, int ifindex);
int link_lldp_status(int argc, char *argv[], void *userdata);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <net/if.h>
+#include "sd-bus.h"
+#include "sd-netlink.h"
#include "bus-error.h"
#include "bus-locator.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "format-ifname.h"
#include "log.h"
#include "parse-util.h"
#include "polkit-agent.h"
#include "set.h"
-#include "strv.h"
+#include "string-util.h"
#include "varlink-util.h"
static int link_up_down_send_message(sd_netlink *rtnl, char *command, int index) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <net/if.h>
-
+#include "sd-bus.h"
+#include "sd-device.h"
+#include "sd-dhcp-client-id.h"
+#include "sd-dhcp-lease.h"
+#include "sd-hwdb.h"
+#include "sd-netlink.h"
#include "sd-network.h"
+#include "sd-varlink.h"
#include "alloc-util.h"
#include "bond-util.h"
#include "bridge-util.h"
#include "bus-error.h"
#include "bus-util.h"
+#include "errno-util.h"
#include "escape.h"
#include "extract-word.h"
+#include "format-table.h"
#include "format-util.h"
#include "geneve-util.h"
#include "glyph-util.h"
#include "networkctl-status-system.h"
#include "networkctl-util.h"
#include "stdio-util.h"
+#include "string-util.h"
#include "strv.h"
+#include "time-util.h"
#include "udev-util.h"
static int dump_dhcp_leases(Table *table, const char *prefix, sd_bus *bus, const LinkInfo *link) {
#include "sd-network.h"
#include "alloc-util.h"
+#include "format-table.h"
#include "fs-util.h"
#include "glyph-util.h"
#include "log.h"
#include "networkctl-status-system.h"
#include "networkctl-util.h"
#include "sort-util.h"
+#include "string-util.h"
#include "strv.h"
static int ifindex_str_compare_func(char * const *a, char * const *b) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-hwdb.h"
-#include "sd-netlink.h"
+#include "forward.h"
int system_status(sd_netlink *rtnl, sd_hwdb *hwdb);
#include <sys/stat.h>
#include <unistd.h>
+#include "sd-bus.h"
+
#include "alloc-util.h"
#include "ansi-color.h"
#include "log.h"
#include "networkctl.h"
#include "networkctl-util.h"
#include "stdio-util.h"
+#include "string-util.h"
#include "strv.h"
#include "varlink-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "sd-bus.h"
-#include "sd-varlink.h"
+#include "forward.h"
int varlink_connect_networkd(sd_varlink **ret_varlink);
bool networkd_is_running(void);
#include "networkctl-lldp.h"
#include "networkctl-misc.h"
#include "networkctl-status-link.h"
-#include "networkctl-util.h"
#include "parse-argument.h"
#include "parse-util.h"
#include "path-util.h"
#include "pretty-print.h"
+#include "string-util.h"
#include "verbs.h"
PagerFlags arg_pager_flags = 0;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "output-mode.h"
+#include "forward.h"
#include "pager.h"
extern PagerFlags arg_pager_flags;
#include "alloc-util.h"
#include "arphrd-util.h"
+#include "hash-funcs.h"
#include "id128-util.h"
-#include "memory-util.h"
#include "networkd-address-generation.h"
+#include "networkd-address.h"
#include "networkd-link.h"
#include "networkd-network.h"
+#include "set.h"
+#include "siphash24.h"
#include "string-util.h"
#define DAD_CONFLICTS_IDGEN_RETRIES_RFC7217 3
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-#include "hashmap.h"
-#include "in-addr-util.h"
-
-typedef struct Address Address;
-typedef struct IPv6Token IPv6Token;
-typedef struct Link Link;
+#include "networkd-forward.h"
IPv6Token* ipv6_token_ref(IPv6Token *token);
IPv6Token* ipv6_token_unref(IPv6Token *token);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <linux/if_addr.h>
#include <linux/if_addrlabel.h>
-#include <net/if.h>
+
+#include "sd-netlink.h"
#include "alloc-util.h"
-#include "netlink-util.h"
+#include "conf-parser.h"
+#include "hashmap.h"
#include "networkd-address-label.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd-queue.h"
#include "parse-util.h"
+#include "string-util.h"
AddressLabel *address_label_free(AddressLabel *label) {
if (!label)
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
+#include <netinet/in.h>
-#include "conf-parser.h"
-#include "in-addr-util.h"
-#include "networkd-util.h"
-
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Network Network;
+#include "networkd-forward.h"
typedef struct AddressLabel {
Manager *manager;
#include "networkd-address-pool.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
-#include "string-util.h"
+#include "ordered-set.h"
+#include "set.h"
#define RANDOM_PREFIX_TRIAL_MAX 1024
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "networkd-forward.h"
#include "in-addr-util.h"
-typedef struct Manager Manager;
-
typedef struct AddressPool {
Manager *manager;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if.h>
-#include <net/if_arp.h>
+#include <stdio.h>
+
+#include "sd-event.h"
+#include "sd-netlink.h"
#include "af-list.h"
#include "alloc-util.h"
#include "bitfield.h"
+#include "conf-parser.h"
+#include "errno-util.h"
#include "firewall-util.h"
#include "in-addr-prefix-util.h"
#include "logarithm.h"
-#include "memory-util.h"
#include "netlink-util.h"
+#include "networkd-address-generation.h"
#include "networkd-address.h"
#include "networkd-address-pool.h"
#include "networkd-dhcp-prefix-delegation.h"
#include "networkd-queue.h"
#include "networkd-route.h"
#include "networkd-route-util.h"
+#include "ordered-set.h"
#include "parse-util.h"
+#include "set.h"
+#include "siphash24.h"
+#include "socket-util.h"
#include "string-util.h"
#include "strv.h"
-#include "strxcpyx.h"
#define ADDRESSES_PER_LINK_MAX 16384U
#define STATIC_ADDRESSES_PER_NETWORK_MAX 8192U
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stdio.h>
-
-#include "conf-parser.h"
#include "firewall-util.h"
-#include "hash-funcs.h"
+#include "forward.h"
#include "in-addr-util.h"
-#include "network-util.h"
-#include "networkd-address-generation.h"
-#include "networkd-link.h"
+#include "networkd-forward.h"
#include "networkd-util.h"
-#include "time-util.h"
-typedef struct Address Address;
-typedef struct Manager Manager;
-typedef struct Network Network;
-typedef struct Request Request;
typedef int (*address_ready_callback_t)(Address *address);
typedef int (*address_netlink_handler_t)(
sd_netlink *rtnl,
Link *link,
Address *address);
-struct Address {
+typedef struct Address {
Link *link;
Network *network;
ConfigSection *section;
address_ready_callback_t callback;
NFTSetContext nft_set_context;
-};
+} Address;
void log_address_debug(const Address *address, const char *str, const Link *link);
Copyright © 2014 Intel Corporation. All rights reserved.
***/
-#include <net/ethernet.h>
-#include <net/if.h>
+#include "sd-netlink.h"
#include "alloc-util.h"
-#include "bridge.h"
+#include "conf-parser.h"
+#include "hashmap.h"
#include "netlink-util.h"
#include "networkd-bridge-fdb.h"
#include "networkd-link.h"
#include "networkd-queue.h"
#include "networkd-util.h"
#include "parse-util.h"
+#include "socket-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "vlan-util.h"
#include "vxlan.h"
Copyright © 2014 Intel Corporation. All rights reserved.
***/
-#include <inttypes.h>
#include <linux/neighbour.h>
+#include <net/ethernet.h>
-#include "conf-parser.h"
-#include "ether-addr-util.h"
+#include "forward.h"
#include "in-addr-util.h"
-
-typedef struct Link Link;
-typedef struct Network Network;
+#include "networkd-forward.h"
typedef enum NeighborCacheEntryFlags {
NEIGHBOR_CACHE_ENTRY_FLAGS_USE = NTF_USE,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_bridge.h>
-#include <net/if.h>
-#include "netlink-util.h"
+#include "sd-netlink.h"
+
+#include "conf-parser.h"
+#include "hashmap.h"
#include "networkd-bridge-mdb.h"
#include "networkd-link.h"
#include "networkd-manager.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
#include <net/ethernet.h>
-#include "conf-parser.h"
#include "in-addr-util.h"
-
-typedef struct Link Link;
-typedef struct Network Network;
+#include "networkd-forward.h"
typedef enum BridgeMDBEntryType {
BRIDGE_MDB_ENTRY_TYPE_L2,
***/
#include <linux/if_bridge.h>
-#include <netinet/in.h>
-#include <stdbool.h>
+
+#include "sd-netlink.h"
#include "alloc-util.h"
-#include "conf-parser.h"
#include "netlink-util.h"
#include "networkd-bridge-vlan.h"
#include "networkd-link.h"
-#include "networkd-manager.h"
#include "networkd-network.h"
#include "parse-util.h"
+#include "string-util.h"
#include "vlan-util.h"
static bool is_bit_set(unsigned nr, const uint32_t *addr) {
Copyright © 2016 BISDN GmbH. All rights reserved.
***/
-#include <inttypes.h>
-#include <stdbool.h>
-
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
+#include "networkd-forward.h"
#include "vlan-util.h"
#define BRIDGE_VLAN_BITMAP_MAX 4096
#define BRIDGE_VLAN_REMOVE_PVID (UINT16_MAX - 1)
assert_cc(BRIDGE_VLAN_REMOVE_PVID > VLANID_MAX);
-typedef struct Link Link;
-typedef struct Network Network;
-
void network_adjust_bridge_vlan(Network *network);
int bridge_vlan_set_message(Link *link, sd_netlink_message *m, bool is_set);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/can/netlink.h>
-#include <net/if.h>
+
+#include "sd-netlink.h"
#include "networkd-can.h"
#include "networkd-link.h"
#include "networkd-network.h"
-#include "networkd-setlink.h"
#include "parse-util.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <linux/can/netlink.h>
-
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
int can_set_netlink_message(Link *link, sd_netlink_message *m);
***/
#include "conf-parser.h"
-#include "constants.h"
#include "networkd-address-label.h"
#include "networkd-conf.h"
#include "networkd-manager.h"
Copyright © 2014 Vinay Kulkarni <kulkarniv@vmware.com>
***/
-#include "conf-parser.h"
-
-typedef struct Manager Manager;
+#include "networkd-forward.h"
int manager_parse_config_file(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if_arp.h>
+#include <linux/rtnetlink.h>
#include <netinet/in.h>
+#include "sd-bus.h"
+#include "sd-dhcp6-lease.h"
+#include "sd-dhcp6-option.h"
+
#include "alloc-util.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "dhcp-option.h"
-#include "dhcp6-internal.h"
+#include "dhcp6-option.h"
#include "escape.h"
+#include "extract-word.h"
#include "hexdecoct.h"
#include "in-addr-prefix-util.h"
#include "networkd-dhcp-common.h"
#include "networkd-network.h"
#include "networkd-route-util.h"
#include "parse-util.h"
+#include "set.h"
#include "socket-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "strv.h"
#include "vrf.h"
#include <netinet/in.h>
-#include "conf-parser.h"
#include "dhcp-duid-internal.h"
-#include "dns-resolver-internal.h"
#include "in-addr-util.h"
-#include "set.h"
-#include "time-util.h"
+#include "networkd-forward.h"
/* Special values for *_uplink_index. */
#define UPLINK_INDEX_AUTO 0 /* uplink will be selected automatically */
#define IPV6RA_ROUTE_METRIC_LOW 2048
#define DHCP6PD_ROUTE_METRIC 256
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Network Network;
-
typedef enum DHCPOptionDataType {
DHCP_OPTION_DATA_UINT8,
DHCP_OPTION_DATA_UINT16,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/ipv6_route.h>
+#include <linux/rtnetlink.h>
+
+#include "sd-dhcp-client.h"
+#include "sd-dhcp6-client.h"
+#include "sd-netlink.h"
+#include "sd-radv.h"
#include "dhcp6-lease-internal.h"
+#include "errno-util.h"
#include "hashmap.h"
#include "in-addr-prefix-util.h"
#include "networkd-address.h"
#include "networkd-route-util.h"
#include "networkd-setlink.h"
#include "parse-util.h"
+#include "set.h"
#include "string-util.h"
#include "strv.h"
#include "tunnel.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "sd-dhcp-lease.h"
-#include "sd-dhcp6-lease.h"
-
-#include "conf-parser.h"
-
-typedef struct Address Address;
-typedef struct Link Link;
-typedef struct Network Network;
+#include "networkd-forward.h"
bool link_dhcp_pd_is_enabled(Link *link);
bool dhcp_pd_is_uplink(Link *link, Link *target, bool accept_auto);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-util.h"
+#include "bus-object.h"
#include "dhcp-server-lease-internal.h"
+#include "hashmap.h"
#include "networkd-dhcp-server-bus.h"
#include "networkd-link-bus.h"
#include "networkd-manager.h"
-#include "strv.h"
static int property_get_leases(
sd_bus *bus,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-#include "sd-dhcp-server.h"
-
-#include "bus-object.h"
+#include "networkd-forward.h"
extern const BusObjectImplementation dhcp_server_object;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
+#include "conf-parser.h"
#include "ether-addr-util.h"
#include "hashmap.h"
#include "networkd-dhcp-server-static-lease.h"
#include "networkd-network.h"
-#include "networkd-util.h"
+#include "string-util.h"
static DHCPStaticLease* dhcp_static_lease_free(DHCPStaticLease *static_lease) {
if (!static_lease)
#pragma once
-#include <inttypes.h>
+#include <netinet/in.h>
-#include "conf-parser.h"
-#include "in-addr-util.h"
-
-typedef struct Network Network;
-typedef struct ConfigSection ConfigSection;
+#include "networkd-forward.h"
typedef struct DHCPStaticLease {
Network *network;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
#include <linux/if_arp.h>
#include <netinet/in.h>
#include "sd-dhcp-server.h"
+#include "conf-parser.h"
#include "dhcp-protocol.h"
#include "dhcp-server-lease-internal.h"
+#include "errno-util.h"
+#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
+#include "hashmap.h"
#include "network-common.h"
#include "networkd-address.h"
#include "networkd-dhcp-server.h"
#include "networkd-ntp.h"
#include "networkd-queue.h"
#include "networkd-route-util.h"
-#include "parse-util.h"
#include "path-util.h"
+#include "set.h"
#include "socket-netlink.h"
-#include "string-table.h"
#include "string-util.h"
#include "strv.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-#include "in-addr-util.h"
-#include "set.h"
-
-typedef struct Address Address;
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Network Network;
+#include "networkd-forward.h"
int network_adjust_dhcp_server(Network *network, Set **addresses);
int address_acquire_from_dhcp_server_leases_file(Link *link, const Address *address, union in_addr_union *ret);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
#include "sd-dhcp-client.h"
#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-util.h"
+#include "bus-object.h"
#include "dhcp-client-internal.h"
#include "networkd-dhcp4-bus.h"
#include "networkd-link-bus.h"
#include "networkd-manager.h"
-#include "string-table.h"
-#include "strv.h"
static int property_get_dhcp_client_state(
sd_bus *bus,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-dhcp-client.h"
-
-#include "networkd-link-bus.h"
+#include "networkd-forward.h"
extern const BusObjectImplementation dhcp_client_object;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
#include <linux/if_arp.h>
+#include <linux/rtnetlink.h>
#include <netinet/in.h>
#include <netinet/ip.h>
+#include <stdio.h>
+
+#include "sd-dhcp-protocol.h"
+#include "sd-ipv4ll.h"
#include "alloc-util.h"
+#include "conf-parser.h"
#include "device-private.h"
#include "dhcp-client-internal.h"
+#include "errno-util.h"
#include "hostname-setup.h"
-#include "hostname-util.h"
-#include "network-internal.h"
#include "networkd-address.h"
#include "networkd-dhcp-prefix-delegation.h"
#include "networkd-dhcp4.h"
#include "networkd-setlink.h"
#include "networkd-state-file.h"
#include "parse-util.h"
+#include "set.h"
+#include "socket-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "strv.h"
-#include "sysctl-util.h"
void network_adjust_dhcp4(Network *network) {
assert(network);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-
-typedef struct Link Link;
-typedef struct Network Network;
+#include "networkd-forward.h"
typedef enum DHCPClientIdentifier {
DHCP_CLIENT_ID_MAC,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-util.h"
+#include "bus-object.h"
#include "dhcp6-client-internal.h"
#include "dhcp6-protocol.h"
#include "networkd-dhcp6-bus.h"
#include "networkd-link-bus.h"
#include "networkd-manager.h"
-#include "string-table.h"
-#include "strv.h"
static int property_get_dhcp6_client_state(
sd_bus *bus,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-dhcp6-client.h"
-
-#include "networkd-link-bus.h"
+#include "networkd-forward.h"
extern const BusObjectImplementation dhcp6_client_object;
Copyright © 2014 Intel Corporation. All rights reserved.
***/
+#include <linux/if_addr.h>
+#include <stdio.h>
+
+#include "sd-dhcp6-protocol.h"
+
+#include "conf-parser.h"
#include "dhcp6-client-internal.h"
#include "dhcp6-lease-internal.h"
+#include "errno-util.h"
#include "hashmap.h"
#include "hostname-setup.h"
-#include "hostname-util.h"
#include "networkd-address.h"
#include "networkd-dhcp-prefix-delegation.h"
#include "networkd-dhcp6.h"
#include "networkd-queue.h"
#include "networkd-route.h"
#include "networkd-state-file.h"
+#include "set.h"
#include "string-table.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-#include "macro.h"
+#include "networkd-forward.h"
typedef enum DHCP6ClientStartMode {
DHCP6_CLIENT_START_MODE_NO,
_DHCP6_CLIENT_START_MODE_INVALID = -EINVAL,
} DHCP6ClientStartMode;
-typedef struct Link Link;
-typedef struct Network Network;
-
bool link_dhcp6_with_address_enabled(Link *link);
int dhcp6_check_ready(Link *link);
int dhcp6_update_mac(Link *link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
+#include "conf-parser.h"
#include "dns-domain.h"
+#include "extract-word.h"
#include "hostname-util.h"
#include "networkd-dns.h"
#include "networkd-manager.h"
#include "networkd-network.h"
-#include "parse-util.h"
+#include "ordered-set.h"
+#include "set.h"
#include "string-table.h"
+#include "string-util.h"
UseDomains link_get_use_domains(Link *link, NetworkConfigSource proto) {
UseDomains n, c, m;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-#include "macro.h"
+#include "networkd-forward.h"
#include "networkd-util.h"
-typedef struct Link Link;
-
typedef enum UseDomains {
USE_DOMAINS_NO,
USE_DOMAINS_YES,
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "conf-parser-forward.h" /* IWYU pragma: export */
+#include "forward.h" /* IWYU pragma: export */
+
+typedef enum NetDevLocalAddressType NetDevLocalAddressType;
+typedef enum NetworkConfigSource NetworkConfigSource;
+
+typedef struct Address Address;
+typedef struct IPv6Token IPv6Token;
+typedef struct Link Link;
+typedef struct Manager Manager;
+typedef struct NetDev NetDev;
+typedef struct Network Network;
+typedef struct NextHop NextHop;
+typedef struct Request Request;
+typedef struct Route Route;
+typedef struct Wireguard Wireguard;
#include "sd-dhcp-client.h"
#include "sd-ipv4acd.h"
+#include "hashmap.h"
#include "ipvlan.h"
#include "networkd-address.h"
#include "networkd-dhcp4.h"
#include "networkd-ipv4acd.h"
#include "networkd-link.h"
#include "networkd-manager.h"
+#include "string-util.h"
DEFINE_PRIVATE_HASH_OPS_FULL(
ipv4acd_hash_ops,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-typedef struct Address Address;
-typedef struct Link Link;
+#include "networkd-forward.h"
bool link_ipv4acd_supported(Link *link);
bool link_ipv4acd_enabled(Link *link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
+#include <linux/rtnetlink.h>
#include <netinet/in.h>
+#include "sd-event.h"
+#include "sd-ipv4ll.h"
+
+#include "errno-util.h"
#include "netif-util.h"
#include "networkd-address.h"
#include "networkd-ipv4acd.h"
#include "networkd-ipv4ll.h"
#include "networkd-link.h"
#include "networkd-manager.h"
-#include "networkd-queue.h"
#include "parse-util.h"
+#include "set.h"
+#include "string-util.h"
bool link_ipv4ll_enabled(Link *link) {
assert(link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
+#include "networkd-forward.h"
#define IPV4LL_ROUTE_METRIC 2048
-typedef struct Link Link;
-typedef struct Network Network;
-
bool link_ipv4ll_enabled(Link *link);
int ipv4ll_configure(Link *link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
#include <netinet/in.h>
-#include "netlink-util.h"
+#include "sd-netlink.h"
+
#include "networkd-ipv6-proxy-ndp.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd-queue.h"
+#include "set.h"
#include "socket-util.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-
-typedef struct Link Link;
-typedef struct Network Network;
+#include "networkd-forward.h"
void network_adjust_ipv6_proxy_ndp(Network *network);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
#include <linux/if_arp.h>
+#include "sd-netlink.h"
+
+#include "conf-parser.h"
+#include "hashmap.h"
#include "in-addr-util.h"
#include "networkd-address.h"
#include "networkd-ipv6ll.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
-#include "networkd-util.h"
+#include "siphash24.h"
#include "socket-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "strv.h"
#include "sysctl-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <errno.h>
#include <linux/if_link.h>
-#include <stdbool.h>
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
-#include "macro.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
typedef enum IPv6LinkLocalAddressGenMode {
IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_EUI64 = IN6_ADDR_GEN_MODE_EUI64,
#include <linux/nexthop.h>
+#include "sd-device.h"
+#include "sd-dhcp-client.h"
+#include "sd-dhcp6-client.h"
+
#include "dhcp-lease-internal.h"
#include "dhcp-server-lease-internal.h"
-#include "dhcp6-internal.h"
#include "dhcp6-lease-internal.h"
-#include "dns-domain.h"
+#include "extract-word.h"
#include "ip-protocol-list.h"
#include "json-util.h"
#include "netif-util.h"
#include "networkd-route.h"
#include "networkd-route-util.h"
#include "networkd-routing-policy-rule.h"
-#include "sort-util.h"
+#include "ordered-set.h"
+#include "set.h"
+#include "string-util.h"
#include "strv.h"
#include "udev-util.h"
-#include "user-util.h"
#include "wifi-util.h"
static int address_append_json(Address *address, bool serializing, sd_json_variant **array) {
NDiscDNSSL *a;
SET_FOREACH(a, link->ndisc_dnssl) {
- r = domain_append_json(AF_INET6, NDISC_DNSSL_DOMAIN(a), NETWORK_CONFIG_SOURCE_NDISC,
+ r = domain_append_json(AF_INET6, ndisc_dnssl_domain(a), NETWORK_CONFIG_SOURCE_NDISC,
&(union in_addr_union) { .in6 = a->router },
&array);
if (r < 0)
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "sd-json.h"
-
-typedef struct Link Link;
-typedef struct Manager Manager;
+#include "networkd-forward.h"
int addresses_append_json(Link *link, bool serializing, sd_json_variant **v);
int nexthops_append_json(Manager *manager, int ifindex, sd_json_variant **v);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if.h>
-#include <netinet/in.h>
-#include <sys/capability.h>
+
+#include "sd-bus.h"
+#include "sd-dhcp-server.h"
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-message-util.h"
+#include "bus-object.h"
#include "bus-polkit.h"
#include "dns-domain.h"
#include "networkd-dhcp4.h"
#include "networkd-link-bus.h"
#include "networkd-manager.h"
#include "networkd-state-file.h"
+#include "ordered-set.h"
#include "parse-util.h"
#include "resolve-util.h"
+#include "set.h"
#include "socket-netlink.h"
+#include "string-util.h"
#include "strv.h"
-#include "user-util.h"
BUS_DEFINE_PROPERTY_GET_ENUM(property_get_operational_state, link_operstate, LinkOperationalState);
BUS_DEFINE_PROPERTY_GET_ENUM(property_get_carrier_state, link_carrier_state, LinkCarrierState);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-#include "macro.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
extern const BusObjectImplementation link_object;
#include <linux/if_link.h>
#include <linux/netdevice.h>
#include <net/if.h>
-#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
+#include "sd-bus.h"
+#include "sd-dhcp-client.h"
+#include "sd-dhcp-server.h"
+#include "sd-dhcp6-client.h"
+#include "sd-dhcp6-lease.h"
+#include "sd-ipv4ll.h"
+#include "sd-lldp-rx.h"
+#include "sd-ndisc.h"
+#include "sd-netlink.h"
+#include "sd-radv.h"
+
#include "alloc-util.h"
#include "arphrd-util.h"
-#include "batadv.h"
#include "bitfield.h"
-#include "bond.h"
-#include "bridge.h"
-#include "bus-util.h"
-#include "device-private.h"
#include "device-util.h"
-#include "dhcp-lease-internal.h"
-#include "env-file.h"
+#include "errno-util.h"
#include "ethtool-util.h"
#include "event-util.h"
-#include "fd-util.h"
-#include "fileio.h"
#include "format-ifname.h"
#include "fs-util.h"
#include "glyph-util.h"
#include "logarithm.h"
-#include "missing_network.h"
+#include "netif-util.h"
#include "netlink-util.h"
-#include "network-internal.h"
#include "networkd-address.h"
#include "networkd-address-label.h"
#include "networkd-bridge-fdb.h"
#include "networkd-bridge-mdb.h"
#include "networkd-bridge-vlan.h"
-#include "networkd-can.h"
#include "networkd-dhcp-prefix-delegation.h"
#include "networkd-dhcp-server.h"
#include "networkd-dhcp4.h"
#include "networkd-state-file.h"
#include "networkd-sysctl.h"
#include "networkd-wifi.h"
+#include "ordered-set.h"
#include "parse-util.h"
#include "set.h"
#include "socket-util.h"
-#include "stdio-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "strv.h"
#include "tc.h"
-#include "tuntap.h"
#include "udev-util.h"
-#include "vrf.h"
void link_required_operstate_for_online(Link *link, LinkOperationalStateRange *ret) {
assert(link);
}
}
+bool link_has_carrier(Link *link) {
+ assert(link);
+ return netif_has_carrier(link->kernel_operstate, link->flags);
+}
+
#define FLAG_STRING(string, flag, old, new) \
(((old ^ new) & flag) \
? ((old & flag) ? (" -" string) : (" +" string)) \
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <endian.h>
#include <linux/nl80211.h>
-#include "sd-bus.h"
-#include "sd-device.h"
-#include "sd-dhcp-client.h"
-#include "sd-dhcp-server.h"
-#include "sd-dhcp6-client.h"
-#include "sd-ipv4acd.h"
-#include "sd-ipv4ll.h"
-#include "sd-lldp-rx.h"
-#include "sd-lldp-tx.h"
-#include "sd-ndisc.h"
-#include "sd-netlink.h"
-#include "sd-radv.h"
-
#include "ether-addr-util.h"
-#include "log-link.h"
-#include "netdev.h"
-#include "netif-util.h"
+#include "forward.h"
#include "network-util.h"
#include "networkd-bridge-vlan.h"
+#include "networkd-forward.h"
#include "networkd-ipv6ll.h"
-#include "networkd-util.h"
-#include "ordered-set.h"
#include "ratelimit.h"
#include "resolve-util.h"
-#include "set.h"
typedef enum LinkState {
LINK_STATE_PENDING, /* udev has not initialized the link */
LINK_RECONFIGURE_CLEANLY = 1 << 1, /* Drop all existing configs before reconfiguring. Otherwise, reuse existing configs as possible as we can. */
} LinkReconfigurationFlag;
-typedef struct Manager Manager;
-typedef struct Network Network;
-typedef struct NetDev NetDev;
-typedef struct DUID DUID;
-
typedef struct Link {
Manager *manager;
void link_update_operstate(Link *link, bool also_update_bond_master);
-static inline bool link_has_carrier(Link *link) {
- assert(link);
- return netif_has_carrier(link->kernel_operstate, link->flags);
-}
+bool link_has_carrier(Link *link);
bool link_ipv6_enabled(Link *link);
int link_ipv6ll_gained(Link *link);
#include <net/if.h>
#include <net/if_arp.h>
-#include <unistd.h>
-#include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
+#include "sd-lldp-rx.h"
+
+#include "conf-parser.h"
#include "networkd-link.h"
#include "networkd-lldp-rx.h"
-#include "networkd-lldp-tx.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "string-table.h"
-#include "string-util.h"
#include "strv.h"
DEFINE_CONFIG_PARSE_ENUM(config_parse_lldp_mode, lldp_mode, LLDPMode);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
typedef enum LLDPMode {
LLDP_MODE_NO = 0,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
int link_lldp_tx_configure(Link *link);
int link_lldp_tx_update_capabilities(Link *link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <net/if.h>
-#include <netinet/in.h>
-#include <sys/capability.h>
+#include <sys/stat.h>
+
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-message-util.h"
+#include "bus-object.h"
#include "bus-polkit.h"
+#include "hashmap.h"
#include "networkd-dhcp-server-bus.h"
#include "networkd-dhcp4-bus.h"
#include "networkd-dhcp6-bus.h"
#include "networkd-manager-bus.h"
#include "networkd-network-bus.h"
#include "path-util.h"
-#include "strv.h"
-#include "user-util.h"
static int method_list_links(sd_bus_message *message, void *userdata, sd_bus_error *error) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-
-typedef struct Manager Manager;
+#include "networkd-forward.h"
extern const BusObjectImplementation manager_object;
#include <unistd.h>
+#include "sd-event.h"
#include "sd-varlink.h"
#include "bus-polkit.h"
#include "fd-util.h"
+#include "hashmap.h"
#include "json-util.h"
#include "lldp-rx-internal.h"
#include "network-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Manager Manager;
+#include "networkd-forward.h"
int manager_connect_varlink(Manager *m);
void manager_varlink_done(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/fib_rules.h>
-#include <linux/if.h>
-#include <linux/nexthop.h>
+#include <linux/filter.h>
#include <linux/nl80211.h>
-#include <netinet/in.h>
#include <sys/socket.h>
-#include <unistd.h>
+#include "sd-bus.h"
+#include "sd-event.h"
#include "sd-netlink.h"
+#include "sd-resolve.h"
#include "alloc-util.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "bus-log-control-api.h"
-#include "bus-polkit.h"
+#include "bus-object.h"
#include "bus-util.h"
#include "capability-util.h"
#include "common-signal.h"
-#include "conf-parser.h"
-#include "constants.h"
#include "daemon-util.h"
#include "device-private.h"
#include "device-util.h"
-#include "dns-domain.h"
#include "env-util.h"
+#include "errno-util.h"
#include "fd-util.h"
-#include "fileio.h"
#include "firewall-util.h"
-#include "fs-util.h"
#include "initrd-util.h"
-#include "local-addresses.h"
#include "mount-util.h"
#include "netlink-util.h"
-#include "network-internal.h"
#include "networkd-address.h"
#include "networkd-address-label.h"
#include "networkd-address-pool.h"
-#include "networkd-dhcp-server-bus.h"
-#include "networkd-dhcp6.h"
-#include "networkd-link-bus.h"
#include "networkd-manager.h"
#include "networkd-manager-bus.h"
#include "networkd-manager-varlink.h"
#include "networkd-neighbor.h"
-#include "networkd-network-bus.h"
#include "networkd-nexthop.h"
#include "networkd-queue.h"
#include "networkd-route.h"
#include "networkd-wifi.h"
#include "networkd-wiphy.h"
#include "ordered-set.h"
-#include "path-lookup.h"
-#include "path-util.h"
#include "qdisc.h"
-#include "selinux-util.h"
#include "set.h"
-#include "signal-util.h"
+#include "stat-util.h"
+#include "string-util.h"
#include "strv.h"
-#include "sysctl-util.h"
#include "tclass.h"
#include "tuntap.h"
#include "udev-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-#include "sd-device.h"
-#include "sd-event.h"
-#include "sd-id128.h"
-#include "sd-netlink.h"
-#include "sd-resolve.h"
-#include "sd-varlink.h"
-
-#include "dhcp-duid-internal.h"
-#include "firewall-util.h"
-#include "hashmap.h"
-#include "networkd-link.h"
+#include "networkd-forward.h"
#include "networkd-network.h"
-#include "networkd-sysctl.h"
-#include "ordered-set.h"
-#include "set.h"
-#include "time-util.h"
typedef enum ManagerState {
MANAGER_RUNNING,
_MANAGER_STATE_INVALID = -EINVAL,
} ManagerState;
-struct Manager {
+typedef struct Manager {
sd_netlink *rtnl;
/* lazy initialized */
sd_netlink *genl;
struct bpf_link *sysctl_link;
int cgroup_fd;
#endif
-};
+} Manager;
int manager_new(Manager **ret, bool test_mode);
Manager* manager_free(Manager *m);
Copyright © 2014 Intel Corporation. All rights reserved.
***/
-#include <arpa/inet.h>
-#include <linux/if.h>
#include <linux/if_arp.h>
+#include <linux/rtnetlink.h>
#include <netinet/icmp6.h>
#include "sd-ndisc.h"
+#include "conf-parser.h"
+#include "errno-util.h"
#include "event-util.h"
#include "missing_network.h"
#include "ndisc-router-internal.h"
#include "networkd-route.h"
#include "networkd-state-file.h"
#include "networkd-sysctl.h"
-#include "sort-util.h"
+#include "ordered-set.h"
+#include "set.h"
+#include "siphash24.h"
+#include "socket-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
static int ndisc_drop_outdated(Link *link, const struct in6_addr *router, usec_t timestamp_usec);
+char* ndisc_dnssl_domain(const NDiscDNSSL *n) {
+ return ((char*) n) + ALIGN(sizeof(NDiscDNSSL));
+}
+
bool link_ndisc_enabled(Link *link) {
assert(link);
}
static void ndisc_dnssl_hash_func(const NDiscDNSSL *x, struct siphash *state) {
- siphash24_compress_string(NDISC_DNSSL_DOMAIN(x), state);
+ siphash24_compress_string(ndisc_dnssl_domain(x), state);
}
static int ndisc_dnssl_compare_func(const NDiscDNSSL *a, const NDiscDNSSL *b) {
- return strcmp(NDISC_DNSSL_DOMAIN(a), NDISC_DNSSL_DOMAIN(b));
+ return strcmp(ndisc_dnssl_domain(a), ndisc_dnssl_domain(b));
}
DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(
if (!s)
return log_oom();
- strcpy(NDISC_DNSSL_DOMAIN(s), *j);
+ strcpy(ndisc_dnssl_domain(s), *j);
if (lifetime_usec == 0) {
/* The entry is outdated. */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-#include "dns-resolver-internal.h"
-#include "time-util.h"
+#include <netinet/in.h>
-typedef struct Address Address;
-typedef struct Link Link;
-typedef struct Network Network;
+#include "dns-resolver-internal.h"
+#include "networkd-forward.h"
typedef enum IPv6AcceptRAStartDHCP6Client {
IPV6_ACCEPT_RA_START_DHCP6_CLIENT_NO,
sd_dns_resolver resolver;
} NDiscDNR;
-static inline char* NDISC_DNSSL_DOMAIN(const NDiscDNSSL *n) {
- return ((char*) n) + ALIGN(sizeof(NDiscDNSSL));
-}
+char* ndisc_dnssl_domain(const NDiscDNSSL *n);
bool link_ndisc_enabled(Link *link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-netlink.h"
+
#include "alloc-util.h"
+#include "conf-parser.h"
+#include "errno-util.h"
#include "hashmap.h"
#include "netlink-util.h"
#include "networkd-link.h"
#include "networkd-neighbor.h"
#include "networkd-network.h"
#include "networkd-queue.h"
+#include "ordered-set.h"
#include "set.h"
+#include "siphash24.h"
+#include "socket-util.h"
+#include "string-util.h"
static Neighbor* neighbor_detach_impl(Neighbor *neighbor) {
assert(neighbor);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
#include "ether-addr-util.h"
#include "in-addr-util.h"
+#include "networkd-forward.h"
#include "networkd-util.h"
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Network Network;
-
typedef struct Neighbor {
Network *network;
Link *link;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "escape.h"
+#include "sd-netlink.h"
+
+#include "missing_network.h"
#include "netlink-util.h"
#include "networkd-address.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-netlabel.h"
-#include "networkd-network.h"
static int netlabel_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
int r;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Address Address;
+#include "networkd-forward.h"
void address_add_netlabel(const Address *address);
void address_del_netlabel(const Address *address);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
+#include "bus-object.h"
#include "ether-addr-util.h"
#include "networkd-manager.h"
#include "networkd-network-bus.h"
-#include "path-util.h"
-#include "string-util.h"
+#include "set.h"
#include "strv.h"
static int property_get_hw_addrs(
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
extern const BusObjectImplementation network_object;
#include <netinet/icmp6.h>
#include <stddef.h>
+#include "sd-dhcp-lease.h"
+
+#include "condition.h"
#include "conf-parser.h"
#include "in-addr-prefix-util.h"
#include "net-condition.h"
#include "networkd-ipv6ll.h"
#include "networkd-lldp-tx.h"
#include "networkd-ndisc.h"
-#include "networkd-netlabel.h"
#include "networkd-network.h"
#include "networkd-neighbor.h"
#include "networkd-nexthop.h"
#include "networkd-radv.h"
#include "networkd-route.h"
#include "networkd-routing-policy-rule.h"
-#include "networkd-sriov.h"
#include "qdisc.h"
#include "socket-util.h"
#include "tclass.h"
-#include "vlan-util.h"
#include "cake.h"
#include "codel.h"
#include "gred.h"
#include "hhf.h"
#include "htb.h"
-#include "mq.h"
-#include "multiq.h"
#include "pie.h"
#include "qfq.h"
#include "netem.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/netdevice.h>
-#include <net/if.h>
-#include <netinet/in.h>
#include <unistd.h>
#include "alloc-util.h"
+#include "condition.h"
#include "conf-files.h"
#include "conf-parser.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "hostname-util.h"
#include "in-addr-util.h"
#include "net-condition.h"
#include "netdev/macvlan.h"
+#include "netif-sriov.h"
#include "network-util.h"
#include "networkd-address.h"
#include "networkd-address-label.h"
#include "networkd-radv.h"
#include "networkd-route.h"
#include "networkd-routing-policy-rule.h"
-#include "networkd-sriov.h"
+#include "ordered-set.h"
#include "parse-util.h"
-#include "path-lookup.h"
#include "qdisc.h"
#include "radv-internal.h"
#include "set.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <linux/nl80211.h>
-
-#include "sd-bus.h"
-#include "sd-device.h"
+#include "sd-dhcp-lease.h"
#include "sd-lldp-tx.h"
#include "bridge.h"
-#include "condition.h"
-#include "conf-parser.h"
#include "firewall-util.h"
-#include "hashmap.h"
#include "ipoib.h"
#include "net-condition.h"
-#include "netdev.h"
-#include "networkd-address.h"
-#include "networkd-bridge-vlan.h"
+#include "network-util.h"
#include "networkd-dhcp-common.h"
#include "networkd-dhcp4.h"
#include "networkd-dhcp6.h"
#include "networkd-dns.h"
-#include "networkd-ipv6ll.h"
+#include "networkd-forward.h"
+#include "networkd-link.h"
#include "networkd-lldp-rx.h"
#include "networkd-ndisc.h"
#include "networkd-radv.h"
#include "networkd-sysctl.h"
-#include "networkd-util.h"
-#include "ordered-set.h"
-#include "resolve-util.h"
-#include "socket-netlink.h"
typedef enum KeepConfiguration {
KEEP_CONFIGURATION_NO = 0,
_ACTIVATION_POLICY_INVALID = -EINVAL,
} ActivationPolicy;
-typedef struct Manager Manager;
-
typedef struct NetworkDHCPServerEmitAddress {
bool emit;
struct in_addr *addresses;
size_t n_addresses;
} NetworkDHCPServerEmitAddress;
-struct Network {
+typedef struct Network {
Manager *manager;
unsigned n_ref;
/* NTP */
char **ntp;
-};
+} Network;
Network *network_ref(Network *network);
Network *network_unref(Network *network);
#include <linux/nexthop.h>
#include <net/if.h>
+#include <stdio.h>
+
+#include "sd-netlink.h"
#include "alloc-util.h"
+#include "conf-parser.h"
+#include "errno-util.h"
+#include "extract-word.h"
#include "netlink-util.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
#include "networkd-route.h"
#include "networkd-route-util.h"
+#include "ordered-set.h"
#include "parse-util.h"
#include "set.h"
-#include "stdio-util.h"
+#include "siphash24.h"
#include "string-util.h"
static void nexthop_detach_from_group_members(NextHop *nexthop) {
#pragma once
-#include <inttypes.h>
-
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
-#include "hashmap.h"
#include "in-addr-util.h"
+#include "networkd-forward.h"
#include "networkd-util.h"
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Network Network;
-typedef struct NextHop NextHop;
-typedef struct Request Request;
typedef int (*nexthop_netlink_handler_t)(
sd_netlink *rtnl,
sd_netlink_message *m,
Link *link,
NextHop *nexthop);
-struct NextHop {
+typedef struct NextHop {
Network *network;
Manager *manager;
ConfigSection *section;
/* For managing routes and nexthops that depend on this nexthop. */
Set *nexthops;
Set *routes;
-};
+} NextHop;
void log_nexthop_debug(const NextHop *nexthop, const char *str, Manager *manager);
#include "alloc-util.h"
#include "dns-domain.h"
+#include "extract-word.h"
+#include "networkd-link.h"
#include "networkd-network.h"
#include "networkd-ntp.h"
-#include "parse-util.h"
+#include "string-util.h"
#include "strv.h"
/* Let's assume that anything above this number is a user misconfiguration. */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-#include "networkd-util.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
bool link_get_use_ntp(Link *link, NetworkConfigSource proto);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-netlink.h"
+
+#include "alloc-util.h"
#include "netdev.h"
#include "netlink-util.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
+#include "ordered-set.h"
+#include "siphash24.h"
#include "string-table.h"
#define REPLY_CALLBACK_COUNT_THRESHOLD 128
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-netlink.h"
-
-#include "alloc-util.h"
-#include "hash-funcs.h"
#include "netif-sriov.h"
-
-typedef struct Link Link;
-typedef struct NetDev NetDev;
-typedef struct Manager Manager;
-typedef struct Request Request;
+#include "networkd-forward.h"
typedef int (*request_process_func_t)(Request *req, Link *link, void *userdata);
typedef int (*request_netlink_handler_t)(sd_netlink *nl, sd_netlink_message *m, Request *req, Link *link, void *userdata);
_REQUEST_TYPE_INVALID = -EINVAL,
} RequestType;
-struct Request {
+typedef struct Request {
unsigned n_ref;
Manager *manager; /* must be non-NULL */
request_netlink_handler_t netlink_handler;
bool waiting_reply;
-};
+} Request;
Request *request_ref(Request *req);
Request *request_unref(Request *req);
Copyright © 2017 Intel Corporation. All rights reserved.
***/
-#include <arpa/inet.h>
#include <netinet/icmp6.h>
+#include "sd-radv.h"
+
+#include "conf-parser.h"
#include "dns-domain.h"
+#include "extract-word.h"
#include "ndisc-router-internal.h"
#include "networkd-address.h"
#include "networkd-address-generation.h"
#include "networkd-queue.h"
#include "networkd-radv.h"
#include "networkd-route-util.h"
+#include "ordered-set.h"
#include "parse-util.h"
#include "radv-internal.h"
+#include "set.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
Copyright © 2017 Intel Corporation. All rights reserved.
***/
-#include <inttypes.h>
-#include <stdbool.h>
-
-#include "sd-radv.h"
-
-#include "conf-parser.h"
-#include "in-addr-util.h"
#include "ndisc-option.h"
-#include "networkd-util.h"
-
-typedef struct Address Address;
-typedef struct Link Link;
-typedef struct Network Network;
+#include "networkd-forward.h"
typedef enum RADVPrefixDelegation {
RADV_PREFIX_DELEGATION_NONE = 0,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-netlink.h"
+
#include "alloc-util.h"
+#include "conf-parser.h"
+#include "log.h"
#include "netlink-util.h"
#include "networkd-route.h"
#include "networkd-route-metric.h"
#include "parse-util.h"
+#include "siphash24.h"
#include "string-util.h"
void route_metric_done(RouteMetric *metric) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
-#include "hash-funcs.h"
+#include "networkd-forward.h"
typedef struct RouteMetric {
size_t n_metrics; /* maximum metric attr type with non-zero value */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/nexthop.h>
+#include <stdio.h>
+
+#include "sd-netlink.h"
#include "alloc-util.h"
+#include "conf-parser.h"
#include "extract-word.h"
#include "netlink-util.h"
#include "networkd-manager.h"
#include "networkd-route.h"
#include "networkd-route-nexthop.h"
#include "networkd-route-util.h"
+#include "ordered-set.h"
#include "parse-util.h"
+#include "set.h"
+#include "siphash24.h"
+#include "socket-util.h"
#include "string-util.h"
void route_detach_from_nexthop(Route *route) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
#include "in-addr-util.h"
-#include "macro.h"
-#include "siphash24.h"
-
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Route Route;
+#include "networkd-forward.h"
typedef struct RouteNextHop {
int family; /* used in RTA_VIA (IPv4 only) */
#include "alloc-util.h"
#include "bitfield.h"
+#include "extract-word.h"
#include "logarithm.h"
#include "networkd-address.h"
#include "networkd-link.h"
#include "networkd-route.h"
#include "networkd-route-util.h"
#include "parse-util.h"
+#include "set.h"
#include "string-table.h"
#include "string-util.h"
-#include "strv.h"
#include "sysctl-util.h"
#define ROUTES_DEFAULT_MAX_PER_FAMILY 4096
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-
-#include "conf-parser.h"
-#include "in-addr-util.h"
-
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Address Address;
-typedef struct Route Route;
+#include "networkd-forward.h"
unsigned routes_max(void);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
#include <linux/ipv6_route.h>
-#include <linux/nexthop.h>
+#include <net/if.h>
+#include <stdio.h>
+
+#include "sd-ndisc-protocol.h"
+#include "sd-netlink.h"
#include "alloc-util.h"
+#include "conf-parser.h"
+#include "errno-util.h"
#include "event-util.h"
#include "netlink-util.h"
#include "networkd-address.h"
#include "networkd-queue.h"
#include "networkd-route.h"
#include "networkd-route-util.h"
+#include "ordered-set.h"
#include "parse-util.h"
+#include "set.h"
+#include "siphash24.h"
#include "string-util.h"
-#include "strv.h"
#include "vrf.h"
#include "wireguard.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
#include "in-addr-util.h"
-#include "networkd-link.h"
+#include "networkd-forward.h"
#include "networkd-route-metric.h"
#include "networkd-route-nexthop.h"
#include "networkd-util.h"
-typedef struct Manager Manager;
-typedef struct Network Network;
-typedef struct Request Request;
-typedef struct Route Route;
-typedef struct Wireguard Wireguard;
-
typedef int (*route_netlink_handler_t)(
sd_netlink *rtnl,
sd_netlink_message *m,
Link *link,
Route *route);
-struct Route {
+typedef struct Route {
Manager *manager;
Network *network;
Wireguard *wireguard;
bool pref_set:1;
bool gateway_from_dhcp_or_ra:1;
int gateway_onlink;
-};
+} Route;
void log_route_debug(const Route *route, const char *str, Manager *manager);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/fib_rules.h>
-#include <net/if.h>
-#include "af-list.h"
+#include "sd-netlink.h"
+
#include "alloc-util.h"
#include "conf-parser.h"
-#include "fileio.h"
-#include "format-util.h"
+#include "errno-util.h"
#include "hashmap.h"
-#include "ip-protocol-list.h"
#include "netlink-util.h"
#include "network-util.h"
#include "networkd-manager.h"
#include "networkd-route-util.h"
#include "networkd-routing-policy-rule.h"
#include "networkd-util.h"
+#include "ordered-set.h"
#include "parse-util.h"
-#include "socket-util.h"
+#include "set.h"
+#include "siphash24.h"
#include "string-table.h"
#include "string-util.h"
-#include "strv.h"
#include "user-util.h"
static const char *const fr_act_type_table[__FR_ACT_MAX] = {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
#include <linux/fib_rules.h>
-#include <stdbool.h>
-#include "conf-parser.h"
#include "in-addr-prefix-util.h"
+#include "networkd-forward.h"
#include "networkd-util.h"
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Network Network;
-
typedef struct RoutingPolicyRule {
Manager *manager;
Network *network;
#include "af-list.h"
#include "alloc-util.h"
#include "daemon-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
+#include "hashmap.h"
#include "iovec-util.h"
#include "json-util.h"
#include "memfd-util.h"
#include "networkd-nexthop.h"
#include "networkd-route.h"
#include "networkd-serialize.h"
+#include "string-util.h"
int manager_serialize(Manager *manager) {
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL, *array = NULL;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Manager Manager;
+#include "networkd-forward.h"
int manager_serialize(Manager *manager);
int manager_set_serialization_fd(Manager *manager, int fd, const char *name);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
#include <linux/if_arp.h>
-#include <linux/if_bridge.h>
#include <linux/ipv6.h>
#include <netinet/in.h>
+#include "sd-netlink.h"
+
#include "device-private.h"
#include "missing_network.h"
#include "netif-util.h"
#include "networkd-setlink.h"
#include "networkd-sriov.h"
#include "networkd-wiphy.h"
+#include "ordered-set.h"
+#include "set.h"
+#include "socket-util.h"
+#include "string-util.h"
static int get_link_default_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
return link_getlink_handler_internal(rtnl, m, link, "Failed to sync link information");
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-
-typedef struct Link Link;
+#include "networkd-forward.h"
int link_request_to_set_addrgen_mode(Link *link);
int link_request_to_set_bond(Link *link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
-
#include "sd-event.h"
#include "sd-netlink.h"
+#include "hashmap.h"
#include "networkd-link.h"
-#include "networkd-link-bus.h"
#include "networkd-manager.h"
#include "networkd-speed-meter.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "networkd-forward.h"
+
/* Default interval is 10sec. The speed meter periodically make networkd
* to be woke up. So, too small interval value is not desired.
* We set the minimum value 100msec = 0.1sec. */
#define SPEED_METER_DEFAULT_TIME_INTERVAL (10 * USEC_PER_SEC)
#define SPEED_METER_MINIMUM_TIME_INTERVAL (100 * USEC_PER_MSEC)
-typedef struct Manager Manager;
-
int manager_start_speed_meter(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later
* Copyright © 2020 VMware, Inc. */
-#include "device-enumerator-private.h"
+#include "sd-netlink.h"
+
#include "device-util.h"
-#include "fd-util.h"
+#include "errno-util.h"
+#include "hashmap.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
#include "networkd-sriov.h"
+#include "set.h"
+#include "string-util.h"
static int sr_iov_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, SRIOV *sr_iov) {
int r;
* Copyright © 2020 VMware, Inc. */
#pragma once
-#include "netif-sriov.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
int link_request_sr_iov_vfs(Link *link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
+#include <net/if.h>
#include <netinet/in.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "sd-dhcp6-lease.h"
#include "alloc-util.h"
-#include "dns-domain.h"
#include "dns-resolver-internal.h"
+#include "errno-util.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "networkd-state-file.h"
#include "ordered-set.h"
#include "set.h"
+#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"
NDiscDNSSL *a;
SET_FOREACH(a, link->ndisc_dnssl) {
- r = ordered_set_put_strdup(s, NDISC_DNSSL_DOMAIN(a));
+ r = ordered_set_put_strdup(s, ndisc_dnssl_domain(a));
if (r < 0)
return r;
}
NDiscDNSSL *dd;
SET_FOREACH(dd, link->ndisc_dnssl)
- fputs_with_separator(f, NDISC_DNSSL_DOMAIN(dd), NULL, &space);
+ fputs_with_separator(f, ndisc_dnssl_domain(dd), NULL, &space);
}
}
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-typedef struct Link Link;
-typedef struct Manager Manager;
+#include "networkd-forward.h"
void link_dirty(Link *link);
void link_clean(Link *link);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
#include <linux/if_arp.h>
-#include <netinet/in.h>
#include "sd-messages.h"
#include "af-list.h"
+#include "conf-parser.h"
#include "alloc-util.h"
#include "cgroup-util.h"
+#include "errno-util.h"
#include "event-util.h"
#include "fd-util.h"
#include "format-util.h"
-#include "missing_network.h"
+#include "hashmap.h"
#include "networkd-link.h"
#include "networkd-lldp-tx.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd-sysctl.h"
#include "path-util.h"
+#include "set.h"
#include "socket-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "sysctl-util.h"
#if HAVE_VMLINUX_H
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "conf-parser.h"
-
-typedef struct Link Link;
-typedef struct Manager Manager;
+#include "networkd-forward.h"
typedef enum IPv6PrivacyExtensions {
/* These values map to the kernel's /proc/sys/net/ipv6/conf/xxx/use_tempaddr values. Do not reorder! */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <linux/rtnetlink.h>
+
#include "alloc-util.h"
#include "bitfield.h"
-#include "condition.h"
#include "conf-parser.h"
#include "escape.h"
#include "logarithm.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-dhcp-lease.h"
-#include "sd-netlink.h"
-
-#include "conf-parser.h"
-#include "hashmap.h"
-#include "log.h"
-#include "macro.h"
#include "network-util.h"
-#include "string-util.h"
-
-typedef struct Link Link;
+#include "networkd-forward.h"
+#include "time-util.h"
typedef enum NetworkConfigSource {
NETWORK_CONFIG_SOURCE_FOREIGN, /* configured by kernel */
#include <linux/nl80211.h>
#include <net/ethernet.h>
+#include "sd-netlink.h"
+
#include "alloc-util.h"
#include "ether-addr-util.h"
-#include "netlink-util.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-wifi.h"
#include "networkd-wiphy.h"
+#include "set.h"
#include "string-util.h"
#include "wifi-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-netlink.h"
-
-typedef struct Link Link;
-typedef struct Manager Manager;
+#include "networkd-forward.h"
int manager_genl_process_nl80211_config(sd_netlink *genl, sd_netlink_message *message, Manager *manager);
int manager_genl_process_nl80211_mlme(sd_netlink *genl, sd_netlink_message *message, Manager *manager);
#include <linux/nl80211.h>
#include <net/if_arp.h>
+#include "sd-netlink.h"
+
#include "alloc-util.h"
#include "device-private.h"
#include "device-util.h"
+#include "errno-util.h"
+#include "hashmap.h"
#include "networkd-manager.h"
#include "networkd-wiphy.h"
-#include "parse-util.h"
#include "path-util.h"
+#include "string-util.h"
#include "udev-util.h"
#include "wifi-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-
-#include "sd-device.h"
-#include "sd-netlink.h"
-
-#include "macro.h"
-
-typedef struct Link Link;
-typedef struct Manager Manager;
+#include "networkd-forward.h"
/* The following values are different from the ones defined in linux/rfkill.h. */
typedef enum RFKillState {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <netinet/in.h>
#include <sys/stat.h>
-#include <sys/types.h>
-#include "sd-daemon.h"
#include "sd-event.h"
#include "bus-log-control-api.h"
+#include "bus-object.h"
#include "capability-util.h"
#include "daemon-util.h"
-#include "firewall-util.h"
#include "main-func.h"
#include "mkdir-label.h"
#include "networkd-conf.h"
#include "networkd-manager-bus.h"
#include "networkd-serialize.h"
#include "service-util.h"
-#include "signal-util.h"
#include "strv.h"
#include "user-util.h"
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
+#include "sd-netlink.h"
+
#include "cake.h"
-#include "conf-parser.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "qdisc.h"
#include "string-table.h"
#include <linux/pkt_sched.h>
-#include "conf-parser.h"
#include "qdisc.h"
typedef enum CakeCompensationMode {
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
+#include "sd-netlink.h"
+
#include "codel.h"
-#include "conf-parser.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "string-util.h"
* Copyright © 2019 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
#include "qdisc.h"
-#include "time-util.h"
typedef struct ControlledDelay {
QDisc meta;
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "sd-netlink.h"
+
#include "drr.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "string-util.h"
* Copyright © 2020 VMware, Inc. */
#pragma once
+#include "forward.h"
#include "qdisc.h"
#include "tclass.h"
#include <linux/pkt_sched.h>
+#include "sd-netlink.h"
+
#include "alloc-util.h"
-#include "conf-parser.h"
#include "ets.h"
#include "extract-word.h"
-#include "memory-util.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "qdisc.h"
#include "string-util.h"
-#include "tc-util.h"
static int enhanced_transmission_selection_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
EnhancedTransmissionSelection *ets;
#include <linux/pkt_sched.h>
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct EnhancedTransmissionSelection {
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "sd-netlink.h"
+
#include "fifo.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "string-util.h"
* Copyright © 2020 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct FirstInFirstOut {
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "sd-netlink.h"
+
#include "fq-codel.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "string-util.h"
#include "strv.h"
* Copyright © 2019 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
-#include "time-util.h"
typedef struct FairQueueingControlledDelay {
QDisc meta;
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "sd-netlink.h"
+
#include "fq-pie.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "string-util.h"
* Copyright © 2020 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct FlowQueuePIE {
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "sd-netlink.h"
+
#include "fq.h"
+#include "log.h"
#include "logarithm.h"
-#include "netlink-util.h"
#include "parse-util.h"
#include "string-util.h"
#include "strv.h"
* Copyright © 2019 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct FairQueueing {
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "sd-netlink.h"
+
#include "gred.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "string-util.h"
* Copyright © 2020 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct GenericRandomEarlyDetection {
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "sd-netlink.h"
+
#include "hhf.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "string-util.h"
* Copyright © 2020 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct HeavyHitterFilter {
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "sd-netlink.h"
+
#include "htb.h"
-#include "netlink-util.h"
+#include "log-link.h"
#include "networkd-link.h"
#include "parse-util.h"
#include "qdisc.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
#include "tclass.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "forward.h"
#include "mq.h"
const QDiscVTable mq_vtable = {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "forward.h"
#include "qdisc.h"
typedef struct ClassfulMultiQueueing {
#include <linux/pkt_sched.h>
+#include "sd-netlink.h"
+
#include "multiq.h"
static int multi_queueing_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "forward.h"
#include "qdisc.h"
typedef struct BandMultiQueueing {
* Copyright © 2019 VMware, Inc. */
#include <linux/pkt_sched.h>
+#include "sd-netlink.h"
-#include "alloc-util.h"
-#include "conf-parser.h"
+#include "log-link.h"
#include "netem.h"
-#include "netlink-util.h"
-#include "networkd-manager.h"
+#include "networkd-link.h"
#include "parse-util.h"
#include "qdisc.h"
+#include "string-util.h"
#include "strv.h"
#include "tc-util.h"
* Copyright © 2019 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
-#include "time-util.h"
typedef struct NetworkEmulator {
QDisc meta;
#include <linux/pkt_sched.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "netlink-util.h"
+#include "sd-netlink.h"
+
+#include "log.h"
#include "parse-util.h"
#include "pie.h"
#include "string-util.h"
* Copyright © 2020 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct ProportionalIntegralControllerEnhanced {
* Copyright © 2019 VMware, Inc. */
#include <linux/pkt_sched.h>
+#include "sd-netlink.h"
#include "alloc-util.h"
#include "cake.h"
#include "gred.h"
#include "hhf.h"
#include "htb.h"
-#include "in-addr-util.h"
#include "mq.h"
#include "multiq.h"
#include "netem.h"
-#include "netlink-util.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd-queue.h"
+#include "ordered-set.h"
#include "parse-util.h"
#include "pie.h"
#include "qdisc.h"
#include "set.h"
#include "sfb.h"
#include "sfq.h"
+#include "siphash24.h"
#include "string-util.h"
#include "strv.h"
#include "tbf.h"
* Copyright © 2019 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "networkd-forward.h"
#include "networkd-util.h"
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Network Network;
-
typedef enum QDiscKind {
QDISC_KIND_BFIFO,
QDISC_KIND_CAKE,
* Copyright © 2020 VMware, Inc. */
#include <linux/pkt_sched.h>
+#include "sd-netlink.h"
+#include "log.h"
#include "parse-util.h"
#include "qdisc.h"
#include "qfq.h"
* Copyright © 2020 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
#include "tclass.h"
* Copyright © 2020 VMware, Inc. */
#include <linux/pkt_sched.h>
+#include "sd-netlink.h"
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "netlink-util.h"
+#include "log.h"
#include "parse-util.h"
#include "qdisc.h"
#include "sfb.h"
* Copyright © 2020 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct StochasticFairBlue {
* Copyright © 2019 VMware, Inc. */
#include <linux/pkt_sched.h>
+#include "sd-netlink.h"
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "netlink-util.h"
-#include "parse-util.h"
+#include "log.h"
#include "qdisc.h"
#include "sfq.h"
#include "string-util.h"
* Copyright © 2019 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
-#include "time-util.h"
typedef struct StochasticFairnessQueueing {
QDisc meta;
* Copyright © 2019 VMware, Inc. */
#include <linux/pkt_sched.h>
-#include <math.h>
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "netem.h"
-#include "netlink-util.h"
-#include "networkd-manager.h"
+#include "sd-netlink.h"
+
+#include "log-link.h"
+#include "networkd-link.h"
#include "parse-util.h"
-#include "string-util.h"
#include "strv.h"
#include "tbf.h"
#include "tc-util.h"
+#include "string-util.h"
static int token_bucket_filter_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
uint32_t rtab[256], ptab[256];
* Copyright © 2019 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
-#include "time-util.h"
typedef struct TokenBucketFilter {
QDisc meta;
/* SPDX-License-Identifier: LGPL-2.1-or-later
* Copyright © 2019 VMware, Inc. */
+#include <stdio.h>
+
#include "alloc-util.h"
-#include "assert-util.h"
#include "extract-word.h"
#include "fileio.h"
#include "parse-util.h"
#include <linux/pkt_sched.h>
-#include "time-util.h"
+#include "forward.h"
int tc_init(double *ret_ticks_in_usec, uint32_t *ret_hz);
int tc_time_to_tick(usec_t t, uint32_t *ret);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "macro.h"
+#include "hashmap.h"
#include "networkd-link.h"
#include "networkd-network.h"
#include "qdisc.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Link Link;
+#include "networkd-forward.h"
int link_request_traffic_control(Link *link);
#include <linux/pkt_sched.h>
+#include "sd-netlink.h"
+
#include "alloc-util.h"
#include "conf-parser.h"
#include "drr.h"
#include "htb.h"
-#include "in-addr-util.h"
-#include "netlink-util.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd-queue.h"
-#include "parse-util.h"
+#include "ordered-set.h"
#include "qfq.h"
#include "set.h"
+#include "siphash24.h"
#include "string-util.h"
-#include "strv.h"
#include "tc-util.h"
#include "tclass.h"
* Copyright © 2019 VMware, Inc. */
#pragma once
-#include "conf-parser.h"
+#include "networkd-forward.h"
#include "networkd-util.h"
-typedef struct Link Link;
-typedef struct Manager Manager;
-typedef struct Network Network;
-
typedef enum TClassKind {
TCLASS_KIND_DRR,
TCLASS_KIND_HTB,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <stdio.h>
+
#include "alloc-util.h"
-#include "macro.h"
+#include "log.h"
#include "networkd-link.h"
#include "parse-util.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
+#include "forward.h"
#include "qdisc.h"
typedef struct TrivialLinkEqualizer {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if.h>
#include <net/if.h>
-#include "bond.h"
-#include "dhcp6-internal.h"
+#include "sd-dhcp-lease.h"
+
+#include "bond-util.h"
#include "dhcp6-protocol.h"
#include "ethtool-util.h"
-#include "ipvlan.h"
+#include "ipvlan-util.h"
#include "lldp-rx-internal.h"
-#include "macvlan.h"
+#include "macvlan-util.h"
#include "ndisc-internal.h"
-#include "networkd-link.h"
-#include "networkd-network.h"
-#include "networkd-util.h"
+#include "networkd-dns.h"
+#include "networkd-lldp-rx.h"
+#include "networkd-radv.h"
+#include "networkd-sysctl.h"
#include "test-tables.h"
#include "tests.h"
#include "tunnel.h"
#include <arpa/inet.h>
-#include "sd-device.h"
-
#include "alloc-util.h"
#include "dhcp-lease-internal.h"
-#include "ether-addr-util.h"
+#include "hashmap.h"
#include "hostname-setup.h"
#include "network-internal.h"
-#include "networkd-address.h"
#include "networkd-manager.h"
#include "networkd-route-util.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "conf-parser.h"
#include "hexdecoct.h"
-#include "log.h"
-#include "macro.h"
#include "net-condition.h"
#include "networkd-address.h"
-#include "networkd-conf.h"
#include "networkd-manager.h"
#include "networkd-network.h"
+#include "set.h"
#include "strv.h"
#include "tests.h"
#include "iovec-util.h"
#include "json-util.h"
#include "set.h"
-#include "strv.h"
+#include "string-util.h"
DNSServer* dns_server_free(DNSServer *s) {
if (!s)
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-json.h"
+#include <sys/uio.h>
-#include "hash-funcs.h"
-#include "iovec-util.h"
-#include "macro-fundamental.h"
-#include "set.h"
+#include "forward.h"
-typedef struct DNSServer DNSServer;
-typedef struct SearchDomain SearchDomain;
-typedef struct DNSConfiguration DNSConfiguration;
-
-struct DNSServer {
+typedef struct DNSServer {
struct iovec addr;
int family;
uint16_t port;
int ifindex;
char *server_name;
bool accessible;
-};
+} DNSServer;
DNSServer* dns_server_free(DNSServer *s);
DEFINE_TRIVIAL_CLEANUP_FUNC(DNSServer*, dns_server_free);
-struct SearchDomain {
+typedef struct SearchDomain {
char *name;
bool route_only;
int ifindex;
-};
+} SearchDomain;
SearchDomain* search_domain_free(SearchDomain *d);
DEFINE_TRIVIAL_CLEANUP_FUNC(SearchDomain*, search_domain_free);
-struct DNSConfiguration {
+typedef struct DNSConfiguration {
char *ifname;
int ifindex;
bool default_route;
DNSServer *current_dns_server;
Set *dns_servers;
Set *search_domains;
-};
+} DNSConfiguration;
DNSConfiguration* dns_configuration_free(DNSConfiguration *c);
DEFINE_TRIVIAL_CLEANUP_FUNC(DNSConfiguration*, dns_configuration_free);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-netlink.h"
#include "sd-network.h"
#include "alloc-util.h"
#include "dns-configuration.h"
#include "format-ifname.h"
#include "hashmap.h"
+#include "log-link.h"
#include "string-util.h"
#include "strv.h"
#include "wait-online-link.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-netlink.h"
-
-#include "dns-configuration.h"
-#include "log-link.h"
+#include "forward.h"
#include "network-util.h"
-typedef struct Link Link;
+typedef struct DNSConfiguration DNSConfiguration;
typedef struct Manager Manager;
-struct Link {
+typedef struct Link {
Manager *manager;
int ifindex;
LinkAddressState ipv6_address_state;
char *state;
DNSConfiguration *dns_configuration;
-};
+} Link;
int rtnl_process_link(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata);
int link_update_monitor(Link *l);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <fnmatch.h>
-#include <linux/if.h>
-#include <netinet/ether.h>
+#include <net/if.h>
#include "sd-event.h"
#include "sd-json.h"
+#include "sd-netlink.h"
+#include "sd-network.h"
#include "sd-varlink.h"
#include "alloc-util.h"
#include "dns-configuration.h"
+#include "hashmap.h"
#include "json-util.h"
-#include "netlink-util.h"
+#include "log-link.h"
#include "string-util.h"
#include "strv.h"
-#include "time-util.h"
#include "wait-online-link.h"
#include "wait-online-manager.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-event.h"
-#include "sd-netlink.h"
-#include "sd-network.h"
-#include "sd-varlink.h"
-
-#include "dns-configuration.h"
-#include "hashmap.h"
+#include "forward.h"
#include "network-util.h"
-#include "time-util.h"
-typedef struct Manager Manager;
+typedef struct DNSConfiguration DNSConfiguration;
typedef struct Link Link;
-struct Manager {
+typedef struct Manager {
Hashmap *links_by_index;
Hashmap *links_by_name;
sd_varlink *varlink_client;
DNSConfiguration *dns_configuration;
Hashmap *dns_configuration_by_link_index;
-};
+} Manager;
Manager* manager_free(Manager *m);
int manager_new(Manager **ret, Hashmap *command_line_interfaces_by_name, char **ignored_interfaces,
#include <getopt.h>
#include <sys/stat.h>
-#include <sys/types.h>
-#include "sd-daemon.h"
+#include "sd-event.h"
#include "alloc-util.h"
#include "build.h"
#include "daemon-util.h"
+#include "hashmap.h"
#include "log.h"
#include "main-func.h"
#include "parse-argument.h"
#include "pretty-print.h"
-#include "signal-util.h"
#include "socket-util.h"
#include "strv.h"
+#include "time-util.h"
#include "wait-online-manager.h"
static bool arg_quiet = false;