summaryrefslogtreecommitdiff
path: root/ospfd/ospf_opaque.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_opaque.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_opaque.c')
-rw-r--r--ospfd/ospf_opaque.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 955d9168c4..a89e90bf70 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -274,7 +274,8 @@ struct ospf_opaque_functab {
void (*config_write_router)(struct vty *vty);
void (*config_write_if)(struct vty *vty, struct interface *ifp);
void (*config_write_debug)(struct vty *vty);
- void (*show_opaque_info)(struct vty *vty, struct ospf_lsa *lsa);
+ void (*show_opaque_info)(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
int (*lsa_originator)(void *arg);
struct ospf_lsa *(*lsa_refresher)(struct ospf_lsa *lsa);
int (*new_lsa_hook)(struct ospf_lsa *lsa);
@@ -373,7 +374,8 @@ int ospf_register_opaque_functab(
void (*config_write_router)(struct vty *vty),
void (*config_write_if)(struct vty *vty, struct interface *ifp),
void (*config_write_debug)(struct vty *vty),
- void (*show_opaque_info)(struct vty *vty, struct ospf_lsa *lsa),
+ void (*show_opaque_info)(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa),
int (*lsa_originator)(void *arg),
struct ospf_lsa *(*lsa_refresher)(struct ospf_lsa *lsa),
int (*new_lsa_hook)(struct ospf_lsa *lsa),
@@ -1207,7 +1209,7 @@ void show_opaque_info_detail(struct vty *vty, struct ospf_lsa *lsa,
/* Call individual output functions. */
if ((functab = ospf_opaque_functab_lookup(lsa)) != NULL)
if (functab->show_opaque_info != NULL)
- (*functab->show_opaque_info)(vty, lsa);
+ (*functab->show_opaque_info)(vty, json, lsa);
return;
}