diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-20 03:00:39 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-20 03:22:46 +0200 |
commit | 75a2b29dd6b25725274bb8d8bd145e198a37d5f5 (patch) | |
tree | d11a7b3a583e6c5ac825428ab1004fc62360b4ea | |
parent | pimd: Remove unused code (diff) | |
download | frr-75a2b29dd6b25725274bb8d8bd145e198a37d5f5.tar.xz frr-75a2b29dd6b25725274bb8d8bd145e198a37d5f5.zip |
zebra: Add initial framework to keep track of changed route-maps
Add some basic code for zebra to start to keep track
of route-maps that have changed. At this point we
are not doing anything. As we fix code to handle
route-maps better, code will be shifted around.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | zebra/zebra_routemap.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 10ba88880..8e368c257 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -1282,6 +1282,15 @@ static struct route_map_rule_cmd route_set_src_cmd = { "src", route_set_src, route_set_src_compile, route_set_src_free, }; +static int zebra_route_map_process_update_cb(char *rmap_name) +{ + if (IS_ZEBRA_DEBUG_EVENT) + zlog_debug("Event handler for route-map: %s", + rmap_name); + + return 0; +} + static int zebra_route_map_update_timer(struct thread *thread) { zebra_t_rmap_update = NULL; @@ -1294,6 +1303,13 @@ static int zebra_route_map_update_timer(struct thread *thread) "%u: Routemap update-timer fired, scheduling RIB processing", VRF_DEFAULT); + route_map_walk_update_list(zebra_route_map_process_update_cb); + + /* + * This code needs to be updated to be: + * 1) VRF Aware <sigh> + * 2) Route-map aware + */ zebra_import_table_rm_update(); rib_update(VRF_DEFAULT, RIB_UPDATE_RMAP_CHANGE); zebra_evaluate_rnh(0, AF_INET, 1, RNH_NEXTHOP_TYPE, NULL); @@ -1433,20 +1449,26 @@ static void zebra_route_map_mark_update(const char *rmap_name) static void zebra_route_map_add(const char *rmap_name) { - zebra_route_map_mark_update(rmap_name); + if (route_map_mark_updated(rmap_name) == 0) + zebra_route_map_mark_update(rmap_name); + route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED); } static void zebra_route_map_delete(const char *rmap_name) { - zebra_route_map_mark_update(rmap_name); + if (route_map_mark_updated(rmap_name) == 0) + zebra_route_map_mark_update(rmap_name); + route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_DELETED); } static void zebra_route_map_event(route_map_event_t event, const char *rmap_name) { - zebra_route_map_mark_update(rmap_name); + if (route_map_mark_updated(rmap_name) == 0) + zebra_route_map_mark_update(rmap_name); + route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED); } |