]>
Commit | Line | Data |
---|---|---|
344b3cff YW |
1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | #pragma once | |
3 | ||
4 | #include <inttypes.h> | |
5 | #include <stdbool.h> | |
6 | ||
7 | #include "conf-parser.h" | |
8 | ||
9 | typedef struct Link Link; | |
10 | typedef struct Manager Manager; | |
8b7615f9 | 11 | typedef struct Address Address; |
fc35a9f8 | 12 | typedef struct Route Route; |
344b3cff YW |
13 | |
14 | unsigned routes_max(void); | |
15 | ||
b9f29e9f YW |
16 | bool route_type_is_reject(const Route *route); |
17 | ||
fc35a9f8 YW |
18 | bool link_find_default_gateway(Link *link, int family, Route **gw); |
19 | static inline bool link_has_default_gateway(Link *link, int family) { | |
20 | return link_find_default_gateway(link, family, NULL); | |
21 | } | |
22 | ||
344b3cff YW |
23 | int manager_find_uplink(Manager *m, int family, Link *exclude, Link **ret); |
24 | ||
25 | bool gateway_is_ready(Link *link, bool onlink, int family, const union in_addr_union *gw); | |
26 | ||
8b7615f9 YW |
27 | int link_address_is_reachable( |
28 | Link *link, | |
29 | int family, | |
30 | const union in_addr_union *address, | |
31 | const union in_addr_union *prefsrc, /* optional */ | |
32 | Address **ret); | |
33 | ||
34 | int manager_address_is_reachable( | |
35 | Manager *manager, | |
36 | int family, | |
37 | const union in_addr_union *address, | |
38 | const union in_addr_union *prefsrc, /* optional */ | |
39 | Address **ret); | |
40 | ||
344b3cff YW |
41 | int route_type_from_string(const char *s) _pure_; |
42 | const char *route_type_to_string(int t) _const_; | |
43 | ||
44 | int route_scope_from_string(const char *s); | |
45 | int route_scope_to_string_alloc(int t, char **ret); | |
46 | ||
47 | int route_protocol_from_string(const char *s); | |
48 | int route_protocol_to_string_alloc(int t, char **ret); | |
49 | int route_protocol_full_from_string(const char *s); | |
50 | int route_protocol_full_to_string_alloc(int t, char **ret); | |
51 | ||
18b23bd4 YW |
52 | int route_flags_to_string_alloc(uint32_t flags, char **ret); |
53 | ||
344b3cff | 54 | int manager_get_route_table_from_string(const Manager *m, const char *table, uint32_t *ret); |
f4defbdc | 55 | int manager_get_route_table_to_string(const Manager *m, uint32_t table, bool append_num, char **ret); |
344b3cff YW |
56 | |
57 | CONFIG_PARSER_PROTOTYPE(config_parse_route_table_names); |