]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
e4a71bf3 WKI |
2 | #pragma once |
3 | ||
1939ebeb YW |
4 | #include <stdbool.h> |
5 | ||
e4a71bf3 WKI |
6 | #include "sd-netlink.h" |
7 | ||
8 | #include "conf-parser.h" | |
9 | #include "ether-addr-util.h" | |
10 | #include "in-addr-util.h" | |
fcbf4cb7 | 11 | #include "networkd-util.h" |
e4a71bf3 | 12 | |
40ca350e YW |
13 | typedef struct Link Link; |
14 | typedef struct Manager Manager; | |
15 | typedef struct Network Network; | |
1939ebeb | 16 | |
1939ebeb | 17 | typedef struct Neighbor { |
e4a71bf3 WKI |
18 | Network *network; |
19 | Link *link; | |
307fe3cd | 20 | ConfigSection *section; |
193c4af9 YW |
21 | NetworkConfigSource source; |
22 | NetworkConfigState state; | |
e4a71bf3 | 23 | |
2a75f23b YW |
24 | unsigned n_ref; |
25 | ||
e4a71bf3 WKI |
26 | int family; |
27 | union in_addr_union in_addr; | |
17193d76 | 28 | struct hw_addr_data ll_addr; |
1939ebeb | 29 | } Neighbor; |
e4a71bf3 | 30 | |
2a75f23b YW |
31 | Neighbor* neighbor_ref(Neighbor *neighbor); |
32 | Neighbor* neighbor_unref(Neighbor *neighbor); | |
78ada14f | 33 | |
c902fa08 YW |
34 | int neighbor_get(Link *link, const Neighbor *in, Neighbor **ret); |
35 | int neighbor_remove(Neighbor *neighbor, Link *link); | |
36 | ||
aa9626ee | 37 | int network_drop_invalid_neighbors(Network *network); |
e4a71bf3 | 38 | |
a0e99a37 | 39 | int link_drop_managed_neighbors(Link *link); |
59048336 | 40 | int link_drop_foreign_neighbors(Link *link); |
b4564f4e | 41 | void link_foreignize_neighbors(Link *link); |
58f1fe9a | 42 | |
40ca350e | 43 | int link_request_static_neighbors(Link *link); |
40ca350e | 44 | |
eab052d2 YW |
45 | int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, Manager *m); |
46 | ||
193c4af9 YW |
47 | DEFINE_NETWORK_CONFIG_STATE_FUNCTIONS(Neighbor, neighbor); |
48 | ||
e4a71bf3 | 49 | CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_address); |
b956364d | 50 | CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_lladdr); |