summaryrefslogtreecommitdiff
path: root/ospfd/ospf_te.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_te.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_te.c')
-rw-r--r--ospfd/ospf_te.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index d95e677f6f..03fa572859 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -87,7 +87,8 @@ static int ospf_mpls_te_del_if(struct interface *ifp);
static void ospf_mpls_te_ism_change(struct ospf_interface *oi, int old_status);
static void ospf_mpls_te_nsm_change(struct ospf_neighbor *nbr, int old_status);
static void ospf_mpls_te_config_write_router(struct vty *vty);
-static void ospf_mpls_te_show_info(struct vty *vty, struct ospf_lsa *lsa);
+static void ospf_mpls_te_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
static int ospf_mpls_te_lsa_originate_area(void *arg);
static int ospf_mpls_te_lsa_inter_as_as(void *arg);
static int ospf_mpls_te_lsa_inter_as_area(void *arg);
@@ -3783,7 +3784,8 @@ static uint16_t ospf_mpls_te_show_link_subtlv(struct vty *vty,
return sum;
}
-static void ospf_mpls_te_show_info(struct vty *vty, struct ospf_lsa *lsa)
+static void ospf_mpls_te_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa)
{
struct lsa_header *lsah = lsa->data;
struct tlv_header *tlvh, *next;
@@ -3791,6 +3793,9 @@ static void ospf_mpls_te_show_info(struct vty *vty, struct ospf_lsa *lsa)
uint16_t (*subfunc)(struct vty * vty, struct tlv_header * tlvh,
uint16_t subtotal, uint16_t total) = NULL;
+ if (json)
+ return;
+
sum = 0;
total = lsa->size - OSPF_LSA_HEADER_SIZE;