summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2018-08-29 14:19:54 +0200
committerDon Slice <dslice@cumulusnetworks.com>2018-08-30 14:40:18 +0200
commit9f049418bc2fe2500a4c7dbba11d1eefa9c1408c (patch)
treef92eaaecf3885a43bb7cd392b7e4b6f546c1570f /pimd
parentMerge pull request #2930 from donaldsharp/pim_debug (diff)
downloadfrr-9f049418bc2fe2500a4c7dbba11d1eefa9c1408c.tar.xz
frr-9f049418bc2fe2500a4c7dbba11d1eefa9c1408c.zip
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')
-rw-r--r--pimd/pim_bfd.c2
-rw-r--r--pimd/pim_bfd.h2
-rw-r--r--pimd/pim_cmd.c76
3 files changed, 40 insertions, 40 deletions
diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c
index f7a217b51..466cc6064 100644
--- a/pimd/pim_bfd.c
+++ b/pimd/pim_bfd.c
@@ -64,7 +64,7 @@ void pim_bfd_write_config(struct vty *vty, struct interface *ifp)
* pim_bfd_show_info - Show BFD info structure
*/
void pim_bfd_show_info(struct vty *vty, void *bfd_info, json_object *json_obj,
- uint8_t use_json, int param_only)
+ bool use_json, int param_only)
{
if (param_only)
bfd_show_param(vty, (struct bfd_info *)bfd_info, 1, 0, use_json,
diff --git a/pimd/pim_bfd.h b/pimd/pim_bfd.h
index 83def93b6..962b727f8 100644
--- a/pimd/pim_bfd.h
+++ b/pimd/pim_bfd.h
@@ -28,7 +28,7 @@
void pim_bfd_init(void);
void pim_bfd_write_config(struct vty *vty, struct interface *ifp);
void pim_bfd_show_info(struct vty *vty, void *bfd_info, json_object *json_obj,
- uint8_t use_json, int param_only);
+ bool use_json, int param_only);
void pim_bfd_if_param_set(struct interface *ifp, uint32_t min_rx,
uint32_t min_tx, uint8_t detect_mult, int defaults);
int pim_bfd_reg_dereg_all_nbr(struct interface *ifp, int command);
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 611d8d368..918eaf2fd 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;