Implement common code for debug config output and remove daemon-specific
code that is duplicated everywhere.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
The debug library allows to register a `debug_set_all` callback which
should enable all debugs in a daemon. This callback is implemented
exactly the same in each daemon. Instead of duplicating the code, rework
the lib to allow registration of each debug type, and implement the
common code only once in the lib.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Pathd uses a single debug struct with additional option flags to
configure different types of debug messages. This is not how debug
library is supposed to be used. The idea of option flags is to allow
more granular control of a single type, not to represent multiple types.
This commit adds a separate debug struct for each type which greatly
simplifies the code.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
The following message appears after starting pathd:
> root@ubuntu2204:~# vtysh
> 2023/10/31 05:59:10 [K2CCG-5Y7ZJ] Excessive docstring while parsing 'msd (1-32)'
> 2023/10/31 05:59:10 [W7ENN-K2SVA] ----------
> 2023/10/31 05:59:10 [WCW75-6TZPF] PCC maximum SID depth value
> 2023/10/31 05:59:10 [W7ENN-K2SVA] ----------
Remove the excessive doc string in the pcep msd command.
Fixes: d6d2527448 ("pathd: fix 'no msd' command not possible under pcc node")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
It should be possible to reset the configured msd value,
and not mentioning the previous msd value.
> ubuntu2204(config-sr-te-pcep-pcc)# no msd
> % Command incomplete: no msd
> ubuntu2204(config-sr-te-pcep-pcc)#
Fix this by defining the msd parameter optional, and
separating the 'no msd' command from the 'msd' command.
Fixe: efba0985fc ("pathd: Add optional support for PCEP to pathd")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
The below running-configuration has extra spaces before the pce
port configuration:
> segment-routing
> traffic-engineering
> pce test
> address ip 192.0.2.2 port 1234
>
Fix this by keeping only one space.
> address ip 192.0.2.2 port 1234
Fixes: efba0985fc ("pathd: Add optional support for PCEP to pathd")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Rework "debug pathd pcep [...]" command to support the following
configurations:
- configure one debugging log type at a time.
- deconfigure one debugging log type at a time.
- configure all debugging logs in one shot.
- deconfigure all debugging logs in one shot.
Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Add "no pcep" command in segment-routing/traffic-engineering context
to deconfigure the whole pcep configuration (pce-config, pce and pcc).
Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Add "no" command for pcep pce/pce-config sub-commands, this will mainly
restart configured options to default values.
Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Rather than running selected source files through the preprocessor and a
bunch of perl regex'ing to get the list of all DEFUNs, use the data
collected in frr.xref.
This not only eliminates issues we've been having with preprocessor
failures due to nonexistent header files, but is also much faster.
Where extract.pl would take 5s, this now finishes in 0.2s. And since
this is a non-parallelizable build step towards the end of the build
(dependent on a lot of other things being done already), the speedup is
actually noticeable.
Also files containing CLI no longer need to be listed in `vtysh_scan`
since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL`
checks are equally obsolete.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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>
Instead of setting a config_write callback for each node, set a single
callback and print all config from there. It is necessary for the
following work on explicit "exit" command in every node.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
pce-config, pce and pcc node-entering commands in vtysh include no-form,
which is incorrect. Currently, when user passes a no-form command like
`no pcc`, vtysh enters the node while pathd deletes the node and this
leads to a desynchronization.
Regular and no-form commands should be defined separately to fix this.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
... by referencing all autogenerated headers relative to the root
directory. (90% of the changes here is `version.h`.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Brady Johnson <brady@voltanet.io>
Co-authored-by: Javier Garcia <javier.garcia@voltanet.io>
Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
on one hand, the default value for a peer preference was always being
displayed, and on the other there was some code in frr-reload.py which
was attempting to add a default value to match this behavior, and which
was incorrectly overriding a specified preference. Fix this by removing
this code and making pathd behave like other daemons in this respect,
i.e. not displaying the default value.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Show 'low' if a pce has disconnect or 'normal' . It's only a boolean so
it's like a token that mark the pce that has recenty disconnect.
Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
This new dynamic module makes pathd behave as a PCC for dynamic candidate path
using the external library pcpelib https://github.com/volta-networks/pceplib .
The candidate paths defined as dynamic will trigger computation requests to the
configured PCE, and the PCE response will be used to update the policy.
It supports multiple PCE. The one with smaller precedence will be elected
as the master PCE, and only if the connection repeatedly fails, the PCC will
switch to another PCE.
Example of configuration:
segment-routing
traffic-eng
pcep
pce-config CONF
source-address ip 10.10.10.10
sr-draft07
!
pce PCE1
config CONF
address ip 1.1.1.1
!
pce PCE2
config CONF
address ip 2.2.2.2
!
pcc
peer PCE1 precedence 10
peer PCE2 precedence 20
!
!
!
!
Co-authored-by: Brady Johnson <brady@voltanet.io>
Co-authored-by: Emanuele Di Pascale <emanuele@voltanet.io>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Co-authored-by: Javier Garcia <javier.garcia@voltanet.io>
Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: Sebastien Merle <sebastien@netdef.org>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>