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; 11 typedef struct Address Address; 12 13 unsigned routes_max(void); 14 15 int manager_find_uplink(Manager *m, int family, Link *exclude, Link **ret); 16 17 bool gateway_is_ready(Link *link, bool onlink, int family, const union in_addr_union *gw); 18 19 int link_address_is_reachable( 20 Link *link, 21 int family, 22 const union in_addr_union *address, 23 const union in_addr_union *prefsrc, /* optional */ 24 Address **ret); 25 26 int manager_address_is_reachable( 27 Manager *manager, 28 int family, 29 const union in_addr_union *address, 30 const union in_addr_union *prefsrc, /* optional */ 31 Address **ret); 32 33 int route_type_from_string(const char *s) _pure_; 34 const char *route_type_to_string(int t) _const_; 35 36 int route_scope_from_string(const char *s); 37 int route_scope_to_string_alloc(int t, char **ret); 38 39 int route_protocol_from_string(const char *s); 40 int route_protocol_to_string_alloc(int t, char **ret); 41 int route_protocol_full_from_string(const char *s); 42 int route_protocol_full_to_string_alloc(int t, char **ret); 43 44 int route_flags_to_string_alloc(uint32_t flags, char **ret); 45 46 int manager_get_route_table_from_string(const Manager *m, const char *table, uint32_t *ret); 47 int manager_get_route_table_to_string(const Manager *m, uint32_t table, char **ret); 48 49 CONFIG_PARSER_PROTOTYPE(config_parse_route_table_names); 50