Merge pull request #4665 from teg/networkd-split-1

networkd: split sources into subdirectories
This commit is contained in:
David Herrmann 2016-11-14 12:08:38 +01:00 committed by GitHub
commit 46b6025a88
60 changed files with 140 additions and 127 deletions

View file

@ -5610,37 +5610,39 @@ libnetworkd_core_la_CFLAGS = \
libnetworkd_core_la_SOURCES = \
src/libsystemd-network/network-internal.h \
src/network/networkd.h \
src/network/netdev/netdev.h \
src/network/netdev/netdev.c \
src/network/netdev/vrf.h \
src/network/netdev/vrf.c \
src/network/netdev/tunnel.h \
src/network/netdev/tunnel.c \
src/network/netdev/veth.h \
src/network/netdev/veth.c \
src/network/netdev/vxlan.h \
src/network/netdev/vxlan.c \
src/network/netdev/vlan.h \
src/network/netdev/vlan.c \
src/network/netdev/macvlan.h \
src/network/netdev/macvlan.c \
src/network/netdev/ipvlan.h \
src/network/netdev/ipvlan.c \
src/network/netdev/dummy.h \
src/network/netdev/dummy.c \
src/network/netdev/tuntap.h \
src/network/netdev/tuntap.c \
src/network/netdev/bond.h \
src/network/netdev/bond.c \
src/network/netdev/bridge.h \
src/network/netdev/bridge.c \
src/network/netdev/vcan.h \
src/network/netdev/vcan.c \
src/network/networkd-manager.h \
src/network/networkd-manager.c \
src/network/networkd-manager-bus.c \
src/network/networkd-conf.h \
src/network/networkd-conf.c \
src/network/networkd-link.h \
src/network/networkd-link.c \
src/network/networkd-netdev.h \
src/network/networkd-netdev.c \
src/network/networkd-netdev-vrf.h \
src/network/networkd-netdev-vrf.c \
src/network/networkd-netdev-tunnel.h \
src/network/networkd-netdev-tunnel.c \
src/network/networkd-netdev-veth.h \
src/network/networkd-netdev-veth.c \
src/network/networkd-netdev-vxlan.h \
src/network/networkd-netdev-vxlan.c \
src/network/networkd-netdev-vlan.h \
src/network/networkd-netdev-vlan.c \
src/network/networkd-netdev-macvlan.h \
src/network/networkd-netdev-macvlan.c \
src/network/networkd-netdev-ipvlan.h \
src/network/networkd-netdev-ipvlan.c \
src/network/networkd-netdev-dummy.h \
src/network/networkd-netdev-dummy.c \
src/network/networkd-netdev-tuntap.h \
src/network/networkd-netdev-tuntap.c \
src/network/networkd-netdev-bond.h \
src/network/networkd-netdev-bond.c \
src/network/networkd-netdev-bridge.h \
src/network/networkd-netdev-bridge.c \
src/network/networkd-netdev-vcan.h \
src/network/networkd-netdev-vcan.c \
src/network/networkd-link-bus.c \
src/network/networkd-ipv4ll.c \
src/network/networkd-dhcp4.c \
@ -5654,8 +5656,6 @@ libnetworkd_core_la_SOURCES = \
src/network/networkd-address.c \
src/network/networkd-route.h \
src/network/networkd-route.c \
src/network/networkd-manager.c \
src/network/networkd-manager-bus.c \
src/network/networkd-fdb.h \
src/network/networkd-fdb.c \
src/network/networkd-brvlan.h \
@ -5670,7 +5670,7 @@ libnetworkd_core_la_SOURCES = \
nodist_libnetworkd_core_la_SOURCES = \
src/network/networkd-gperf.c \
src/network/networkd-network-gperf.c \
src/network/networkd-netdev-gperf.c
src/network/netdev/netdev-gperf.c
libnetworkd_core_la_LIBADD = \
libsystemd-network.la \
@ -5684,11 +5684,11 @@ systemd_networkd_wait_online_CFLAGS = \
systemd_networkd_wait_online_SOURCES = \
src/libsystemd-network/network-internal.h \
src/network/networkd-wait-online.h \
src/network/networkd-wait-online-link.h \
src/network/networkd-wait-online.c \
src/network/networkd-wait-online-manager.c \
src/network/networkd-wait-online-link.c
src/network/wait-online/link.h \
src/network/wait-online/link.c \
src/network/wait-online/manager.h \
src/network/wait-online/manager.c \
src/network/wait-online/wait-online.c
systemd_networkd_wait_online_LDADD = \
libsystemd-network.la \
@ -5774,7 +5774,7 @@ endif
gperf_gperf_sources += \
src/network/networkd-gperf.gperf \
src/network/networkd-network-gperf.gperf \
src/network/networkd-netdev-gperf.gperf
src/network/netdev/netdev-gperf.gperf
EXTRA_DIST += \
units/systemd-networkd.service.m4.in \

View file

@ -1,3 +1,2 @@
/networkd-network-gperf.c
/networkd-netdev-gperf.c
/networkd-gperf.c

1
src/network/netdev/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/netdev-gperf.c

View file

@ -27,7 +27,7 @@
#include "conf-parser.h"
#include "extract-word.h"
#include "missing.h"
#include "networkd-netdev-bond.h"
#include "netdev/bond.h"
#include "string-table.h"
#include "string-util.h"

View file

@ -22,7 +22,7 @@
#include "in-addr-util.h"
#include "list.h"
#include "networkd-netdev.h"
#include "netdev/netdev.h"
/*
* Maximum number of targets supported by the kernel for a single

View file

@ -22,8 +22,8 @@
#include "missing.h"
#include "netlink-util.h"
#include "networkd.h"
#include "networkd-netdev-bridge.h"
#include "netdev/bridge.h"
#include "networkd-manager.h"
/* callback for brige netdev's parameter set */
static int netdev_bridge_set_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) {

View file

@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "networkd-netdev.h"
#include "netdev/netdev.h"
typedef struct Bridge {
NetDev meta;

View file

@ -19,7 +19,7 @@
***/
#include "networkd-netdev-dummy.h"
#include "netdev/dummy.h"
const NetDevVTable dummy_vtable = {
.object_size = sizeof(Dummy),

View file

@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "networkd-netdev.h"
#include "netdev/netdev.h"
typedef struct Dummy {
NetDev meta;

View file

@ -20,7 +20,7 @@
#include <net/if.h>
#include "conf-parser.h"
#include "networkd-netdev-ipvlan.h"
#include "netdev/ipvlan.h"
#include "string-table.h"
static const char* const ipvlan_mode_table[_NETDEV_IPVLAN_MODE_MAX] = {

View file

@ -20,7 +20,7 @@
***/
#include "missing.h"
#include "networkd-netdev.h"
#include "netdev/netdev.h"
typedef enum IPVlanMode {
NETDEV_IPVLAN_MODE_L2 = IPVLAN_MODE_L2,

View file

@ -20,7 +20,7 @@
#include <net/if.h>
#include "conf-parser.h"
#include "networkd-netdev-macvlan.h"
#include "netdev/macvlan.h"
#include "string-table.h"
static const char* const macvlan_mode_table[_NETDEV_MACVLAN_MODE_MAX] = {

View file

@ -21,7 +21,7 @@
typedef struct MacVlan MacVlan;
#include "networkd-netdev.h"
#include "netdev/netdev.h"
typedef enum MacVlanMode {
NETDEV_MACVLAN_MODE_PRIVATE = MACVLAN_MODE_PRIVATE,

View file

@ -2,17 +2,17 @@
#include <stddef.h>
#include "conf-parser.h"
#include "network-internal.h"
#include "networkd-netdev-bond.h"
#include "networkd-netdev-bridge.h"
#include "networkd-netdev-ipvlan.h"
#include "networkd-netdev-macvlan.h"
#include "networkd-netdev-tunnel.h"
#include "networkd-netdev-tuntap.h"
#include "networkd-netdev-veth.h"
#include "networkd-netdev-vlan.h"
#include "networkd-netdev-vxlan.h"
#include "networkd-netdev-vrf.h"
#include "networkd-netdev.h"
#include "netdev/bond.h"
#include "netdev/bridge.h"
#include "netdev/ipvlan.h"
#include "netdev/macvlan.h"
#include "netdev/tunnel.h"
#include "netdev/tuntap.h"
#include "netdev/veth.h"
#include "netdev/vlan.h"
#include "netdev/vxlan.h"
#include "netdev/vrf.h"
#include "netdev/netdev.h"
#include "vlan-util.h"
%}
struct ConfigPerfItem;

View file

@ -26,13 +26,26 @@
#include "list.h"
#include "netlink-util.h"
#include "network-internal.h"
#include "networkd-netdev.h"
#include "networkd.h"
#include "netdev/netdev.h"
#include "networkd-manager.h"
#include "siphash24.h"
#include "stat-util.h"
#include "string-table.h"
#include "string-util.h"
#include "netdev/bridge.h"
#include "netdev/bond.h"
#include "netdev/vlan.h"
#include "netdev/macvlan.h"
#include "netdev/ipvlan.h"
#include "netdev/vxlan.h"
#include "netdev/tunnel.h"
#include "netdev/tuntap.h"
#include "netdev/veth.h"
#include "netdev/dummy.h"
#include "netdev/vrf.h"
#include "netdev/vcan.h"
const NetDevVTable * const netdev_vtable[_NETDEV_KIND_MAX] = {
[NETDEV_KIND_BRIDGE] = &bridge_vtable,
[NETDEV_KIND_BOND] = &bond_vtable,

View file

@ -28,7 +28,7 @@
#include "conf-parser.h"
#include "missing.h"
#include "networkd-link.h"
#include "networkd-netdev-tunnel.h"
#include "netdev/tunnel.h"
#include "parse-util.h"
#include "string-table.h"
#include "string-util.h"

View file

@ -21,7 +21,7 @@
#include "in-addr-util.h"
#include "networkd-netdev.h"
#include "netdev/netdev.h"
typedef enum Ip6TnlMode {
NETDEV_IP6_TNL_MODE_IP6IP6,

View file

@ -27,7 +27,7 @@
#include "alloc-util.h"
#include "fd-util.h"
#include "networkd-netdev-tuntap.h"
#include "netdev/tuntap.h"
#include "user-util.h"
#define TUN_DEV "/dev/net/tun"

View file

@ -21,7 +21,7 @@
typedef struct TunTap TunTap;
#include "networkd-netdev.h"
#include "netdev/netdev.h"
struct TunTap {
NetDev meta;

View file

@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "networkd-netdev-vcan.h"
#include "netdev/vcan.h"
const NetDevVTable vcan_vtable = {
.object_size = sizeof(VCan),

View file

@ -23,7 +23,7 @@ typedef struct VCan VCan;
#include <linux/can/netlink.h>
#include "networkd-netdev.h"
#include "netdev/netdev.h"
struct VCan {
NetDev meta;

View file

@ -22,7 +22,7 @@
#include "sd-netlink.h"
#include "networkd-netdev-veth.h"
#include "netdev/veth.h"
static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
Veth *v;

View file

@ -21,7 +21,7 @@
typedef struct Veth Veth;
#include "networkd-netdev.h"
#include "netdev/netdev.h"
struct Veth {
NetDev meta;

View file

@ -19,7 +19,7 @@
#include <net/if.h>
#include "networkd-netdev-vlan.h"
#include "netdev/vlan.h"
#include "vlan-util.h"
static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *req) {

View file

@ -21,7 +21,7 @@
typedef struct VLan VLan;
#include "networkd-netdev.h"
#include "netdev/netdev.h"
struct VLan {
NetDev meta;

View file

@ -21,7 +21,7 @@
#include "sd-netlink.h"
#include "missing.h"
#include "networkd-netdev-vrf.h"
#include "netdev/vrf.h"
static int netdev_vrf_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
Vrf *v;

View file

@ -21,7 +21,7 @@
typedef struct Vrf Vrf;
#include "networkd-netdev.h"
#include "netdev/netdev.h"
struct Vrf {
NetDev meta;

View file

@ -28,7 +28,7 @@
#include "missing.h"
#include "networkd-link.h"
#include "networkd-netdev-vxlan.h"
#include "netdev/vxlan.h"
static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
VxLan *v;

View file

@ -22,7 +22,7 @@
typedef struct VxLan VxLan;
#include "in-addr-util.h"
#include "networkd-netdev.h"
#include "netdev/netdev.h"
#define VXLAN_VID_MAX (1u << 24) - 1

View file

@ -19,7 +19,7 @@
#include "alloc-util.h"
#include "networkd-address-pool.h"
#include "networkd.h"
#include "networkd-manager.h"
#include "set.h"
#include "string-util.h"

View file

@ -24,7 +24,7 @@
#include "firewall-util.h"
#include "netlink-util.h"
#include "networkd-address.h"
#include "networkd.h"
#include "networkd-manager.h"
#include "parse-util.h"
#include "set.h"
#include "socket-util.h"

View file

@ -25,7 +25,9 @@
#include "conf-parser.h"
#include "netlink-util.h"
#include "networkd-brvlan.h"
#include "networkd.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "parse-util.h"
#include "vlan-util.h"

View file

@ -22,8 +22,10 @@
#include "conf-parser.h"
#include "def.h"
#include "dhcp-identifier.h"
#include "extract-word.h"
#include "hexdecoct.h"
#include "networkd-conf.h"
#include "networkd-network.h"
#include "string-table.h"
int manager_parse_config_file(Manager *m) {

View file

@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "networkd.h"
typedef struct Manager Manager;
int manager_parse_config_file(Manager *m);

View file

@ -24,7 +24,9 @@
#include "dhcp-lease-internal.h"
#include "hostname-util.h"
#include "network-internal.h"
#include "networkd.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
static int dhcp4_route_handler(sd_netlink *rtnl, sd_netlink_message *m,
void *userdata) {

View file

@ -23,7 +23,8 @@
#include "sd-dhcp6-client.h"
#include "network-internal.h"
#include "networkd.h"
#include "networkd-link.h"
#include "networkd-manager.h"
static int dhcp6_lease_address_acquired(sd_dhcp6_client *client, Link *link);
@ -125,7 +126,6 @@ static void dhcp6_handler(sd_dhcp6_client *client, int event, void *userdata) {
assert(link);
assert(link->network);
assert(link->manager);
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
return;

View file

@ -22,9 +22,10 @@
#include "alloc-util.h"
#include "conf-parser.h"
#include "netdev/bridge.h"
#include "netlink-util.h"
#include "networkd-fdb.h"
#include "networkd.h"
#include "networkd-manager.h"
#include "util.h"
#include "vlan-util.h"

View file

@ -2,6 +2,7 @@
#include <stddef.h>
#include "conf-parser.h"
#include "networkd-conf.h"
#include "networkd-manager.h"
%}
struct ConfigPerfItem;
%null_strings

View file

@ -21,7 +21,9 @@
#include <linux/if.h>
#include "network-internal.h"
#include "networkd.h"
#include "networkd-address.h"
#include "networkd-manager.h"
#include "networkd-link.h"
static int ipv4ll_address_lost(Link *link) {
_cleanup_address_free_ Address *address = NULL;
@ -171,7 +173,6 @@ static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata) {
assert(link);
assert(link->network);
assert(link->manager);
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
return;

View file

@ -20,7 +20,7 @@
#include "alloc-util.h"
#include "bus-util.h"
#include "networkd-link.h"
#include "networkd.h"
#include "networkd-manager.h"
#include "parse-util.h"
#include "strv.h"

View file

@ -29,8 +29,8 @@
#include "netlink-util.h"
#include "network-internal.h"
#include "networkd-lldp-tx.h"
#include "networkd-manager.h"
#include "networkd-ndisc.h"
#include "networkd.h"
#include "set.h"
#include "socket-util.h"
#include "stdio-util.h"
@ -2632,7 +2632,7 @@ static int link_initialized_and_synced(sd_netlink *rtnl, sd_netlink_message *m,
log_link_debug(link, "Ignoring DHCP server for loopback link");
}
r = network_apply(link->manager, network, link);
r = network_apply(network, link);
if (r < 0)
return r;
}
@ -2728,7 +2728,7 @@ static int link_load(Link *link) {
goto network_file_fail;
}
r = network_apply(link->manager, network, link);
r = network_apply(network, link);
if (r < 0)
return log_link_error_errno(link, r, "Failed to apply network %s: %m", basename(network_file));
}

View file

@ -26,7 +26,7 @@
#include "fileio.h"
#include "hostname-util.h"
#include "networkd-lldp-tx.h"
#include "networkd.h"
#include "networkd-manager.h"
#include "parse-util.h"
#include "random-util.h"
#include "socket-util.h"

View file

@ -19,7 +19,7 @@
#include "alloc-util.h"
#include "bus-util.h"
#include "networkd.h"
#include "networkd-manager.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_operational_state, link_operstate, LinkOperationalState);

View file

@ -33,7 +33,7 @@
#include "libudev-private.h"
#include "local-addresses.h"
#include "netlink-util.h"
#include "networkd.h"
#include "networkd-manager.h"
#include "ordered-set.h"
#include "path-util.h"
#include "set.h"

View file

@ -32,20 +32,7 @@
#include "networkd-address-pool.h"
#include "networkd-link.h"
#include "networkd-netdev-bond.h"
#include "networkd-netdev-bridge.h"
#include "networkd-netdev-dummy.h"
#include "networkd-netdev-ipvlan.h"
#include "networkd-netdev-macvlan.h"
#include "networkd-netdev-tunnel.h"
#include "networkd-netdev-tuntap.h"
#include "networkd-netdev-veth.h"
#include "networkd-netdev-vlan.h"
#include "networkd-netdev-vrf.h"
#include "networkd-netdev-vxlan.h"
#include "networkd-netdev-vcan.h"
#include "networkd-network.h"
#include "networkd-util.h"
extern const char* const network_dirs[];

View file

@ -18,11 +18,12 @@
***/
#include <netinet/icmp6.h>
#include <arpa/inet.h>
#include "sd-ndisc.h"
#include "networkd.h"
#include "networkd-ndisc.h"
#include "networkd-route.h"
#define NDISC_DNSSL_MAX 64U
#define NDISC_RDNSS_MAX 64U

View file

@ -18,7 +18,7 @@
***/
#include "alloc-util.h"
#include "networkd.h"
#include "networkd-manager.h"
#include "string-util.h"
#include "strv.h"

View file

@ -1,8 +1,8 @@
%{
#include <stddef.h>
#include "conf-parser.h"
#include "networkd.h"
#include "networkd-conf.h"
#include "networkd-network.h"
#include "network-internal.h"
#include "vlan-util.h"
%}

View file

@ -27,8 +27,8 @@
#include "fd-util.h"
#include "hostname-util.h"
#include "network-internal.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd.h"
#include "parse-util.h"
#include "set.h"
#include "stat-util.h"
@ -368,10 +368,9 @@ int network_get(Manager *manager, struct udev_device *device,
return -ENOENT;
}
int network_apply(Manager *manager, Network *network, Link *link) {
int network_apply(Network *network, Link *link) {
int r;
assert(manager);
assert(network);
assert(link);

View file

@ -31,9 +31,9 @@
#include "networkd-brvlan.h"
#include "networkd-fdb.h"
#include "networkd-lldp-tx.h"
#include "networkd-netdev.h"
#include "networkd-route.h"
#include "networkd-util.h"
#include "netdev/netdev.h"
#define DHCP_ROUTE_METRIC 1024
#define IPV4LL_ROUTE_METRIC 2048
@ -213,7 +213,7 @@ int network_load(Manager *manager);
int network_get_by_name(Manager *manager, const char *name, Network **ret);
int network_get(Manager *manager, struct udev_device *device, const char *ifname, const struct ether_addr *mac, Network **ret);
int network_apply(Manager *manager, Network *network, Link *link);
int network_apply(Network *network, Link *link);
bool network_has_static_ipv6_addresses(Network *network);

View file

@ -21,8 +21,8 @@
#include "conf-parser.h"
#include "in-addr-util.h"
#include "netlink-util.h"
#include "networkd-manager.h"
#include "networkd-route.h"
#include "networkd.h"
#include "parse-util.h"
#include "set.h"
#include "string-util.h"

View file

@ -20,8 +20,8 @@
#include "sd-daemon.h"
#include "capability-util.h"
#include "networkd.h"
#include "networkd-conf.h"
#include "networkd-manager.h"
#include "signal-util.h"
#include "user-util.h"

View file

@ -2,9 +2,11 @@
#include "dhcp6-protocol.h"
#include "ethtool-util.h"
#include "netlink-internal.h"
#include "networkd-netdev-bond.h"
#include "networkd-netdev-macvlan.h"
#include "networkd.h"
#include "netdev/bond.h"
#include "netdev/ipvlan.h"
#include "netdev/macvlan.h"
#include "networkd-link.h"
#include "networkd-util.h"
#include "test-tables.h"
int main(int argc, char **argv) {

View file

@ -20,7 +20,7 @@
#include "alloc-util.h"
#include "dhcp-lease-internal.h"
#include "network-internal.h"
#include "networkd.h"
#include "networkd-manager.h"
static void test_deserialize_in_addr(void) {
_cleanup_free_ struct in_addr *addresses = NULL;

View file

@ -21,7 +21,9 @@
#include "sd-network.h"
#include "alloc-util.h"
#include "networkd-wait-online-link.h"
#include "hashmap.h"
#include "link.h"
#include "manager.h"
#include "string-util.h"
int link_new(Manager *m, Link **ret, int ifindex, const char *ifname) {

View file

@ -20,9 +20,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
typedef struct Link Link;
#include "sd-netlink.h"
#include "networkd-wait-online.h"
typedef struct Link Link;
typedef struct Manager Manager;
struct Link {
Manager *manager;

View file

@ -22,10 +22,10 @@
#include <fnmatch.h>
#include "alloc-util.h"
#include "link.h"
#include "manager.h"
#include "netlink-util.h"
#include "network-internal.h"
#include "networkd-wait-online-link.h"
#include "networkd-wait-online.h"
#include "time-util.h"
#include "util.h"

View file

@ -26,8 +26,7 @@
#include "hashmap.h"
typedef struct Manager Manager;
#include "networkd-wait-online-link.h"
typedef struct Link Link;
struct Manager {
Hashmap *links;

View file

@ -22,7 +22,7 @@
#include "sd-daemon.h"
#include "networkd-wait-online.h"
#include "manager.h"
#include "signal-util.h"
#include "strv.h"