]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/network/networkd-neighbor.h
network: move link_request_set_neighbors() to networkd-neighbor.c
[thirdparty/systemd.git] / src / network / networkd-neighbor.h
CommitLineData
e4a71bf3
WKI
1/* SPDX-License-Identifier: LGPL-2.1+ */
2#pragma once
3
4#include "sd-netlink.h"
5
6#include "conf-parser.h"
7#include "ether-addr-util.h"
8#include "in-addr-util.h"
9#include "list.h"
10#include "macro.h"
11
12typedef struct Neighbor Neighbor;
13
14#include "networkd-link.h"
15#include "networkd-network.h"
fcbf4cb7 16#include "networkd-util.h"
e4a71bf3 17
d1bdafd2
WKI
18union lladdr_union {
19 struct ether_addr mac;
20 union in_addr_union ip;
21};
22
e4a71bf3
WKI
23struct Neighbor {
24 Network *network;
25 Link *link;
26 NetworkConfigSection *section;
27
28 int family;
29 union in_addr_union in_addr;
d1bdafd2 30 union lladdr_union lladdr;
f9ab224e 31 size_t lladdr_size;
e4a71bf3
WKI
32
33 LIST_FIELDS(Neighbor, neighbors);
34};
35
36void neighbor_free(Neighbor *neighbor);
37
fcbf4cb7 38DEFINE_NETWORK_SECTION_FUNCTIONS(Neighbor, neighbor_free);
e4a71bf3
WKI
39
40int neighbor_configure(Neighbor *neighbor, Link *link, link_netlink_message_handler_t callback);
d1bdafd2
WKI
41int neighbor_remove(Neighbor *neighbor, Link *link, link_netlink_message_handler_t callback);
42
43int neighbor_get(Link *link, int family, const union in_addr_union *addr, const union lladdr_union *lladdr, size_t lladdr_size, Neighbor **ret);
44int neighbor_add(Link *link, int family, const union in_addr_union *addr, const union lladdr_union *lladdr, size_t lladdr_size, Neighbor **ret);
45int neighbor_add_foreign(Link *link, int family, const union in_addr_union *addr, const union lladdr_union *lladdr, size_t lladdr_size, Neighbor **ret);
46bool neighbor_equal(const Neighbor *n1, const Neighbor *n2);
e4a71bf3 47
044d4b40
YW
48int neighbor_section_verify(Neighbor *neighbor);
49
58f1fe9a
YW
50int link_set_neighbors(Link *link);
51
e4a71bf3
WKI
52CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_address);
53CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_hwaddr);
b956364d 54CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_lladdr);