diff options
| author | Don Slice <dslice@cumulusnetworks.com> | 2018-08-29 12:19:54 +0000 |
|---|---|---|
| committer | Don Slice <dslice@cumulusnetworks.com> | 2018-08-30 12:40:18 +0000 |
| commit | 9f049418bc2fe2500a4c7dbba11d1eefa9c1408c (patch) | |
| tree | f92eaaecf3885a43bb7cd392b7e4b6f546c1570f /pimd/pim_cmd.c | |
| parent | 9f0cf8f4354ce60d18501969115febdd3ba7ec1e (diff) | |
bgpd/ospfd: make bgp and ospf json response a bit more consistent
Problem reported that some bgp and ospf json commands did not return
any json output at all if the bgp/ospf instance did not exist.
Additionally, some bgp and ospf json commands did not return any json
output if the instance existed but no neighbors were defined. This
fix makes these commands more consistent in returning empty braces for
json output and issue a message if not using json output. Additionally,
made the flag "use_json" a bool to make it consistent since previously,
it had been defined as an int, char, u_char, and bool at various places.
Ticket: CM-21040
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_cmd.c')
| -rw-r--r-- | pimd/pim_cmd.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 611d8d3681..918eaf2fdb 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -3373,7 +3373,7 @@ DEFUN (show_ip_igmp_interface, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -3400,7 +3400,7 @@ DEFUN (show_ip_igmp_interface_vrf_all, JSON_STR) { int idx = 2; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -3456,7 +3456,7 @@ DEFUN (show_ip_igmp_join_vrf_all, VRF_CMD_HELP_STR "IGMP static join information\n") { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -3490,7 +3490,7 @@ DEFUN (show_ip_igmp_groups, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -3510,7 +3510,7 @@ DEFUN (show_ip_igmp_groups_vrf_all, IGMP_GROUP_STR JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -3608,7 +3608,7 @@ DEFUN (show_ip_igmp_statistics, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -3715,7 +3715,7 @@ DEFUN (show_ip_pim_interface, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -3742,7 +3742,7 @@ DEFUN (show_ip_pim_interface_vrf_all, JSON_STR) { int idx = 6; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -3781,7 +3781,7 @@ DEFUN (show_ip_pim_join, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -3801,7 +3801,7 @@ DEFUN (show_ip_pim_join_vrf_all, "PIM interface join information\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -3835,7 +3835,7 @@ DEFUN (show_ip_pim_local_membership, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -3859,7 +3859,7 @@ DEFUN (show_ip_pim_neighbor, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -3886,7 +3886,7 @@ DEFUN (show_ip_pim_neighbor_vrf_all, JSON_STR) { int idx = 2; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -3949,7 +3949,7 @@ DEFUN (show_ip_pim_state, const char *group = NULL; int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -3983,7 +3983,7 @@ DEFUN (show_ip_pim_state_vrf_all, const char *src_or_group = NULL; const char *group = NULL; int idx = 2; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -4026,7 +4026,7 @@ DEFUN (show_ip_pim_upstream, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -4046,7 +4046,7 @@ DEFUN (show_ip_pim_upstream_vrf_all, "PIM upstream information\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -4078,7 +4078,7 @@ DEFUN (show_ip_pim_upstream_join_desired, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -4100,7 +4100,7 @@ DEFUN (show_ip_pim_upstream_rpf, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -4122,7 +4122,7 @@ DEFUN (show_ip_pim_rp, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -4142,7 +4142,7 @@ DEFUN (show_ip_pim_rp_vrf_all, "PIM RP information\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -4176,7 +4176,7 @@ DEFUN (show_ip_pim_rpf, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -4196,7 +4196,7 @@ DEFUN (show_ip_pim_rpf_vrf_all, "PIM cached source rpf information\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -4349,7 +4349,7 @@ DEFUN (show_ip_pim_interface_traffic, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -4473,7 +4473,7 @@ DEFUN (show_ip_multicast_vrf_all, VRF_CMD_HELP_STR "Multicast global information\n") { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -4830,7 +4830,7 @@ DEFUN (show_ip_mroute, "Fill in Assumed data\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); bool fill = false; int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); @@ -4855,7 +4855,7 @@ DEFUN (show_ip_mroute_vrf_all, "Fill in Assumed data\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); int idx = 4; struct vrf *vrf; bool first = true; @@ -4963,7 +4963,7 @@ DEFUN (show_ip_mroute_count_vrf_all, VRF_CMD_HELP_STR "Route and packet count data\n") { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -5578,7 +5578,7 @@ DEFUN (show_ip_pim_ssm_range, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -5631,7 +5631,7 @@ DEFUN (show_ip_pim_group_type, { int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!vrf) return CMD_WARNING; @@ -7985,7 +7985,7 @@ DEFUN (show_ip_msdp_mesh_group, "MSDP mesh-group information\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); @@ -8007,7 +8007,7 @@ DEFUN (show_ip_msdp_mesh_group_vrf_all, "MSDP mesh-group information\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -8200,7 +8200,7 @@ DEFUN (show_ip_msdp_peer_detail, "peer ip address\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); @@ -8235,7 +8235,7 @@ DEFUN (show_ip_msdp_peer_detail_vrf_all, JSON_STR) { int idx = 2; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -8441,7 +8441,7 @@ DEFUN (show_ip_msdp_sa_detail, "Detailed output\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); @@ -8464,7 +8464,7 @@ DEFUN (show_ip_msdp_sa_detail_vrf_all, "Detailed output\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; @@ -8556,7 +8556,7 @@ DEFUN (show_ip_msdp_sa_sg, "group ip\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; int idx = 2; @@ -8593,7 +8593,7 @@ DEFUN (show_ip_msdp_sa_sg_vrf_all, "group ip\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); struct vrf *vrf; bool first = true; int idx = 2; |
