Commit graph

148 commits

Author SHA1 Message Date
Christian Hopps f5a8b8aedf
Merge pull request #18610 from lsang6WIND/yang-isisd
fix yang commands that don't have yang attr
2025-04-15 10:25:51 -05:00
Mark Stapp 06614a803b pathd: clean up variable-shadow warnings
Clean up various variable-shadow warnings from -Wshadow

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-08 14:41:27 -04:00
Loïc Sang de5eaf322b pathd: add YANG attr to YANG cmd
Those commands are using northbound api, add YANG attr to them. This
will allow them to use with pending commit, else the validation will
failed as they are detected as non YANG cmd.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
2025-04-08 16:58:37 +02:00
Donatas Abraitis 8f5821eb77 pathd: Replace ctime_r() with time_to_string()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-20 17:58:49 +02:00
Donald Sharp d97c535c1e *: Create termtable specific temp memory
When trying to track down a MTYPE_TMP memory leak
it's harder to search for it when you happen to
have some usage of ttable_dump.  Let's just give
it it's own memory type so that we can avoid
confusion in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-01 13:07:46 -04:00
Igor Ryzhov 830972cab2 lib: common debug status output
Implement common code for debug status output and remove daemon-specific
code that is duplicated everywhere.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-27 09:53:02 -04:00
Igor Ryzhov 82e52e0f21 lib: common debug config output
Implement common code for debug config output and remove daemon-specific
code that is duplicated everywhere.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-27 09:53:02 -04:00
Igor Ryzhov 5dac696154 lib: rework debug init
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>
2024-08-27 09:53:02 -04:00
Igor Ryzhov 1797b7eefc pathd: rework debugs
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>
2024-08-20 11:07:45 -04:00
Donald Sharp 33af3c0278 pathd: Cleanup shutdown memory leaks
Just some code to cleanup the shutdown memory leaks
that are in pathd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-12 10:14:31 -04:00
Mark Stapp abaad07b98 pathd: clean up a log message
Clean up a typo in a log message.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-30 14:34:58 -04:00
Mark Stapp 7a28f78ad9 pathd: retry synchronous label-manager zapi connection
Be prepared to retry setting up pathd's synchronous zapi session
that's used for label-manager.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-30 14:33:13 -04:00
Mark Stapp 72b31b96fc *: create a single registry of daemons' default port values
Create a single registry of default port values that daemons
are using. Most of these are vty ports, but there are some
others for features like ospfapi and zebra FPM.

Signed-off-by: Mark Stapp <mjs@labn.net>
2024-02-01 11:40:02 -05:00
David Lamparter 634f481113 *: fix frr_daemon_info indentation
clang-format doesn't understand FRR_DAEMON_INFO is a long macro where
laying out items semantically makes sense.

(Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get
confused with the mismatching `( ( )`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:02:51 +01:00
Philippe Guibert dba04c2f3c pathd: add 'show sr-te pcep session json' support
Add support to dump sr-te pcep session in json output.

> ubuntu2204# show sr-te pcep session
> PCE q
>  PCE IP 192.0.2.40 port 4189
>  PCC IP 192.0.2.10 port 4189
>  PCC MSD 10
>  Session Status UP
>  Precedence 10, best candidate
>  Confidence normal
>  Timer: KeepAlive config 30, pce-negotiated 70
>  Timer: DeadTimer config 120, pce-negotiated 120
>  Timer: PcRequest 30
>  Timer: SessionTimeout Interval 30
>  Timer: Delegation Timeout 10
>  No TCP MD5 Auth
>  PCE SR Version draft07
>  Next PcReq ID 5
>  Next PLSP  ID 2
>  Connected for 171 seconds, since 2023-10-28 09:36:44 UTC
>  PCC Capabilities: [PCC Initiated LSPs] [Stateful PCE] [SR TE PST]
>  PCE Capabilities: [Stateful PCE] [SR TE PST]
>  PCEP Message Statistics
>                         Sent   Rcvd
>          Message Open:     2      1
>     Message KeepAlive:     1      6
>         Message PcReq:     4      0
>         Message PcRep:     0      0
>        Message Notify:     4      0
>         Message Error:     0      5
>         Message Close:     0      0
>        Message Report:     5      0
>        Message Update:     0      1
>      Message Initiate:     0      0
>      Message StartTls:     0      0
>     Message Erroneous:     0      0
>                 Total:    16     13
> PCEP Sessions => Configured 1 ; Connected 1
> ubuntu2204# show sr-te pcep session  json
> {
>   "pcepSessions":[
>     {
>       "pceName":"q",
>       "pceAddress":"192.0.2.40",
>       "pcePort":4189,
>       "pccAddress":"192.0.2.10",
>       "pccPort":4189,
>       "pccMsd":10,
>       "sessionStatus":"UP",
>       "bestMultiPce":true,
>       "precedence":10,
>       "confidence":"normal",
>       "keepaliveConfig":30,
>       "deadTimerConfig":120,
>       "pccPcepRequestTimerConfig":30,
>       "sessionTimeoutIntervalSec":30,
>       "delegationTimeout":10,
>       "tcpMd5Authentication":false,
>       "draft07":true,
>       "draft16AndRfc8408":false,
>       "nextPcRequestId":5,
>       "nextPLspId":2,
>       "sessionKeepalivePceNegotiatedSec":70,
>       "sessionDeadTimerPceNegotiatedSec":120,
>       "sessionConnectionDurationSec":177,
>       "sessionConnectionStartTimeUTC":"2023-10-28 09:36:44",
>       "pccCapabilities":" [PCC Initiated LSPs] [Stateful PCE] [SR TE PST]",
>       "pceCapabilities":" [Stateful PCE] [SR TE PST]",
>       "messageStatisticsReceived":{
>         "messageOpen":1,
>         "messageKeepalive":6,
>         "messagePcReq":0,
>         "messagePcRep":0,
>         "messageNotify":0,
>         "messageError":5,
>         "messageClose":0,
>         "messageReport":0,
>         "messageUpdate":1,
>         "messageInitiate":0,
>         "messageStartTls":0,
>         "messageErroneous":0,
>         "total":13
>       },
>       "messageStatisticsSent":{
>         "messageOpen":2,
>         "messageKeepalive":1,
>         "messagePcReq":4,
>         "messagePcRep":0,
>         "messageNotify":4,
>         "messageError":0,
>         "messageClose":0,
>         "messageReport":5,
>         "messageUpdate":0,
>         "messageInitiate":0,
>         "messageStartTls":0,
>         "messageErrneous":0,
>         "total":16
>       }
>     }
>   ],
>   "pcepSessionsConfigured":1,
>   "pcepSessionsConnected":1
> }

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-01-18 22:04:05 +01:00
Philippe Guibert 784c93cc62 pathd: add dynamic candidate path metric [computed] keyword
Add the 'computed' keyword for a given metric.

> [..]
> metric te computed

When set by the PCC, the PCE must send back a computed metric
value in the PCResponse value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-01-02 12:07:49 +01:00
Jafar Al-Gharaibeh 7f1e552a53
Merge pull request #14925 from pguibert6WIND/doctring_pathd_fix
pathd: fix excessive doc string on pcep msd command
2023-12-01 11:24:30 -06:00
Philippe Guibert 84e54c10ec pathd: fix excessive doc string on pcep msd command
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>
2023-12-01 14:29:53 +01:00
Christian Hopps 2c01083d35 lib: all: remove './' from xpath 22% speedup
fixes #8299

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-29 14:37:23 -05:00
Olivier Dugeon 81ccc5adad
Merge pull request #14762 from pguibert6WIND/show_pcep_port
pathd: fix space before pcep port in running-config
2023-11-29 14:41:47 +01:00
David Lamparter cc90c54b36 *: add zclient_options_sync
... and use it instead of fiddling with the `.synchronous` field.

(Make it const while at it.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-23 15:20:13 +01:00
Philippe Guibert d6d2527448 pathd: fix 'no msd' command not possible under pcc node
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>
2023-11-21 18:02:10 +01:00
Philippe Guibert 4730aeb5e5 pathd: fix space before pcep port in running-config
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>
2023-11-21 18:02:10 +01:00
Farid Mihoub a9ba982472 pathd: rework debug pathd pcep command
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>
2023-11-03 17:09:11 +01:00
Farid Mihoub 465130ac2a pathd: add no pcep command
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>
2023-10-31 12:02:42 +01:00
Farid Mihoub 444b08d16a pathd: add no msd command in the pcc context
Add the "no msd" command to deconfigure pcc/msd node.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
2023-10-31 12:02:37 +01:00
Mark Stapp 1a9f9ef602 pathd: replace ctime with ctime_r
No ctime - replace with ctime_r()

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-09-19 16:25:01 -04:00
Farid Mihoub 3b7c33ae74 pathd: reset pcc peer connection when pce options modified
Reset the PCC peer connection to take into account new changes of the
PCE options.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
2023-09-14 12:30:35 +02:00
Farid MIHOUB b38a50fc95 pathd: add no command for pce/pce-config sub-commands
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>
2023-09-14 12:26:41 +02:00
Donatas Abraitis 93ffc5a2fd pathd: Stop and free synchronous Zebra client on pathd termination
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-26 16:31:53 +03:00
Philippe Guibert 7b343a9ed5
Merge pull request #12933 from Orange-OpenSource/link_state
lib: Update edge key in link state database
2023-04-20 18:33:21 +02:00
Olivier Dugeon 7f2742b657 pathd: Update TE to new Link State Edge key
Following the modification of the edge key in link state database
this patch updates the path_ted.c file to replace the old uint64_t edge key by
the new ls_edge_key structure when searching for an edge.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:26 +02:00
Donald Sharp b589466918 *: Use a struct prefix *p instead of a struct prefix in functions
When passing a prefix into a function let's pass by address instead
of pass by value.  Let's save our stack space.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-06 18:00:09 -04:00
Donald Sharp 24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp cd9d053741 *: Convert struct event_master to struct event_loop
Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 2453d15dbf *: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 332beb64b8 *: Convert thread_cancelXXX to event_cancelXXX
Modify the code base so that thread_cancel becomes event_cancel

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 907a2395f4 *: Convert thread_add_XXX functions to event_add_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp e6685141aa *: Rename struct thread to struct event
Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp cb37cb336a *: Rename thread.[ch] to event.[ch]
This is a first in a series of commits, whose goal is to rename
the thread system in FRR to an event system.  There is a continual
problem where people are confusing `struct thread` with a true
pthread.  In reality, our entire thread.c is an event system.

In this commit rename the thread.[ch] files to event.[ch].

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:16 -04:00
Donald Sharp 8383d53e43
Merge pull request #12780 from opensourcerouting/spdx-license-id
*: convert to SPDX License identifiers
2023-02-17 09:43:05 -05:00
Donald Sharp 8974060760 pathd: Remove extraneous include of version.h
It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-10 09:07:46 -05:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Donald Sharp d5dea3506e pathd: Add missing enum's to switch statement
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31 15:15:42 -05:00
David Lamparter ae08de9f42 *: fix non-const northbound XPath format strings
Passing a pre-formatted buffer in these places needs a `"%s"` in front
so it doesn't get formatted twice.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27 12:01:20 +01:00
David Lamparter 0f9de11a11 *: apply proper format string attributes
So that we get warnings about broken format strings.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27 12:01:17 +01:00
Mark Stapp 040ca77097 pathd: fix SA warning in path_pcep_config
Fix an SA warning about a possibly-uninited local.

Signed-off-by: Mark Stapp <mjs@labn.net>
2022-12-19 11:36:03 -05:00
Philippe Guibert ec139f60f1 pathd: display SRTE policy status when removing policy
Create a function that logs the status of a given SR-TE policy.
Add a call to this function when a policy is being removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-11-14 17:42:55 +01:00
Philippe Guibert b5ca313856 pathd: some traces are added to 'debug pathd ted' command.
Some traces initially displayed will be hidden behind the
vty command: 'debug pathd ted'.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-11-14 17:42:55 +01:00