Commit graph

20 commits

Author SHA1 Message Date
Carmine Scarpitta a3ff3dff3f lib,zebra: Add SRv6 uSID info to VTY output
In this commit, we extend to print the `SRV6_LOCATOR_USID` flag.
The output appears as follows:

```
{
  "locators":[
    {
      "name":"loc1",
      "prefix":"fc00:0:1::/48",
      "blockBitsLength":32,
      "nodeBitsLength":16,
      "functionBitsLength":16,
      "argumentBitsLength":0,
      "uSID":true,
      "statusUp":true,
      "chunks":[
        {
          "prefix":"fc00:0:1::/48",
          "proto":"bgp"
        }
      ]
    }
  ]
}
```

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-11-08 22:44:23 +01:00
Carmine Scarpitta 537b8b13f9 zebra: Do not allow SRv6 func_bit_len > 20
Currently, the SID transposition algorithm implemented in bgpd handles
incorrectly the SRv6 locators with function length greater than 20 bits.
To prevent issues, we currently limit the function length to 20 bits.

This limit will be removed when the bgpd SID transposition is fixed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 16:08:24 +02:00
Carmine Scarpitta 34e3711fb4 zebra: Ensure SRv6 SID length does not exceed 128
According to RFC 8986, the SRv6 SID length cannot exceed 128 bits. This
commit ensures that the condition
`block_len + node_len + function_len + arg_len <= 128` is satisfied when
a new SRv6 locator is created.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 16:08:24 +02:00
Carmine Scarpitta d9d3179942 zebra: add missing bits len to SRv6 locator detail
This commit adds SRv6 locator's block length, node length and argument
length to the output of the command
"show segment-routing srv6 locator NAME detail [json]".

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 15:37:26 +02:00
Carmine Scarpitta 780c13eb8d zebra: add block/node/arg len to zebra sr config
This commit adds the SRv6 locator's block length, node length and
argument length to the SRv6 configuration.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 15:37:25 +02:00
Carmine Scarpitta 5e04508c92 zebra: add new CLI args "block-len" and "node-len"
In the current implementation, an SRv6 locator only supports the
following structure:
* node-len = 24
* block-len = prefix-len - 24
* function-len = <configurable>
* argument-len = 0

This commit adds two optional arguments to the locator_prefix CLI
command: "node-len" and "block-len". These arguments allows an user to
configure the block length and node length of a SRv6 locator according
to the following logic:
* the node-len + block-len = prefix-len constraint must always be
satisfied;
* if node-len and block-len are both omitted, they are calculated as in
the current implementation (for backward compatibility reasons)
* if node-len is omitted, its value is computed as
prefix-len - block-len
* if block-len is omitted, its value is computed as
prefix-len - node-len

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 15:37:25 +02:00
Ryoga Saito 8bcda259ec zebra: expand func-bits
In order to set function length of SID freely, this PR relieves the
lower limitation of `func-bits`.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-10-07 18:26:52 +09:00
Ryoga Saito 85521aaabd zebra: add default SRv6 Function length
Add default SRv6 Function Length for usecases like SRv6 L3VPN. The
default value (16) comes from the default Function length for SRv6
L3VPN in BGPd.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-10-07 11:34:20 +09:00
Nobuhiro MIKI fbd01eaa41 zebra: output optional param "func-bits" for SRv6
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
2022-03-28 17:37:45 +09:00
Donatas Abraitis e69ae079b7
Merge pull request #9899 from Drumato/zebra-srv6-locator-detail-json-support
zebra: Add support for json output in srv6 locator detail command
2021-12-14 09:11:36 +02:00
Yamato Sugawara 559f4b2f2a zebra: Add support for json output in srv6 locator detail command
Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
2021-11-28 23:53:41 +00:00
Donatas Abraitis 962af8a8cd zebra: Convert vty_out to vty_json for JSON
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25 17:49:46 +02:00
Hiroki Shirokura 0a735cd523 zebra: add srv6's no commands
CURRENT_CONFIGURATION:
configure terminal
 segment-routing
  srv6
   locators
    locator loc1
    locator loc2
    locator loc3

CMD1: delete single locator
configure terminal
 segment-routing
  srv6
   locators
    no locator loc1

CMD2: delete srv6 whole config (== delete all locators)
configure terminal
 segment-routing
  no srv6

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07 12:54:39 +00:00
Igor Ryzhov 07679ad98a *: explicitly print "exit" at the end of every node config
There is a possibility that the same line can be matched as a command in
some node and its parent node. In this case, when reading the config,
this line is always executed as a command of the child node.

For example, with the following config:
```
router ospf
 network 193.168.0.0/16 area 0
!
mpls ldp
 discovery hello interval 111
!
```
Line `mpls ldp` is processed as command `mpls ldp-sync` inside the
`router ospf` node. This leads to a complete loss of `mpls ldp` node
configuration.

To eliminate this issue and all possible similar issues, let's print an
explicit "exit" at the end of every node config.

This commit also changes indentation for a couple of existing exit
commands so that all existing commands are on the same level as their
corresponding node-entering commands.

Fixes #9206.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-23 22:08:20 +03:00
Hiroki Shirokura f29aed7480 *: fix code format accourding to checkpatch
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura ac6a9479af zebra: add zapi_srv6_locator_chunk_{en,de}code
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura daedb8b3cf zebra: rewrite locator_prefix_cmd with DEFPY
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura 4df9d8592b *: fix code format accourding to checkpatch
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura 0097897734 zebra: add new CLI to manipulate srv6-locator (step2)
This commit is a part of #5853 works that add new clis to
configure SRv6 locator and its show commands.
Following clis are added on this commit.

vtysh -c 'conf te' \
  -c 'segment-routing' \
  -c ' srv6' \
  -c '  locators' \
  -c '   locator LOC1' \
  -c '    prefix A::/64'

- "show segment-routing srv6 sid [json]"
- "show segment-routing srv6 locator [json]"
- "show segment-routing srv6 locator NAME detail [json]"
- "show runnning-config" (make it to print srv6 configuration)

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:47 -04:00
Hiroki Shirokura 6c0a7c0941 *: new cli-nodes for SRv6 manager (step2)
This commit is a part of #5853 that add new cmd-node for SRv6 configuration.
This commit just add cmd-node and moving node cli only, acutual SRv6 config
command isn't added. (that is added later commit. of this branch)

new cli nodes:
* SRv6
* SRv6-locators
* SRv6-locator

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:47 -04:00