]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-neighbor.h
network: expose hash and compare functions
[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 union lladdr_union {
19 struct ether_addr mac;
20 union in_addr_union ip;
21 };
22
23 typedef struct Neighbor {
24 Network *network;
25 Link *link;
26 NetworkConfigSection *section;
27
28 int family;
29 union in_addr_union in_addr;
30 union lladdr_union lladdr;
31 size_t lladdr_size;
32 } Neighbor;
33
34 Neighbor *neighbor_free(Neighbor *neighbor);
35
36 void neighbor_hash_func(const Neighbor *neighbor, struct siphash *state);
37 int neighbor_compare_func(const Neighbor *a, const Neighbor *b);
38
39 void network_drop_invalid_neighbors(Network *network);
40
41 int link_drop_neighbors(Link *link);
42 int link_drop_foreign_neighbors(Link *link);
43
44 int link_request_static_neighbors(Link *link);
45 int request_process_neighbor(Request *req);
46
47 int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
48
49 CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_address);
50 CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_hwaddr);
51 CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_lladdr);