]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: cleanup headers included in networkd-nexthop.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Sep 2020 08:47:28 +0000 (17:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Oct 2020 17:39:51 +0000 (02:39 +0900)
src/network/networkd-link.c
src/network/networkd-manager.c
src/network/networkd-network-gperf.gperf
src/network/networkd-network.c
src/network/networkd-network.h
src/network/networkd-nexthop.c
src/network/networkd-nexthop.h

index dca9b1550cc13d7eba02052f2935717e1b1d6f5a..e5d51f1572905d1ac15ee0b8647e51294cc62527 100644 (file)
@@ -32,6 +32,7 @@
 #include "networkd-manager.h"
 #include "networkd-ndisc.h"
 #include "networkd-neighbor.h"
+#include "networkd-nexthop.h"
 #include "networkd-sriov.h"
 #include "networkd-radv.h"
 #include "networkd-routing-policy-rule.h"
index 94b036e81e32b0c1618804a5c86214e22b58cdd6..0a0fb36f95adb0a8d5bfc70982a244451ea355b4 100644 (file)
@@ -30,6 +30,7 @@
 #include "networkd-manager-bus.h"
 #include "networkd-manager.h"
 #include "networkd-network-bus.h"
+#include "networkd-nexthop.h"
 #include "networkd-routing-policy-rule.h"
 #include "networkd-speed-meter.h"
 #include "ordered-set.h"
index b3f3a22d0724169ce3428706bb68cd4ab7232b61..25a7b8991a91bbb29baf1e945e9f8548e1c297b6 100644 (file)
@@ -15,6 +15,7 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
 #include "networkd-ipv4ll.h"
 #include "networkd-ndisc.h"
 #include "networkd-network.h"
+#include "networkd-nexthop.h"
 #include "networkd-routing-policy-rule.h"
 #include "networkd-sriov.h"
 #include "qdisc.h"
index d8831561c4f46314c186db9c858ce33bf670c0eb..d04d523c323fc575cb842e1c29eba35d8023fc2f 100644 (file)
@@ -16,6 +16,7 @@
 #include "network-internal.h"
 #include "networkd-manager.h"
 #include "networkd-network.h"
+#include "networkd-nexthop.h"
 #include "networkd-routing-policy-rule.h"
 #include "networkd-sriov.h"
 #include "parse-util.h"
index c92b7518661d9a17e6c0350f8efd41b8286700a7..12ec6ef1b2ba56637805f20b175a363643d49b7d 100644 (file)
@@ -26,7 +26,6 @@
 #include "networkd-mdb.h"
 #include "networkd-ndisc.h"
 #include "networkd-neighbor.h"
-#include "networkd-nexthop.h"
 #include "networkd-radv.h"
 #include "networkd-route.h"
 #include "networkd-util.h"
index 6c9d1c57dd69fac5a5457f5bb1901b0b8eb5d891..4f40883e54343108ba94d012df6273f03b34ffc2 100644 (file)
@@ -5,19 +5,18 @@
 #include <linux/nexthop.h>
 
 #include "alloc-util.h"
-#include "conf-parser.h"
-#include "in-addr-util.h"
 #include "netlink-util.h"
+#include "networkd-link.h"
 #include "networkd-manager.h"
+#include "networkd-network.h"
 #include "networkd-nexthop.h"
 #include "parse-util.h"
 #include "set.h"
 #include "string-util.h"
-#include "util.h"
 
-void nexthop_free(NextHop *nexthop) {
+NextHop *nexthop_free(NextHop *nexthop) {
         if (!nexthop)
-                return;
+                return NULL;
 
         if (nexthop->network) {
                 assert(nexthop->section);
@@ -31,7 +30,7 @@ void nexthop_free(NextHop *nexthop) {
                 set_remove(nexthop->link->nexthops_foreign, nexthop);
         }
 
-        free(nexthop);
+        return mfree(nexthop);
 }
 
 DEFINE_NETWORK_SECTION_FUNCTIONS(NextHop, nexthop_free);
index 2ff8b4b81e8c27598e9e9b3de49f0c665a5b2060..7d1705904ff9ac575c7e6eb6449aecab09c184d2 100644 (file)
@@ -4,16 +4,19 @@
 
 #pragma once
 
-#include "conf-parser.h"
-#include "macro.h"
+#include <inttypes.h>
 
-typedef struct NextHop NextHop;
-typedef struct NetworkConfigSection NetworkConfigSection;
+#include "sd-netlink.h"
 
-#include "networkd-network.h"
+#include "conf-parser.h"
+#include "in-addr-util.h"
 #include "networkd-util.h"
 
-struct NextHop {
+typedef struct Link Link;
+typedef struct Manager Manager;
+typedef struct Network Network;
+
+typedef struct NextHop {
         Network *network;
         NetworkConfigSection *section;
 
@@ -26,15 +29,14 @@ struct NextHop {
         uint32_t id;
 
         union in_addr_union gw;
-};
+} NextHop;
 
-void nexthop_free(NextHop *nexthop);
+NextHop *nexthop_free(NextHop *nexthop);
+int nexthop_section_verify(NextHop *nexthop);
 
 int link_set_nexthop(Link *link);
 
 int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
 
-int nexthop_section_verify(NextHop *nexthop);
-
 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_id);
 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_gateway);