| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "networkd-forward.h" |
| 5 |
|
| 6 |
unsigned routes_max(void); |
| 7 |
|
| 8 |
bool route_type_is_reject(uint8_t type); |
| 9 |
bool route_is_reject(const Route *route); |
| 10 |
|
| 11 |
bool link_find_default_gateway(Link *link, int family, Route **gw); |
| 12 |
static inline bool link_has_default_gateway(Link *link, int family) { |
| 13 |
return link_find_default_gateway(link, family, NULL); |
| 14 |
} |
| 15 |
|
| 16 |
int manager_find_uplink(Manager *m, int family, Link *exclude, Link **ret); |
| 17 |
|
| 18 |
bool gateway_is_ready(Link *link, bool onlink, int family, const union in_addr_union *gw); |
| 19 |
|
| 20 |
int link_address_is_reachable( |
| 21 |
Link *link, |
| 22 |
int family, |
| 23 |
const union in_addr_union *address, |
| 24 |
const union in_addr_union *prefsrc, /* optional */ |
| 25 |
Address **ret); |
| 26 |
|
| 27 |
int manager_address_is_reachable( |
| 28 |
Manager *manager, |
| 29 |
int family, |
| 30 |
const union in_addr_union *address, |
| 31 |
const union in_addr_union *prefsrc, /* optional */ |
| 32 |
Address **ret); |
| 33 |
|
| 34 |
DECLARE_STRING_TABLE_LOOKUP(route_type, int); |
| 35 |
|
| 36 |
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(route_scope, int); |
| 37 |
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(route_scope, int); |
| 38 |
|
| 39 |
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(route_protocol, int); |
| 40 |
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(route_protocol, int); |
| 41 |
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(route_protocol_full, int); |
| 42 |
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(route_protocol_full, int); |
| 43 |
|
| 44 |
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(route_flags, uint32_t); |
| 45 |
|
| 46 |
int manager_get_route_table_from_string(const Manager *m, const char *s, uint32_t *ret); |
| 47 |
int manager_get_route_table_to_string(const Manager *m, uint32_t table, bool append_num, char **ret); |
| 48 |
|
| 49 |
CONFIG_PARSER_PROTOTYPE(config_parse_route_table_names); |