summaryrefslogtreecommitdiff
path: root/zebra/zebra_routemap.c
diff options
context:
space:
mode:
authorNathan Bahr <nbahr@atcorp.com>2024-10-28 18:55:49 +0000
committerNathan Bahr <nbahr@atcorp.com>2024-10-29 20:17:59 +0000
commitbe2a7ed6af56af46da7593ef65f431be070c5759 (patch)
treeb64f30c58b2cc28586ed1c8ad09a12ab01d33b9e /zebra/zebra_routemap.c
parent56495a88dfc4959331e9baf4c442ea665b2fc776 (diff)
zebra: Add ability to import alternate tables into the MRIB
Expanded the cli command to include an mrib flag for importing to the main table MRIB instead of the main table URIB. Piped through specifying the safi through the import table functions rather than hardcoding to SAFI_UNICAST. Import still only import routes from the URIB subtable, only added the ability to import into the main table MRIB. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Diffstat (limited to 'zebra/zebra_routemap.c')
-rw-r--r--zebra/zebra_routemap.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 46afbcecfa..29bbf6023d 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -29,7 +29,7 @@
static uint32_t zebra_rmap_update_timer = ZEBRA_RMAP_DEFAULT_UPDATE_TIMER;
static struct event *zebra_t_rmap_update = NULL;
-char *zebra_import_table_routemap[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
+char *zebra_import_table_routemap[AFI_MAX][SAFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
struct zebra_rmap_obj {
struct nexthop *nexthop;
@@ -1235,21 +1235,19 @@ route_map_result_t zebra_route_map_check(afi_t family, struct route_entry *re,
return (ret);
}
-char *zebra_get_import_table_route_map(afi_t afi, uint32_t table)
+char *zebra_get_import_table_route_map(afi_t afi, safi_t safi, uint32_t table)
{
- return zebra_import_table_routemap[afi][table];
+ return zebra_import_table_routemap[afi][safi][table];
}
-void zebra_add_import_table_route_map(afi_t afi, const char *rmap_name,
- uint32_t table)
+void zebra_add_import_table_route_map(afi_t afi, safi_t safi, const char *rmap_name, uint32_t table)
{
- zebra_import_table_routemap[afi][table] =
- XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap_name);
+ zebra_import_table_routemap[afi][safi][table] = XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap_name);
}
-void zebra_del_import_table_route_map(afi_t afi, uint32_t table)
+void zebra_del_import_table_route_map(afi_t afi, safi_t safi, uint32_t table)
{
- XFREE(MTYPE_ROUTE_MAP_NAME, zebra_import_table_routemap[afi][table]);
+ XFREE(MTYPE_ROUTE_MAP_NAME, zebra_import_table_routemap[afi][safi][table]);
}
route_map_result_t zebra_import_table_route_map_check(int family,