]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
0ef6f454 LP |
2 | #pragma once |
3 | ||
3a67e927 | 4 | #include "sd-event.h" |
1c4baffc | 5 | #include "sd-netlink.h" |
7de12ae7 | 6 | #include "sd-network.h" |
3a67e927 | 7 | |
7de12ae7 | 8 | #include "hashmap.h" |
f023184e | 9 | #include "network-util.h" |
ca78ad1d | 10 | #include "time-util.h" |
3a67e927 | 11 | |
79b1f37d | 12 | typedef struct Manager Manager; |
c5fcf6e4 | 13 | typedef struct Link Link; |
79b1f37d TG |
14 | |
15 | struct Manager { | |
7de12ae7 TG |
16 | Hashmap *links; |
17 | Hashmap *links_by_name; | |
18 | ||
f023184e YW |
19 | /* Do not free the two members below. */ |
20 | Hashmap *interfaces; | |
79b1f37d | 21 | char **ignore; |
7de12ae7 | 22 | |
f023184e | 23 | LinkOperationalState required_operstate; |
2f9859ba | 24 | bool any; |
f023184e | 25 | |
1c4baffc | 26 | sd_netlink *rtnl; |
7de12ae7 TG |
27 | sd_event_source *rtnl_event_source; |
28 | ||
29 | sd_network_monitor *network_monitor; | |
30 | sd_event_source *network_monitor_event_source; | |
31 | ||
32 | sd_event *event; | |
79b1f37d | 33 | }; |
3a67e927 TG |
34 | |
35 | void manager_free(Manager *m); | |
f023184e | 36 | int manager_new(Manager **ret, Hashmap *interfaces, char **ignore, |
2f9859ba YW |
37 | LinkOperationalState required_operstate, |
38 | bool any, usec_t timeout); | |
3a67e927 TG |
39 | |
40 | DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free); | |
7de12ae7 | 41 | |
2f9859ba | 42 | bool manager_configured(Manager *m); |