diff options
author | Mobashshera Rasool <mrasool@vmware.com> | 2022-06-01 17:58:33 +0200 |
---|---|---|
committer | Mobashshera Rasool <mrasool@vmware.com> | 2022-06-13 06:24:01 +0200 |
commit | 52770b79a801533c9d3b0409bc873bfe9a359f72 (patch) | |
tree | 66d61feac794e8db3b7a801e43a5715c2d8b9fa8 /pimd/pim_cmd.c | |
parent | pim6d: Moving show apis to common file (diff) | |
download | frr-52770b79a801533c9d3b0409bc873bfe9a359f72.tar.xz frr-52770b79a801533c9d3b0409bc873bfe9a359f72.zip |
pimd: Change to DEFPY and make the api common
For show ip pim interface traffic cli, doing the below changes
1. Changing DEFUN to DEFPY
2. Move the whole code to a common api and modify it so that can
be reused for pimv6.
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r-- | pimd/pim_cmd.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 2e4c98f75..817ebcc25 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -2806,9 +2806,9 @@ DEFPY (show_ip_pim_nexthop_lookup, return pim_show_nexthop_lookup_cmd_helper(vrf, vty, source, group); } -DEFUN (show_ip_pim_interface_traffic, +DEFPY (show_ip_pim_interface_traffic, show_ip_pim_interface_traffic_cmd, - "show ip pim [vrf NAME] interface traffic [WORD] [json]", + "show ip pim [vrf NAME] interface traffic [WORD$if_name] [json$json]", SHOW_STR IP_STR PIM_STR @@ -2818,20 +2818,7 @@ DEFUN (show_ip_pim_interface_traffic, "Interface name\n" JSON_STR) { - int idx = 2; - struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - bool uj = use_json(argc, argv); - - if (!vrf) - return CMD_WARNING; - - if (argv_find(argv, argc, "WORD", &idx)) - pim_show_interface_traffic_single(vrf->info, vty, - argv[idx]->arg, uj); - else - pim_show_interface_traffic(vrf->info, vty, uj); - - return CMD_SUCCESS; + return pim_show_interface_traffic_helper(vrf, if_name, vty, !!json); } DEFUN (show_ip_pim_bsm_db, |