This commit extends the `show ip route json` and `show ipv6 route json`
output to display the SRv6 encapsulation behavior associated with the
SRv6 nexthop.
```
router# show ipv6 route json
[...]
"2001:db8:1:1::1/128": [
{
"prefix": "2001:db8:1:1::1/128",
"prefixLen": 128,
"protocol": "static",
"selected": true,
"destSelected": true,
"distance": 1,
"metric": 0,
"installed": true,
"nexthops": [
{
"directlyConnected": true,
"active": true,
"weight": 1,
"seg6local": {
"action": "unspec"
},
"seg6": [
"fcbb:bbbb:1:2:3:4:5:6",
"fcbb:bbbb:7:8:fe00::"
],
"srv6EncapBehavior": "H.Encaps"
}
]
}
],
[...]
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
&nexthop->nh_srv6->seg6_segs
->seg[0]);
json_object_object_add(json_nexthop, "seg6", json_seg6);
+ json_object_string_add(json_nexthop, "srv6EncapBehavior",
+ srv6_headend_behavior2str(
+ nexthop->nh_srv6->seg6_segs->encap_behavior));
} else {
if (nexthop->nh_srv6->seg6_segs) {
json_segs = json_object_new_array();
->seg[seg_idx]));
json_object_object_add(json_nexthop, "seg6",
json_segs);
+ json_object_string_add(json_nexthop, "srv6EncapBehavior",
+ srv6_headend_behavior2str(
+ nexthop->nh_srv6->seg6_segs
+ ->encap_behavior));
}
}
}