summaryrefslogtreecommitdiffstats
path: root/lib/bfd.c
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 /lib/bfd.c
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 'lib/bfd.c')
-rw-r--r--lib/bfd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index 0eddb4751..1dfe583ca 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -342,7 +342,7 @@ static void bfd_last_update(time_t last_update, char *buf, size_t len)
* bfd_show_param - Show the BFD parameter information.
*/
void bfd_show_param(struct vty *vty, struct bfd_info *bfd_info, int bfd_tag,
- int extra_space, uint8_t use_json, json_object *json_obj)
+ int extra_space, bool use_json, json_object *json_obj)
{
json_object *json_bfd = NULL;
@@ -378,7 +378,7 @@ void bfd_show_param(struct vty *vty, struct bfd_info *bfd_info, int bfd_tag,
* bfd_show_status - Show the BFD status information.
*/
static void bfd_show_status(struct vty *vty, struct bfd_info *bfd_info,
- int bfd_tag, int extra_space, uint8_t use_json,
+ int bfd_tag, int extra_space, bool use_json,
json_object *json_bfd)
{
char time_buf[32];
@@ -402,7 +402,7 @@ static void bfd_show_status(struct vty *vty, struct bfd_info *bfd_info,
* bfd_show_info - Show the BFD information.
*/
void bfd_show_info(struct vty *vty, struct bfd_info *bfd_info, int multihop,
- int extra_space, uint8_t use_json, json_object *json_obj)
+ int extra_space, bool use_json, json_object *json_obj)
{
json_object *json_bfd = NULL;