diff options
| author | Hiroki Shirokura <slank.dev@gmail.com> | 2020-12-31 11:56:32 +0000 |
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2021-06-02 10:24:48 -0400 |
| commit | ac6a9479af182fad4810fe6d21abc73f39c751f9 (patch) | |
| tree | f0e2de60e74c2fcbd95a6920a50fbb5483108271 /zebra/zebra_srv6_vty.c | |
| parent | 6e9e2233270ea4176f6851472947f2c03329a662 (diff) | |
zebra: add zapi_srv6_locator_chunk_{en,de}code
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Diffstat (limited to 'zebra/zebra_srv6_vty.c')
| -rw-r--r-- | zebra/zebra_srv6_vty.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c index 0bc48f6339..803e9f1196 100644 --- a/zebra/zebra_srv6_vty.c +++ b/zebra/zebra_srv6_vty.c @@ -246,7 +246,26 @@ DEFPY (locator_prefix, struct listnode *node = NULL; locator->prefix = *prefix; + + /* + * TODO(slankdev): please support variable node-bit-length. + * In draft-ietf-bess-srv6-services-05#section-3.2.1. + * Locator block length and Locator node length are defined. + * Which are defined as "locator-len == block-len + node-len". + * In current implementation, node bits length is hardcoded as 24. + * It should be supported various val. + * + * Cisco IOS-XR support only following pattern. + * (1) Teh locator length should be 64-bits long. + * (2) The SID block portion (MSBs) cannot exceed 40 bits. + * If this value is less than 40 bits, + * user should use a pattern of zeros as a filler. + * (3) The Node Id portion (LSBs) cannot exceed 24 bits. + */ + locator->block_bits_length = prefix->prefixlen - 24; + locator->node_bits_length = 24; locator->function_bits_length = func_bit_len; + locator->argument_bits_length = 0; if (list_isempty(locator->chunks)) { chunk = srv6_locator_chunk_alloc(); |
