diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-27 02:15:56 +0200 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-28 23:28:40 +0200 |
| commit | 010bd3e5702d1ed52fcf19d950a558b74897c67b (patch) | |
| tree | 80272738dac2cfbbcd626bfdc74287ba9616a922 /zebra/zebra_routemap.c | |
| parent | cc619176fe8f06d1bf85e5f0225acf08240c2698 (diff) | |
zebra: convert route-map delay-timer command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'zebra/zebra_routemap.c')
| -rw-r--r-- | zebra/zebra_routemap.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index cfa0a4af86..30359d1b90 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -36,8 +36,6 @@ struct zebra_rmap_obj { struct route_entry *re; }; -static void zebra_route_map_set_delay_timer(uint32_t value); - /* 'match tag TAG' * Match function return 1 if match is success else return 0 */ @@ -634,24 +632,20 @@ DEFPY_YANG( return nb_cli_apply_changes(vty, NULL); } -DEFUN_YANG (zebra_route_map_timer, +DEFPY_YANG (zebra_route_map_timer, zebra_route_map_timer_cmd, - "zebra route-map delay-timer (0-600)", + "zebra route-map delay-timer (0-600)$delay", ZEBRA_STR "Set route-map parameters\n" "Time to wait before route-map updates are processed\n" "0 means route-map changes are run immediately instead of delaying\n") { - int idx_number = 3; - uint32_t rmap_delay_timer; - - rmap_delay_timer = strtoul(argv[idx_number]->arg, NULL, 10); - zebra_route_map_set_delay_timer(rmap_delay_timer); - - return (CMD_SUCCESS); + nb_cli_enqueue_change(vty, "/frr-zebra:zebra/route-map-delay", + NB_OP_MODIFY, delay_str); + return nb_cli_apply_changes(vty, NULL); } -DEFUN_YANG (no_zebra_route_map_timer, +DEFPY_YANG (no_zebra_route_map_timer, no_zebra_route_map_timer_cmd, "no zebra route-map delay-timer [(0-600)]", NO_STR @@ -660,9 +654,9 @@ DEFUN_YANG (no_zebra_route_map_timer, "Reset delay-timer to default value, 30 secs\n" "0 means route-map changes are run immediately instead of delaying\n") { - zebra_route_map_set_delay_timer(ZEBRA_RMAP_DEFAULT_UPDATE_TIMER); - - return (CMD_SUCCESS); + nb_cli_enqueue_change(vty, "/frr-zebra:zebra/route-map-delay", + NB_OP_DESTROY, NULL); + return nb_cli_apply_changes(vty, NULL); } DEFPY_YANG (ip_protocol, @@ -1677,7 +1671,7 @@ static void zebra_route_map_update_timer(struct event *thread) */ } -static void zebra_route_map_set_delay_timer(uint32_t value) +void zebra_route_map_set_delay_timer(uint32_t value) { zebra_rmap_update_timer = value; if (!value && zebra_t_rmap_update) { |
