summaryrefslogtreecommitdiff
path: root/ospfd/ospf_gr_helper.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-10-07 21:06:01 -0300
committerRenato Westphal <renato@opensourcerouting.org>2021-10-08 10:03:01 -0300
commit3e63092b83c6710dd978b705537a2bb8c586ea8b (patch)
tree17304c3f72ab98edab9b843f52b36246ecf613b0 /ospfd/ospf_gr_helper.c
parenta792fa7b150831c1d2f70ddae580e6fc38a51ab0 (diff)
ospfd: fix display of plain-text data on "show ... json" commands
Add a 'json' parameter to the 'show_opaque_info' callback definition, and update all instances of that callback to not display plain-text data when the user requested JSON data. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospf_gr_helper.c')
-rw-r--r--ospfd/ospf_gr_helper.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ospfd/ospf_gr_helper.c b/ospfd/ospf_gr_helper.c
index b3eaf7bbdb..a58a120b6b 100644
--- a/ospfd/ospf_gr_helper.c
+++ b/ospfd/ospf_gr_helper.c
@@ -75,7 +75,8 @@ static const char * const ospf_rejected_reason_desc[] = {
"Router is in the process of graceful restart",
};
-static void show_ospf_grace_lsa_info(struct vty *vty, struct ospf_lsa *lsa);
+static void show_ospf_grace_lsa_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
static bool ospf_check_change_in_rxmt_list(struct ospf_neighbor *nbr);
static unsigned int ospf_enable_rtr_hash_key(const void *data)
@@ -1012,7 +1013,8 @@ void ospf_gr_helper_set_supported_planned_only_restart(struct ospf *ospf,
* Returns:
* Nothing.
*/
-static void show_ospf_grace_lsa_info(struct vty *vty, struct ospf_lsa *lsa)
+static void show_ospf_grace_lsa_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa)
{
struct lsa_header *lsah = NULL;
struct tlv_header *tlvh = NULL;
@@ -1022,6 +1024,9 @@ static void show_ospf_grace_lsa_info(struct vty *vty, struct ospf_lsa *lsa)
uint16_t length = 0;
int sum = 0;
+ if (json)
+ return;
+
lsah = (struct lsa_header *)lsa->data;
if (lsa->size <= OSPF_LSA_HEADER_SIZE) {