Skip to content

Commit

Permalink
isisd: Add Sub-Sub-TLVs to End SID format func
Browse files Browse the repository at this point in the history
Extend SRv6 End SID Sub-TLV format function to return information about
Sub-Sub-TLVs (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <[email protected]>
  • Loading branch information
cscarpitta committed Sep 11, 2023
1 parent 0089b3b commit 584f41d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions isisd/isis_tlvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2163,11 +2163,25 @@ static void format_item_srv6_end_sid(uint16_t mtid, struct isis_item *i,
seg6local_action2str(sid->behavior));
json_object_string_addf(sid_json, "sid-value", "%pI6",
&sid->sid);
if (sid->subsubtlvs) {
struct json_object *subtlvs_json;
subtlvs_json = json_object_new_object();
json_object_object_add(sid_json, "subsubtlvs",
subtlvs_json);
isis_format_subsubtlvs(sid->subsubtlvs, NULL,
subtlvs_json, 0);
}
} 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);

if (sid->subsubtlvs) {
sbuf_push(buf, indent, " Sub-Sub-TLVs:\n");
isis_format_subsubtlvs(sid->subsubtlvs, buf, NULL,
indent + 4);
}
}
}

Expand Down

0 comments on commit 584f41d

Please sign in to comment.