]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-neighbor.h
network: rename NetworkConfigSection -> ConfigSection
[thirdparty/systemd.git] / src / network / networkd-neighbor.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include <stdbool.h>
5
6 #include "sd-netlink.h"
7
8 #include "conf-parser.h"
9 #include "ether-addr-util.h"
10 #include "in-addr-util.h"
11 #include "networkd-util.h"
12
13 typedef struct Link Link;
14 typedef struct Manager Manager;
15 typedef struct Network Network;
16 typedef struct Request Request;
17
18 typedef struct Neighbor {
19 Network *network;
20 Link *link;
21 ConfigSection *section;
22 NetworkConfigSource source;
23 NetworkConfigState state;
24
25 int family;
26 union in_addr_union in_addr;
27 struct hw_addr_data ll_addr;
28 } Neighbor;
29
30 Neighbor *neighbor_free(Neighbor *neighbor);
31
32 void neighbor_hash_func(const Neighbor *neighbor, struct siphash *state);
33 int neighbor_compare_func(const Neighbor *a, const Neighbor *b);
34
35 void network_drop_invalid_neighbors(Network *network);
36
37 int link_drop_neighbors(Link *link);
38 int link_drop_foreign_neighbors(Link *link);
39 void link_foreignize_neighbors(Link *link);
40
41 int link_request_static_neighbors(Link *link);
42 int request_process_neighbor(Request *req);
43
44 int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
45
46 DEFINE_NETWORK_CONFIG_STATE_FUNCTIONS(Neighbor, neighbor);
47
48 CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_address);
49 CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_lladdr);