diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-09-23 21:45:50 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-09-23 21:45:50 +0200 |
commit | c500ae4060d155ee9808d99e63450c6bac0f7dbd (patch) | |
tree | cae5f10306af63fa0344e779a3feb1914e1201da /bgpd/bgp_dump.c | |
parent | zebra: add 'int idx_foo' argv index variables (diff) | |
download | frr-c500ae4060d155ee9808d99e63450c6bac0f7dbd.tar.xz frr-c500ae4060d155ee9808d99e63450c6bac0f7dbd.zip |
bgpd: add 'int idx_foo' argv index variables
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_dump.c')
-rw-r--r-- | bgpd/bgp_dump.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index c5fc05200..48c43b7f6 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -736,13 +736,16 @@ DEFUN (dump_bgp_all, "Output filename\n" "Interval of output\n") { + int idx_dump_routes = 2; + int idx_path = 3; + int idx_interval = 4; int bgp_dump_type = 0; const char *interval = NULL; struct bgp_dump *bgp_dump_struct = NULL; const struct bgp_dump_type_map *map = NULL; for (map = bgp_dump_type_map; map->str; map++) - if (strcmp(argv[2]->arg, map->str) == 0) + if (strcmp(argv[idx_dump_routes]->arg, map->str) == 0) bgp_dump_type = map->type; switch (bgp_dump_type) @@ -763,10 +766,10 @@ DEFUN (dump_bgp_all, /* When an interval is given */ if (argc == 3) - interval = argv[4]->arg; + interval = argv[idx_interval]->arg; return bgp_dump_set (vty, bgp_dump_struct, bgp_dump_type, - argv[3]->arg, interval); + argv[idx_path]->arg, interval); } DEFUN (no_dump_bgp_all, @@ -781,12 +784,13 @@ DEFUN (no_dump_bgp_all, "Stop dump process updates-et\n" "Stop dump process route-mrt\n") { + int idx_dump_routes = 3; int bgp_dump_type = 0; const struct bgp_dump_type_map *map = NULL; struct bgp_dump *bgp_dump_struct = NULL; for (map = bgp_dump_type_map; map->str; map++) - if (strcmp(argv[3]->arg, map->str) == 0) + if (strcmp(argv[idx_dump_routes]->arg, map->str) == 0) bgp_dump_type = map->type; switch (bgp_dump_type) |