diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-02-13 09:14:56 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-02-13 09:40:47 -0500 |
| commit | 1c950f37b74dd589b21246e7abbd7772b2632a5f (patch) | |
| tree | 093ae7fb3fc768391d51ff0cd0df2930f3ee355b /lib/routemap.c | |
| parent | 5913a17a5b39353e82baf7e7c180c6ad0493522a (diff) | |
lib: Add `debug routemap [detail]`
Add the ability to turn on `debug routemap detail` for FRR.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/routemap.c')
| -rw-r--r-- | lib/routemap.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index 0ca7eaa555..4b9033594c 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -36,6 +36,8 @@ #include "json.h" #include "jhash.h" +#include "lib/routemap_clippy.c" + DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP, "Route map"); DEFINE_MTYPE(LIB, ROUTE_MAP_NAME, "Route map name"); DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP_INDEX, "Route map index"); @@ -614,8 +616,7 @@ static void route_map_clear_all_references(char *rmap_name); static void route_map_rule_delete(struct route_map_rule_list *, struct route_map_rule *); -#define DEBUG_ROUTEMAP 0x01 -static uint32_t rmap_debug; +uint32_t rmap_debug; /* New route map allocation. Please note route map's name must be specified. */ @@ -3159,24 +3160,34 @@ DEFUN (rmap_show_unused, return vty_show_unused_route_map(vty); } -DEFUN (debug_rmap, +DEFPY (debug_rmap, debug_rmap_cmd, - "debug route-map", + "debug route-map [detail]$detail", DEBUG_STR - "Debug option set for route-maps\n") + "Debug option set for route-maps\n" + "Detailed output\n") { - SET_FLAG(rmap_debug, DEBUG_ROUTEMAP); + if (!detail) + SET_FLAG(rmap_debug, DEBUG_ROUTEMAP); + else + SET_FLAG(rmap_debug, DEBUG_ROUTEMAP | DEBUG_ROUTEMAP_DETAIL); + return CMD_SUCCESS; } -DEFUN (no_debug_rmap, +DEFPY (no_debug_rmap, no_debug_rmap_cmd, - "no debug route-map", + "no debug route-map [detail]$detail", NO_STR DEBUG_STR - "Debug option set for route-maps\n") + "Debug option set for route-maps\n" + "Detailed output\n") { - UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP); + if (!detail) + UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP); + else + UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP | DEBUG_ROUTEMAP_DETAIL); + return CMD_SUCCESS; } |
