summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>2022-10-27 20:01:24 +0200
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>2022-11-08 22:44:23 +0100
commita3ff3dff3fcf3e264d4484a1ce5bbe40db3edcb7 (patch)
treee5c65a9b497c37ea6ce1efc66cb8cfee0cc27958 /lib
parent05d99980f36769778ebba434b0c101d36bf5fb4f (diff)
lib,zebra: Add SRv6 uSID info to VTY output
In this commit, we extend to print the `SRV6_LOCATOR_USID` flag. The output appears as follows: ``` { "locators":[ { "name":"loc1", "prefix":"fc00:0:1::/48", "blockBitsLength":32, "nodeBitsLength":16, "functionBitsLength":16, "argumentBitsLength":0, "uSID":true, "statusUp":true, "chunks":[ { "prefix":"fc00:0:1::/48", "proto":"bgp" } ] } ] } ``` Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Diffstat (limited to 'lib')
-rw-r--r--lib/srv6.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/srv6.c b/lib/srv6.c
index 306d92ae30..b7142d618c 100644
--- a/lib/srv6.c
+++ b/lib/srv6.c
@@ -245,6 +245,10 @@ json_object *srv6_locator_json(const struct srv6_locator *loc)
json_object_int_add(jo_root, "argumentBitsLength",
loc->argument_bits_length);
+ /* set true if the locator is a Micro-segment (uSID) locator */
+ if (CHECK_FLAG(loc->flags, SRV6_LOCATOR_USID))
+ json_object_string_add(jo_root, "behavior", "usid");
+
/* set status_up */
json_object_boolean_add(jo_root, "statusUp",
loc->status_up);
@@ -290,6 +294,10 @@ json_object *srv6_locator_detailed_json(const struct srv6_locator *loc)
json_object_int_add(jo_root, "argumentBitsLength",
loc->argument_bits_length);
+ /* set true if the locator is a Micro-segment (uSID) locator */
+ if (CHECK_FLAG(loc->flags, SRV6_LOCATOR_USID))
+ json_object_string_add(jo_root, "behavior", "usid");
+
/* set algonum */
json_object_int_add(jo_root, "algoNum", loc->algonum);