]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: display detailed information about opaque LSAs in JSON format
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 8 Oct 2021 00:05:20 +0000 (21:05 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 8 Oct 2021 13:03:01 +0000 (10:03 -0300)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ospfd/ospf_opaque.c

index 9ec2ed0aa8df42c306aea1cc8f712b14fd1f01ac..955d9168c4c7e5f62e93bcd7503c98852d127104 100644 (file)
@@ -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,