diff options
| author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-02-14 13:51:28 +0100 |
|---|---|---|
| committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2023-09-11 17:35:18 +0200 |
| commit | 2bacddcaec96ca046533f043598552c40b8b24e9 (patch) | |
| tree | d6fa24e98da05409cf27a2122684493b3c08f7a5 | |
| parent | ee47a75047be152d64e37eef00864ecbcd32426f (diff) | |
isisd: Add format func for SRv6 End SID Sub-TLV
Add a function to return information about an SRv6 End SID Sub-TLV
(RFC 9352 section #7.2).
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
| -rw-r--r-- | isisd/isis_tlvs.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index cd20c97623..37fdf6aa6f 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -2070,6 +2070,29 @@ static struct isis_item *copy_item_srv6_end_sid(struct isis_item *i) return (struct isis_item *)rv; } +static void format_item_srv6_end_sid(uint16_t mtid, struct isis_item *i, + struct sbuf *buf, struct json_object *json, + int indent) +{ + struct isis_srv6_end_sid_subtlv *sid = + (struct isis_srv6_end_sid_subtlv *)i; + + if (json) { + struct json_object *sid_json; + sid_json = json_object_new_object(); + json_object_object_add(json, "srv6-end-sid", sid_json); + json_object_string_add(sid_json, "endpoint-behavior", + seg6local_action2str(sid->behavior)); + json_object_string_addf(sid_json, "sid-value", "%pI6", + &sid->sid); + } else { + sbuf_push(buf, indent, "SRv6 End SID "); + sbuf_push(buf, 0, "Endpoint Behavior: %s, ", + seg6local_action2str(sid->behavior)); + sbuf_push(buf, 0, "SID value: %pI6\n", &sid->sid); + } +} + /* Functions related to TLVs 1 Area Addresses */ static struct isis_item *copy_item_area_address(struct isis_item *i) |
