Skip to content

Commit

Permalink
lib: add block/node/arg len to SRv6 locator JSON
Browse files Browse the repository at this point in the history
This commit adds the SRv6 locator's block length, node length and
argument length to the output of the command
"show segment-routing srv6 locator json"

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
  • Loading branch information
cscarpitta committed Oct 18, 2022
1 parent d9d3179 commit 696f437
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/srv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,20 @@ json_object *srv6_locator_json(const struct srv6_locator *loc)
/* set prefix */
json_object_string_addf(jo_root, "prefix", "%pFX", &loc->prefix);

/* set block_bits_length */
json_object_int_add(jo_root, "blockBitsLength", loc->block_bits_length);

/* set node_bits_length */
json_object_int_add(jo_root, "nodeBitsLength", loc->node_bits_length);

/* set function_bits_length */
json_object_int_add(jo_root, "functionBitsLength",
loc->function_bits_length);

/* set argument_bits_length */
json_object_int_add(jo_root, "argumentBitsLength",
loc->argument_bits_length);

/* set status_up */
json_object_boolean_add(jo_root, "statusUp",
loc->status_up);
Expand Down

0 comments on commit 696f437

Please sign in to comment.