diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2021-10-08 02:05:20 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2021-10-08 15:03:01 +0200 |
commit | a792fa7b150831c1d2f70ddae580e6fc38a51ab0 (patch) | |
tree | 6cb30c412b0fa6828fb23eb376173369612e9032 /ospfd/ospf_opaque.c | |
parent | tests: Fix ospf[6]_gr_topo1 tests to work better under load (diff) | |
download | frr-a792fa7b150831c1d2f70ddae580e6fc38a51ab0.tar.xz frr-a792fa7b150831c1d2f70ddae580e6fc38a51ab0.zip |
ospfd: display detailed information about opaque LSAs in JSON format
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospf_opaque.c')
-rw-r--r-- | ospfd/ospf_opaque.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c index 9ec2ed0aa..955d9168c 100644 --- a/ospfd/ospf_opaque.c +++ b/ospfd/ospf_opaque.c @@ -1182,6 +1182,16 @@ void show_opaque_info_detail(struct vty *vty, struct ospf_lsa *lsa, VALID_OPAQUE_INFO_LEN(lsah) ? "" : "(Invalid length?)"); + } else { + json_object_string_add( + json, "opaqueType", + ospf_opaque_type_name(opaque_type)); + json_object_int_add(json, "opaqueId", opaque_id); + json_object_int_add(json, "opaqueDataLength", + ntohs(lsah->length) + - OSPF_LSA_HEADER_SIZE); + json_object_boolean_add(json, "opaqueDataLengthValid", + VALID_OPAQUE_INFO_LEN(lsah)); } } else { zlog_debug(" Opaque-Type %u (%s)", opaque_type, |