summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2023-09-12 14:33:42 +0200
committerGitHub <noreply@github.com>2023-09-12 14:33:42 +0200
commit48d6039e144e642394f703d407198547308fe918 (patch)
tree51a2ce29b92248ffd213bcb9d68fac2dccbefd22 /lib
parentMerge pull request #14364 from opensourcerouting/event-fix-delete-during-hash... (diff)
parentdoc: Add documentation for IS-IS SRv6 features (diff)
downloadfrr-48d6039e144e642394f703d407198547308fe918.tar.xz
frr-48d6039e144e642394f703d407198547308fe918.zip
Merge pull request #13724 from cscarpitta/feature/isisd-srv6-support
isisd: Add support for SRv6 uSID (RFC 9352)
Diffstat (limited to 'lib')
-rw-r--r--lib/command.h2
-rw-r--r--lib/srv6.h55
2 files changed, 49 insertions, 8 deletions
diff --git a/lib/command.h b/lib/command.h
index 3167c652c..718d34b00 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -172,6 +172,8 @@ enum node_type {
OPENFABRIC_NODE, /* OpenFabric router configuration node */
VRRP_NODE, /* VRRP node */
BMP_NODE, /* BMP config under router bgp */
+ ISIS_SRV6_NODE, /* ISIS SRv6 node */
+ ISIS_SRV6_NODE_MSD_NODE, /* ISIS SRv6 Node MSDs node */
NODE_TYPE_MAX, /* maximum */
};
/* clang-format on */
diff --git a/lib/srv6.h b/lib/srv6.h
index 0d3ee7d2f..7c8c6b4a6 100644
--- a/lib/srv6.h
+++ b/lib/srv6.h
@@ -24,6 +24,16 @@ extern "C" {
#define sid2str(sid, str, size) \
inet_ntop(AF_INET6, sid, str, size)
+/* SRv6 flavors manipulation macros */
+#define CHECK_SRV6_FLV_OP(OPS,OP) ((OPS) & (1 << OP))
+#define SET_SRV6_FLV_OP(OPS,OP) (OPS) |= (1 << OP)
+#define UNSET_SRV6_FLV_OP(OPS,OP) (OPS) &= ~(1 << OP)
+#define RESET_SRV6_FLV_OP(OPS) (OPS) = 0
+
+/* SRv6 Flavors default values */
+#define ZEBRA_DEFAULT_SEG6_LOCAL_FLV_LCBLOCK_LEN 32
+#define ZEBRA_DEFAULT_SEG6_LOCAL_FLV_LCNODE_FN_LEN 16
+
enum seg6_mode_t {
INLINE,
ENCAP,
@@ -50,15 +60,40 @@ enum seg6local_action_t {
ZEBRA_SEG6_LOCAL_ACTION_END_DT46 = 16,
};
+/* Flavor operations for SRv6 End* Behaviors */
+enum seg6local_flavor_op {
+ ZEBRA_SEG6_LOCAL_FLV_OP_UNSPEC = 0,
+ /* PSP Flavor as per RFC 8986 section #4.16.1 */
+ ZEBRA_SEG6_LOCAL_FLV_OP_PSP = 1,
+ /* USP Flavor as per RFC 8986 section #4.16.2 */
+ ZEBRA_SEG6_LOCAL_FLV_OP_USP = 2,
+ /* USD Flavor as per RFC 8986 section #4.16.3 */
+ ZEBRA_SEG6_LOCAL_FLV_OP_USD = 3,
+ /* NEXT-C-SID Flavor as per draft-ietf-spring-srv6-srh-compression-03
+ section 4.1 */
+ ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID = 4,
+};
+
struct seg6_segs {
size_t num_segs;
struct in6_addr segs[256];
};
+struct seg6local_flavors_info {
+ /* Flavor operations */
+ uint32_t flv_ops;
+
+ /* Locator-Block length, expressed in bits */
+ uint8_t lcblock_len;
+ /* Locator-Node Function length, expressed in bits */
+ uint8_t lcnode_func_len;
+};
+
struct seg6local_context {
struct in_addr nh4;
struct in6_addr nh6;
uint32_t table;
+ struct seg6local_flavors_info flv;
};
struct srv6_locator {
@@ -115,14 +150,18 @@ struct srv6_locator_chunk {
* https://www.iana.org/assignments/segment-routing/segment-routing.xhtml
*/
enum srv6_endpoint_behavior_codepoint {
- SRV6_ENDPOINT_BEHAVIOR_RESERVED = 0x0000,
- SRV6_ENDPOINT_BEHAVIOR_END_DT6 = 0x0012,
- SRV6_ENDPOINT_BEHAVIOR_END_DT4 = 0x0013,
- SRV6_ENDPOINT_BEHAVIOR_END_DT46 = 0x0014,
- SRV6_ENDPOINT_BEHAVIOR_END_DT6_USID = 0x003E,
- SRV6_ENDPOINT_BEHAVIOR_END_DT4_USID = 0x003F,
- SRV6_ENDPOINT_BEHAVIOR_END_DT46_USID = 0x0040,
- SRV6_ENDPOINT_BEHAVIOR_OPAQUE = 0xFFFF,
+ SRV6_ENDPOINT_BEHAVIOR_RESERVED = 0x0000,
+ SRV6_ENDPOINT_BEHAVIOR_END = 0x0001,
+ SRV6_ENDPOINT_BEHAVIOR_END_X = 0x0005,
+ SRV6_ENDPOINT_BEHAVIOR_END_DT6 = 0x0012,
+ SRV6_ENDPOINT_BEHAVIOR_END_DT4 = 0x0013,
+ SRV6_ENDPOINT_BEHAVIOR_END_DT46 = 0x0014,
+ SRV6_ENDPOINT_BEHAVIOR_END_NEXT_CSID = 0x002B,
+ SRV6_ENDPOINT_BEHAVIOR_END_X_NEXT_CSID = 0x002C,
+ SRV6_ENDPOINT_BEHAVIOR_END_DT6_USID = 0x003E,
+ SRV6_ENDPOINT_BEHAVIOR_END_DT4_USID = 0x003F,
+ SRV6_ENDPOINT_BEHAVIOR_END_DT46_USID = 0x0040,
+ SRV6_ENDPOINT_BEHAVIOR_OPAQUE = 0xFFFF,
};
struct nexthop_srv6 {