]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
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 { | |
5f200833 | 16 | Hashmap *links_by_index; |
7de12ae7 TG |
17 | Hashmap *links_by_name; |
18 | ||
f023184e | 19 | /* Do not free the two members below. */ |
5f200833 YW |
20 | Hashmap *command_line_interfaces_by_name; |
21 | char **ignored_interfaces; | |
7de12ae7 | 22 | |
75cd4a5d | 23 | LinkOperationalStateRange required_operstate; |
6dc4531d | 24 | AddressFamily required_family; |
2f9859ba | 25 | bool any; |
f023184e | 26 | |
1c4baffc | 27 | sd_netlink *rtnl; |
7de12ae7 TG |
28 | sd_event_source *rtnl_event_source; |
29 | ||
30 | sd_network_monitor *network_monitor; | |
31 | sd_event_source *network_monitor_event_source; | |
32 | ||
33 | sd_event *event; | |
79b1f37d | 34 | }; |
3a67e927 | 35 | |
75db809a | 36 | Manager* manager_free(Manager *m); |
5f200833 | 37 | int manager_new(Manager **ret, Hashmap *command_line_interfaces_by_name, char **ignored_interfaces, |
75cd4a5d | 38 | LinkOperationalStateRange required_operstate, |
6dc4531d | 39 | AddressFamily required_family, |
2f9859ba | 40 | bool any, usec_t timeout); |
3a67e927 TG |
41 | |
42 | DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free); | |
7de12ae7 | 43 | |
2f9859ba | 44 | bool manager_configured(Manager *m); |