network: move link_get_xxx_route_table()
This commit is contained in:
parent
bfbf150ee6
commit
ac49887e8c
|
@ -54,24 +54,6 @@
|
|||
#include "util.h"
|
||||
#include "vrf.h"
|
||||
|
||||
uint32_t link_get_vrf_table(Link *link) {
|
||||
return link->network->vrf ? VRF(link->network->vrf)->table : RT_TABLE_MAIN;
|
||||
}
|
||||
|
||||
uint32_t link_get_dhcp_route_table(Link *link) {
|
||||
/* When the interface is part of an VRF use the VRFs routing table, unless
|
||||
* another table is explicitly specified. */
|
||||
if (link->network->dhcp_route_table_set)
|
||||
return link->network->dhcp_route_table;
|
||||
return link_get_vrf_table(link);
|
||||
}
|
||||
|
||||
uint32_t link_get_ipv6_accept_ra_route_table(Link *link) {
|
||||
if (link->network->ipv6_accept_ra_route_table_set)
|
||||
return link->network->ipv6_accept_ra_route_table;
|
||||
return link_get_vrf_table(link);
|
||||
}
|
||||
|
||||
DUID* link_get_duid(Link *link) {
|
||||
if (link->network->duid.type != _DUID_TYPE_INVALID)
|
||||
return &link->network->duid;
|
||||
|
|
|
@ -236,10 +236,6 @@ int link_stop_clients(Link *link, bool may_keep_dhcp);
|
|||
const char* link_state_to_string(LinkState s) _const_;
|
||||
LinkState link_state_from_string(const char *s) _pure_;
|
||||
|
||||
uint32_t link_get_vrf_table(Link *link);
|
||||
uint32_t link_get_dhcp_route_table(Link *link);
|
||||
uint32_t link_get_ipv6_accept_ra_route_table(Link *link);
|
||||
|
||||
int link_reconfigure(Link *link, bool force);
|
||||
|
||||
int log_link_message_full_errno(Link *link, sd_netlink_message *m, int level, int err, const char *msg);
|
||||
|
|
|
@ -21,6 +21,24 @@
|
|||
|
||||
#define ROUTES_DEFAULT_MAX_PER_FAMILY 4096U
|
||||
|
||||
static uint32_t link_get_vrf_table(Link *link) {
|
||||
return link->network->vrf ? VRF(link->network->vrf)->table : RT_TABLE_MAIN;
|
||||
}
|
||||
|
||||
uint32_t link_get_dhcp_route_table(Link *link) {
|
||||
/* When the interface is part of an VRF use the VRFs routing table, unless
|
||||
* another table is explicitly specified. */
|
||||
if (link->network->dhcp_route_table_set)
|
||||
return link->network->dhcp_route_table;
|
||||
return link_get_vrf_table(link);
|
||||
}
|
||||
|
||||
uint32_t link_get_ipv6_accept_ra_route_table(Link *link) {
|
||||
if (link->network->ipv6_accept_ra_route_table_set)
|
||||
return link->network->ipv6_accept_ra_route_table;
|
||||
return link_get_vrf_table(link);
|
||||
}
|
||||
|
||||
static const char * const route_type_table[__RTN_MAX] = {
|
||||
[RTN_UNICAST] = "unicast",
|
||||
[RTN_LOCAL] = "local",
|
||||
|
|
|
@ -82,6 +82,9 @@ int link_drop_foreign_routes(Link *link);
|
|||
int link_serialize_routes(Link *link, FILE *f);
|
||||
int link_deserialize_routes(Link *link, const char *routes);
|
||||
|
||||
uint32_t link_get_dhcp_route_table(Link *link);
|
||||
uint32_t link_get_ipv6_accept_ra_route_table(Link *link);
|
||||
|
||||
int manager_rtnl_process_route(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
|
||||
|
||||
int network_add_ipv4ll_route(Network *network);
|
||||
|
|
Loading…
Reference in New Issue