summaryrefslogtreecommitdiff
path: root/src/network/networkd-neighbor.h
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2018-11-28 19:00:58 -0800
committerWilliam A. Kennington III <william@wkennington.com>2018-12-09 16:56:37 -0800
commite4a71bf36f422c3728b902aaa5846add7bbc0eb9 (patch)
tree77b9e8834eed5833a749c3d76c617586e5557348 /src/network/networkd-neighbor.h
parent289e6774d0daefe86771171b8f4f97b63354683e (diff)
downloadsystemd-e4a71bf36f422c3728b902aaa5846add7bbc0eb9.tar.gz
systemd-e4a71bf36f422c3728b902aaa5846add7bbc0eb9.tar.bz2
systemd-e4a71bf36f422c3728b902aaa5846add7bbc0eb9.zip
networkd: Static neighbor support
When using networkd we currently have no way of ensuring that static neighbor entries are set when our link comes up. This change adds a new section to the network definition that allows multiple static neighbors to be set on a link.
Diffstat (limited to 'src/network/networkd-neighbor.h')
-rw-r--r--src/network/networkd-neighbor.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/network/networkd-neighbor.h b/src/network/networkd-neighbor.h
new file mode 100644
index 0000000000..094bf7977e
--- /dev/null
+++ b/src/network/networkd-neighbor.h
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#include "sd-netlink.h"
+
+#include "conf-parser.h"
+#include "ether-addr-util.h"
+#include "in-addr-util.h"
+#include "list.h"
+#include "macro.h"
+
+typedef struct Neighbor Neighbor;
+
+#include "networkd-link.h"
+#include "networkd-network.h"
+
+struct Neighbor {
+ Network *network;
+ Link *link;
+ NetworkConfigSection *section;
+
+ int family;
+ union in_addr_union in_addr;
+ bool mac_configured;
+ struct ether_addr mac;
+
+ LIST_FIELDS(Neighbor, neighbors);
+};
+
+void neighbor_free(Neighbor *neighbor);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(Neighbor*, neighbor_free);
+
+int neighbor_configure(Neighbor *neighbor, Link *link, link_netlink_message_handler_t callback);
+
+CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_address);
+CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_hwaddr);