#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"
#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"
#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"
#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"
#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"
#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);
set_remove(nexthop->link->nexthops_foreign, nexthop);
}
- free(nexthop);
+ return mfree(nexthop);
}
DEFINE_NETWORK_SECTION_FUNCTIONS(NextHop, nexthop_free);
#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;
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);