for InterASv2 link in OSPF (RFC5392). Note that this option is not yet
supported for ISIS (RFC5316).
-.. index:: table TABLENO
-.. clicmd:: table TABLENO
-
- Select the primary kernel routing table to be used. This only works for
- kernels supporting multiple routing tables (like GNU/Linux 2.2.x and later).
- After setting TABLENO with this command, static routes defined after this
- are added to the specified table.
-
.. index:: ip nht resolve-via-default
.. clicmd:: ip nht resolve-via-default
newre->flags = re->flags;
newre->metric = re->metric;
newre->mtu = re->mtu;
- newre->table = zrouter.rtm_table_default;
+ newre->table = 0;
newre->nexthop_num = 0;
newre->uptime = time(NULL);
newre->instance = re->table;
prefix_copy(&p, &rn->p);
rib_delete(afi, SAFI_UNICAST, re->vrf_id, ZEBRA_ROUTE_TABLE, re->table,
- re->flags, &p, NULL, re->ng.nexthop,
- zrouter.rtm_table_default, re->metric, re->distance, false);
+ re->flags, &p, NULL, re->ng.nexthop, 0, re->metric,
+ re->distance, false);
return 0;
}
struct route_node *rn;
if (!is_zebra_valid_kernel_table(table_id)
- || ((table_id == RT_TABLE_MAIN)
- || (table_id == zrouter.rtm_table_default)))
+ || (table_id == RT_TABLE_MAIN))
return (-1);
if (afi >= AFI_MAX)
int is_zebra_main_routing_table(uint32_t table_id)
{
- if ((table_id == RT_TABLE_MAIN)
- || (table_id == zrouter.rtm_table_default))
+ if (table_id == RT_TABLE_MAIN)
return 1;
return 0;
}
{
zrouter.sequence_num = 0;
- zrouter.rtm_table_default = 0;
zrouter.packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS;
zebra_vxlan_init();
/* A sequence number used for tracking routes */
_Atomic uint32_t sequence_num;
- /* The default table used for this router */
- uint32_t rtm_table_default;
-
/* rib work queue */
#define ZEBRA_RIB_PROCESS_HOLD_TIME 10
#define ZEBRA_RIB_PROCESS_RETRY_TIME 1
return NULL;
if (vrf_id == VRF_DEFAULT) {
- if (table_id == RT_TABLE_MAIN
- || table_id == zrouter.rtm_table_default)
+ if (table_id == RT_TABLE_MAIN)
table = zebra_vrf_table(afi, safi, vrf_id);
else
table = zebra_vrf_other_route_table(afi, table_id,
vrf_id);
} else if (vrf_is_backend_netns()) {
- if (table_id == RT_TABLE_MAIN
- || table_id == zrouter.rtm_table_default)
+ if (table_id == RT_TABLE_MAIN)
table = zebra_vrf_table(afi, safi, vrf_id);
else
table = zebra_vrf_other_route_table(afi, table_id,
if (afi >= AFI_MAX)
return NULL;
- if ((table_id != RT_TABLE_MAIN)
- && (table_id != zrouter.rtm_table_default)) {
- if (zvrf->table_id == RT_TABLE_MAIN ||
- zvrf->table_id == zrouter.rtm_table_default) {
+ if (table_id != RT_TABLE_MAIN) {
+ if (zvrf->table_id == RT_TABLE_MAIN) {
/* this VRF use default table
* so in all cases, it does not use specific table
* so it is possible to configure tables in this VRF
return 1;
}
-#ifdef HAVE_NETLINK
-/* Display default rtm_table for all clients. */
-DEFUN (show_table,
- show_table_cmd,
- "show table",
- SHOW_STR
- "default routing table to use for all clients\n")
-{
- vty_out(vty, "table %d\n", zrouter.rtm_table_default);
- return CMD_SUCCESS;
-}
-
-DEFUN (config_table,
- config_table_cmd,
- "table TABLENO",
- "Configure target kernel routing table\n"
- "TABLE integer\n")
-{
- zrouter.rtm_table_default = strtol(argv[1]->arg, (char **)0, 10);
- return CMD_SUCCESS;
-}
-
-DEFUN (no_config_table,
- no_config_table_cmd,
- "no table [TABLENO]",
- NO_STR
- "Configure target kernel routing table\n"
- "TABLE integer\n")
-{
- zrouter.rtm_table_default = 0;
- return CMD_SUCCESS;
-}
-#endif
-
DEFUN (show_zebra,
show_zebra_cmd,
"show zebra",
/* Table configuration write function. */
static int config_write_table(struct vty *vty)
{
- if (zrouter.rtm_table_default)
- vty_out(vty, "table %d\n", zrouter.rtm_table_default);
return 0;
}
install_element(CONFIG_NODE, &no_ip_forwarding_cmd);
install_element(ENABLE_NODE, &show_zebra_cmd);
-#ifdef HAVE_NETLINK
- install_element(VIEW_NODE, &show_table_cmd);
- install_element(CONFIG_NODE, &config_table_cmd);
- install_element(CONFIG_NODE, &no_config_table_cmd);
-#endif /* HAVE_NETLINK */
-
install_element(VIEW_NODE, &show_ipv6_forwarding_cmd);
install_element(CONFIG_NODE, &ipv6_forwarding_cmd);
install_element(CONFIG_NODE, &no_ipv6_forwarding_cmd);
pthread_mutex_init(&client->obuf_mtx, NULL);
client->wb = buffer_new(0);
- /* Set table number. */
- client->rtm_table = zrouter.rtm_table_default;
-
atomic_store_explicit(&client->connect_time, (uint32_t) monotime(NULL),
memory_order_relaxed);
vty_out(vty, "------------------------ \n");
vty_out(vty, "FD: %d \n", client->sock);
- vty_out(vty, "Route Table ID: %d \n", client->rtm_table);
connect_time = (time_t) atomic_load_explicit(&client->connect_time,
memory_order_relaxed);
/* Threads for the main pthread */
struct thread *t_cleanup;
- /* default routing table this client munges */
- int rtm_table;
-
/* This client's redistribute flag. */
struct redist_proto mi_redist[AFI_MAX][ZEBRA_ROUTE_MAX];
vrf_bitmap_t redist[AFI_MAX][ZEBRA_ROUTE_MAX];