mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-10 16:42:44 +00:00
lib: Add a function to print SRv6 Endpoint Behavior Codepoints
Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
This commit is contained in:
parent
57031d43ce
commit
2025a0c617
36
lib/srv6.h
36
lib/srv6.h
@ -186,6 +186,42 @@ enum srv6_endpoint_behavior_codepoint {
|
|||||||
SRV6_ENDPOINT_BEHAVIOR_OPAQUE = 0xFFFF,
|
SRV6_ENDPOINT_BEHAVIOR_OPAQUE = 0xFFFF,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert SRv6 endpoint behavior codepoints to human-friendly string.
|
||||||
|
*/
|
||||||
|
static inline const char *
|
||||||
|
srv6_endpoint_behavior_codepoint2str(enum srv6_endpoint_behavior_codepoint behavior)
|
||||||
|
{
|
||||||
|
switch (behavior) {
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_RESERVED:
|
||||||
|
return "Reserved";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END:
|
||||||
|
return "End";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_X:
|
||||||
|
return "End.X";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_DT6:
|
||||||
|
return "End.DT6";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_DT4:
|
||||||
|
return "End.DT4";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_DT46:
|
||||||
|
return "End.DT46";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_NEXT_CSID:
|
||||||
|
return "uN";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_X_NEXT_CSID:
|
||||||
|
return "uA";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_DT6_USID:
|
||||||
|
return "uDT6";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_DT4_USID:
|
||||||
|
return "uDT4";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_END_DT46_USID:
|
||||||
|
return "uDT46";
|
||||||
|
case SRV6_ENDPOINT_BEHAVIOR_OPAQUE:
|
||||||
|
return "Opaque";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Unspec";
|
||||||
|
}
|
||||||
|
|
||||||
struct nexthop_srv6 {
|
struct nexthop_srv6 {
|
||||||
/* SRv6 localsid info for Endpoint-behaviour */
|
/* SRv6 localsid info for Endpoint-behaviour */
|
||||||
enum seg6local_action_t seg6local_action;
|
enum seg6local_action_t seg6local_action;
|
||||||
|
Loading…
Reference in New Issue
Block a user