-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: add seg6localContext json attribute in nexthop information #16535
Conversation
ff2db4e
to
672d423
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, other than that LGTM.
lib/srv6.c
Outdated
case ZEBRA_SEG6_LOCAL_ACTION_END_DX4: | ||
json_object_string_addf(json, "nh4", "%pI4", &ctx->nh4); | ||
return; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Drop this empty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/srv6.c
Outdated
case ZEBRA_SEG6_LOCAL_ACTION_END_DX6: | ||
json_object_string_addf(json, "nh6", "%pI6", &ctx->nh6); | ||
return; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Drop this empty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/srv6.c
Outdated
case ZEBRA_SEG6_LOCAL_ACTION_END: | ||
json_object_boolean_add(json, "USP", true); | ||
return; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Drop this empty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/srv6.c
Outdated
@@ -71,6 +71,48 @@ int snprintf_seg6_segs(char *str, | |||
return strlen(str); | |||
} | |||
|
|||
/* return true if json context has been filled in, false otherwise */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Some srv6 behaviors have a context attached that is visible if no json is requested: > # show ipv6 route > [..] > B>* 2001:db8:1:1:100::/128 [20/0] is directly connected, vrf10, seg6local End.DT6 table 10, weight 1, 00:00:14 > B>* 2001:db8:1:1:200::/128 [20/0] is directly connected, vrf20, seg6local End.DT6 table 20, weight 1, 00:00:14 > The json does not dump this attribute: > # show ipv6 route 2001:db8:1:1:100::/128 json > [..] > "nexthops":[ > { > "flags":3, > "fib":true, > "directlyConnected":true, > "interfaceIndex":6, > "interfaceName":"vrf10", > "active":true, > "weight":1, > "seg6local":{ > "action":"End.DT6" > }, > } > Add the json support for this. > "nexthops":[ > { > "flags":3, > "fib":true, > "directlyConnected":true, > "interfaceIndex":6, > "interfaceName":"vrf10", > "active":true, > "weight":1, > "seg6local":{ > "action":"End.DT6" > }, > "seg6localContext":{ > "table":10 > } > } > Signed-off-by: Philippe Guibert <[email protected]>
672d423
to
5d027fc
Compare
Some srv6 behaviors have a context attached that is visible if no json is requested:
The json does not dump this attribute:
Add the json support for this.