summaryrefslogtreecommitdiff
path: root/bgpd/bgp_attr.h
diff options
context:
space:
mode:
authorRyoga Saito <contact@proelbtn.com>2021-08-31 06:13:17 +0000
committerRyoga Saito <contact@proelbtn.com>2021-09-03 01:19:45 +0000
commit9299fd00e7f75353d517627951b9b41b3b7bd339 (patch)
tree064fa444c24603a5d802e087b93599afe65fae86 /bgpd/bgp_attr.h
parenta45cd34e544ed3b3d342cc57e8fa5fa0832764c0 (diff)
bgpd: introduce SID structure information
draft-ietf-bess-srv6-services-07 defines new SID structure Sub-Sub-TLV. This patch adds SID structure information to bgp_attr_srv6_l3vpn. This patch also defines default SID stucture used by following patches. Signed-off-by: Ryoga Saito <contact@proelbtn.com>
Diffstat (limited to 'bgpd/bgp_attr.h')
-rw-r--r--bgpd/bgp_attr.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index 7eb1c8cf0e..955fde1450 100644
--- a/bgpd/bgp_attr.h
+++ b/bgpd/bgp_attr.h
@@ -79,6 +79,14 @@
/* SRv6 Service Data Sub-Sub-TLV types */
#define BGP_PREFIX_SID_SRV6_L3_SERVICE_SID_STRUCTURE 1
+/* SRv6 SID Structure default values */
+#define BGP_PREFIX_SID_SRV6_LOCATOR_BLOCK_LENGTH 40
+#define BGP_PREFIX_SID_SRV6_LOCATOR_NODE_LENGTH 24
+#define BGP_PREFIX_SID_SRV6_FUNCTION_LENGTH 16
+#define BGP_PREFIX_SID_SRV6_ARGUMENT_LENGTH 0
+#define BGP_PREFIX_SID_SRV6_TRANSPOSITION_LENGTH 16
+#define BGP_PREFIX_SID_SRV6_TRANSPOSITION_OFFSET 64
+
#define BGP_ATTR_NH_AFI(afi, attr) \
((afi != AFI_L2VPN) ? afi : \
((attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV4) ? AFI_IP : AFI_IP6))
@@ -142,6 +150,12 @@ struct bgp_attr_srv6_l3vpn {
uint8_t sid_flags;
uint16_t endpoint_behavior;
struct in6_addr sid;
+ uint8_t loc_block_len;
+ uint8_t loc_node_len;
+ uint8_t func_len;
+ uint8_t arg_len;
+ uint8_t transposition_len;
+ uint8_t transposition_offset;
};
/* BGP core attribute structure. */