From: Yu Watanabe Date: Tue, 29 Sep 2020 16:40:03 +0000 (+0900) Subject: network: cleanup networkd-address-label.h X-Git-Tag: v247-rc1~117^2~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb486c90824b054b8f3ca028bce953e7c09037be;p=thirdparty%2Fsystemd.git network: cleanup networkd-address-label.h --- diff --git a/src/network/networkd-address-label.c b/src/network/networkd-address-label.c index b48e997782a..e83665bfda8 100644 --- a/src/network/networkd-address-label.c +++ b/src/network/networkd-address-label.c @@ -4,12 +4,12 @@ #include #include "alloc-util.h" -#include "conf-parser.h" -#include "networkd-address-label.h" #include "netlink-util.h" +#include "networkd-address-label.h" +#include "networkd-link.h" #include "networkd-manager.h" +#include "networkd-network.h" #include "parse-util.h" -#include "socket-util.h" AddressLabel *address_label_free(AddressLabel *label) { if (!label) @@ -24,6 +24,8 @@ AddressLabel *address_label_free(AddressLabel *label) { return mfree(label); } +DEFINE_NETWORK_SECTION_FUNCTIONS(AddressLabel, address_label_free); + static int address_label_new_static(Network *network, const char *filename, unsigned section_line, AddressLabel **ret) { _cleanup_(network_config_section_freep) NetworkConfigSection *n = NULL; _cleanup_(address_label_freep) AddressLabel *label = NULL; diff --git a/src/network/networkd-address-label.h b/src/network/networkd-address-label.h index dde6877eefb..aacab867e7a 100644 --- a/src/network/networkd-address-label.h +++ b/src/network/networkd-address-label.h @@ -2,35 +2,25 @@ #pragma once #include -#include #include "conf-parser.h" #include "in-addr-util.h" - -typedef struct AddressLabel AddressLabel; - -#include "networkd-link.h" -#include "networkd-network.h" #include "networkd-util.h" typedef struct Network Network; typedef struct Link Link; -typedef struct NetworkConfigSection NetworkConfigSection; -struct AddressLabel { +typedef struct AddressLabel { Network *network; NetworkConfigSection *section; unsigned char prefixlen; uint32_t label; - union in_addr_union in_addr; -}; +} AddressLabel; AddressLabel *address_label_free(AddressLabel *label); -DEFINE_NETWORK_SECTION_FUNCTIONS(AddressLabel, address_label_free); - void network_verify_address_labels(Network *network); int link_set_address_labels(Link *link); diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index fd339e289a1..b94e4945f31 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -20,6 +20,7 @@ #include "missing_network.h" #include "netlink-util.h" #include "network-internal.h" +#include "networkd-address-label.h" #include "networkd-can.h" #include "networkd-dhcp-server.h" #include "networkd-dhcp4.h" diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 444b6fce9c9..648e882a292 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -6,6 +6,7 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") #include "conf-parser.h" #include "netem.h" #include "network-internal.h" +#include "networkd-address-label.h" #include "networkd-can.h" #include "networkd-conf.h" #include "networkd-dhcp-common.h" diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index d5b60e82603..95f3f653945 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -14,6 +14,7 @@ #include "in-addr-util.h" #include "networkd-dhcp-server.h" #include "network-internal.h" +#include "networkd-address-label.h" #include "networkd-manager.h" #include "networkd-neighbor.h" #include "networkd-network.h" diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index 4f05b92b3e9..c129338569f 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -12,7 +12,6 @@ #include "conf-parser.h" #include "hashmap.h" #include "netdev.h" -#include "networkd-address-label.h" #include "networkd-address.h" #include "networkd-brvlan.h" #include "networkd-dhcp-common.h"