diff options
| author | Sai Gomathi N <nsaigomathi@vmware.com> | 2022-06-08 23:10:22 -0700 |
|---|---|---|
| committer | Sai Gomathi N <nsaigomathi@vmware.com> | 2022-06-08 23:27:00 -0700 |
| commit | 8282b988388af5598ef64af3950a785de515fce6 (patch) | |
| tree | caa06f9fe773af8e966dc72b1a00557478fba18f /pimd/pim_cmd_common.c | |
| parent | b6bf33775de493676cad5ae27c5545550d8a99c8 (diff) | |
pim6d: Moving the common lines of pim_show_interface cli
Moving the common lines of pim_show_interface cli
in pim_cmd.c and pim6_cmd.c to pim_cmd_common.c file
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
Diffstat (limited to 'pimd/pim_cmd_common.c')
| -rw-r--r-- | pimd/pim_cmd_common.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index 895ac0c81e..bf594727ec 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -1959,6 +1959,32 @@ int pim_show_channel_cmd_helper(const char *vrf, struct vty *vty, bool uj) return CMD_SUCCESS; } +int pim_show_interface_cmd_helper(const char *vrf, struct vty *vty, bool uj, + bool mlag, const char *interface) +{ + struct vrf *v; + json_object *json_parent = NULL; + + v = vrf_lookup_by_name(vrf ? vrf : VRF_DEFAULT_NAME); + + if (!v) + return CMD_WARNING; + + if (uj) + json_parent = json_object_new_object(); + + if (interface) + pim_show_interfaces_single(v->info, vty, interface, mlag, + json_parent); + else + pim_show_interfaces(v->info, vty, mlag, json_parent); + + if (uj) + vty_json(vty, json_parent); + + return CMD_SUCCESS; +} + void pim_show_interfaces(struct pim_instance *pim, struct vty *vty, bool mlag, json_object *json) { |
