summaryrefslogtreecommitdiff
path: root/lib/nexthop.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-08-08 22:39:34 +0300
committerGitHub <noreply@github.com>2024-08-08 22:39:34 +0300
commit536d478049b4ae7c3d60676a75a56115491d9b6f (patch)
tree9f043e62b3f9c8678349377e08a28398b6f3b8c9 /lib/nexthop.c
parent7b8ca3e2ed6e7f98a63633c7dc91a9f0d12c576a (diff)
parent5d027fc79194870d26d14373d5c15f2ea4d58bd5 (diff)
Merge pull request #16535 from pguibert6WIND/srv6_nexthop_context
lib: add seg6localContext json attribute in nexthop information
Diffstat (limited to 'lib/nexthop.c')
-rw-r--r--lib/nexthop.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c
index 26c338256f..65c12c1e69 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -1166,6 +1166,7 @@ void nexthop_json_helper(json_object *json_nexthop,
json_object *json_labels = NULL;
json_object *json_backups = NULL;
json_object *json_seg6local = NULL;
+ json_object *json_seg6local_context = NULL;
json_object *json_seg6 = NULL;
json_object *json_segs = NULL;
int i;
@@ -1331,8 +1332,16 @@ void nexthop_json_helper(json_object *json_nexthop,
seg6local_action2str(
nexthop->nh_srv6
->seg6local_action));
+ json_seg6local_context = json_object_new_object();
json_object_object_add(json_nexthop, "seg6local",
json_seg6local);
+
+ seg6local_context2json(&nexthop->nh_srv6->seg6local_ctx,
+ nexthop->nh_srv6->seg6local_action,
+ json_seg6local_context);
+ json_object_object_add(json_nexthop, "seg6localContext",
+ json_seg6local_context);
+
if (nexthop->nh_srv6->seg6_segs &&
nexthop->nh_srv6->seg6_segs->num_segs == 1) {
json_seg6 = json_object_new_object();