]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-neighbor.h
Merge pull request #20738 from mrc0mmand/ci-llvm-13
[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 NetworkConfigSource source;
28 NetworkConfigState state;
29
30 int family;
31 union in_addr_union in_addr;
32 union lladdr_union lladdr;
33 size_t lladdr_size;
34 } Neighbor;
35
36 Neighbor *neighbor_free(Neighbor *neighbor);
37
38 void neighbor_hash_func(const Neighbor *neighbor, struct siphash *state);
39 int neighbor_compare_func(const Neighbor *a, const Neighbor *b);
40
41 void network_drop_invalid_neighbors(Network *network);
42
43 int link_drop_neighbors(Link *link);
44 int link_drop_foreign_neighbors(Link *link);
45
46 int link_request_static_neighbors(Link *link);
47 int request_process_neighbor(Request *req);
48
49 int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
50
51 DEFINE_NETWORK_CONFIG_STATE_FUNCTIONS(Neighbor, neighbor);
52
53 CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_address);
54 CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_hwaddr);
55 CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_lladdr);