summaryrefslogtreecommitdiffstats
path: root/nhrpd/debug.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-01-18doc: add doc for daemon-specific log cliMark Stapp1-0/+14
Add doc for the daemon-specific log file cli Signed-off-by: Mark Stapp <mjs@labn.net>
2024-01-17lib,vtysh: add per-daemon log file configMark Stapp6-12/+79
Add a config that specifies per-deamon log file names. Move the handy generated list of daemon names from vtysh to lib; edit the gitignore files to match. Signed-off-by: Mark Stapp <mjs@labn.net>
2024-01-17tests: fix munet accessing missing attributeChristian Hopps1-4/+1
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-16tests: Adopt tests for AS4 handlingDonatas Abraitis2-5/+6
When received malformed AS4 capability, it should return -1 (notification send), and the received flag SHOULD NOT be set. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Send notification if AS4 capability failed to parse (malformed)Donatas Abraitis1-1/+1
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Set role capability received flag only if parsed correctlyDonatas Abraitis1-1/+3
If we receive a malformed packet, we might end-up with a bad state. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Set hostname capability received flag only if parsed correctlyDonatas Abraitis1-2/+2
If we receive a malformed packet, we might end-up with a bad state. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Set ADD-PATH capability received flag only if parsed correctlyDonatas Abraitis1-2/+2
If we receive a malformed packet, we might end-up with a bad state. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Set AS4 capability received flag only if parsed correctlyDonatas Abraitis1-2/+2
If we receive a malformed packet, we might end-up with a bad state. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-15tests: import munet 0.13.12Christian Hopps2-9/+25
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-15tests: set environment variable munet 0.13.12 will useChristian Hopps1-1/+3
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-15doc: typo, fix end of lineVincent Jardin2-2/+2
Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-01-15tests: add tests for mgmt get-data exact node requestIgor Ryzhov3-0/+35
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-15lib, mgmtd: add ability to request the exact node in get-data requestIgor Ryzhov3-2/+15
RESTCONF expects to receive the exact node as a result, not the whole data tree. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-15lib: fix oper data leaf creationIgor Ryzhov1-1/+11
When creating an initial tree trunk for oper data walk, if the xpath represents a leaf, the leaf is created with an incorrect empty value. If it doesn't actually exist in daemon's oper data, its value is not overwritten later and an empty value is returned in the result. For example, when requesting `/frr-interface:lib/interface[name='eth0']/description`, the result is: ``` { "frr-interface:lib": { "interface": [ { "name": "eth0", "description": "" } ] } } ``` instead of an empty JSON that it should be. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-15tests: add tests for mgmt get-data with configIgor Ryzhov6-3/+69
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-15lib, mgmtd: add ability to set content type in get-data requestIgor Ryzhov9-15/+88
Like in RESTCONF GET request and NETCONF get-data request, make it possible to request state-only, config-only, or all data. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-14lib, mgmtd: add separate get-data request for the frontendIgor Ryzhov8-23/+43
Currently it's the same as get-tree request for the backend, but it is going to be expanded in the following commits. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-14vtysh, mgmtd: send interface commands to mgmtdIgor Ryzhov2-2/+5
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-14mgmtd: add option to specify netns as the vrf backendIgor Ryzhov6-2/+10
mgmtd has to know if netns is used as the vrf backend to correctly process interface names in northbound. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-14lib: fix yang_lyd_trim_xpathIgor Ryzhov1-12/+15
We should traverse all top-level siblings, not only the first one. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-14yang: lib: interface MTUs can be larger than uint16Christian Hopps2-5/+6
Technically changing a leaf from uint16 to uint32 is a NBC change; however, increasing this to uint32 should not break anyone in reality. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-13doc: update config file doc for integrated requirementChristian Hopps20-102/+89
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-13doc: mgmtd: update mgmtd conversion doc to be current.Christian Hopps3-90/+119
Also change `be_client_xpaths` to `be_client_config_xpaths` referred in the doc to make much clearer it's use (since there's a separate `be_client_oper_xpaths`. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-13mgmtd: remove full vrf initializationIgor Ryzhov1-51/+2
We don't really need full VRF infrastructure in mgmtd. We only need to register vty commands. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-12pimd: Use vrf name instead of id in some debugsDonald Sharp1-5/+5
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-12pimd: Re-align pim_msg_get_jp_group_sizeDonald Sharp1-72/+66
This function was/is heavily indented, let's refactor this a bit. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-12lib: fix coverity issueChristian Hopps1-1/+2
** CID 1575595: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-12mgmtd: remove redundant next_phase variableIgor Ryzhov1-42/+22
next_phase is always curr_phase + 1. It's not necessary to maintain it separately. Also rename curr_phase to phase. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-12build: make buildtest.sh BSD compatibleSeyed Pouria Mousavizadeh Tehrani1-5/+6
Signed-off-by: Seyed Pouria Mousavizadeh Tehrani <p.mousavizadeh@protonmail.com>
2024-01-12bgpd: Drop dampening `tmax` variable from structDonatas Abraitis1-1/+0
Not used anywhere. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-11lib, mgmtd: rename ignore_cbs to ignore_cfg_cbsIgor Ryzhov5-27/+28
Setting this variable to true makes NB ignore only configuration-related callbacks. CLI-related callbacks are still loaded and executed, so rename the variable to make it clearer. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmtd: remove unused pending_be_proc variableIgor Ryzhov1-3/+0
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmtd: don't try to send config to disconnected clientsIgor Ryzhov1-8/+8
When determining the interested backend clients for a configuration change, don't consider disconnected clients. This fixes a crash in `mgmt_txn_send_be_txn_create` when trying to send data to a non-existing adapter. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11bgpd: Set correct TTL for the dynamic neighbor peersRajesh Varatharaj1-0/+13
In an EBGP multihop configuration with dynamic neighbors, the TTL configured is not being updated for the socket. Issue: Assume the following topology: Host (Dynamic peer to spine - 192.168.1.100) - Leaf - Spine (192.168.1.1) When the host establishes a BGP multihop session to the spine, the connection uses the MAXTTL value instead of the configured TTL (in this case, 2). This issue is only observed with dynamic peers. Logs: look at the TTL is still MAXTTL, instead of “2” configured. 18:13:18.872395 48:b0:2d:0c:58:0b > 48:b0:2d:66:64:6b, ethertype IPv4 (0x0800), length 85: (tos 0xc0, ttl 255, id 32078, offset 0, flags [DF], proto TCP (6), length 71) 192.168.1.100.179 > 192.168.1.1.40967: Flags [P.], cksum 0xfe89 (correct), seq 28406:28425, ack 28424, win 255, options [nop,nop,TS val 4192664793 ecr 2814447051], length 19: BGP Keepalive Message (4), length: 19 Fix: Whenever a dynamic peer is created, the socket TTL should be updated with the configured TTL, in this case 2. 19:13:24.894890 48:b0:2d:0c:58:0b > 48:b0:2d:66:64:6b, ethertype IPv4 (0x0800), length 85: (tos 0xc0, ttl 2, id 1131, offset 0, flags [DF], proto TCP (6), length 71) 192.168.1.100.179 > 192.168.1.1.41937: Flags [P.], cksum 0x7a67 (correct), seq 2046150759:2046150778, ack 4286110599, win 255, options [nop,nop,TS val 4196270815 ecr 2818051226], length 19: BGP Keepalive Message (4), length: 19 Testing: UT UT logs: 2023-12-29T19:13:21.892205+00:00 host bgpd[1591425]: [WWPV7-YSZB5] Dynamic Neighbor 192.168.1.1/32 matches group test listen range 192.168.1.0/30 2023-12-29T19:13:21.892654+00:00 host bgpd[1591425]: [GBPAR-M31QF] 192.168.1.1 Dynamic Neighbor added, group test count 1 2023-12-29T19:13:21.892993+00:00 host bgpd[1591425]: [GPE2H-K9QRE] bgp_set_socket_ttl: set TxTTL on peer (rtrid 0.0.0.0) socket, err = 2, peer ttl 2 Conflicts: bgpd/bgp_network.c Ticket: # Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2024-01-11lib: fix coverity issuesChristian Hopps3-4/+3
** CID 1575504: Insecure data handling (TAINTED_SCALAR) (maybe) ** CID 1575505: Integer handling issues (CONSTANT_EXPRESSION_RESULT) ** CID 1575506: Integer handling issues (CONSTANT_EXPRESSION_RESULT) ** CID 1575507: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-11pimd: Make some not very needed debugs more restrictiveDonald Sharp2-2/+2
When turning on debug pim trace, there are lots of messages surrounding the timing of rpf lookup. 99% of the time no-one cares about these anymore. Let's make them not seen unless we turn up debugs Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-11pimd: Receiving a Join or Prune should be under J_P debugsDonald Sharp1-3/+3
The Join or Prune messages require you to turn on `trace` but this is part of Join/Prune processing of the packet let's use PIM_DEBUG_PIM_J_P instead of TRACE here. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-11lib: change type of `inner` to `struct lyd_node *`, cleaner codeChristian Hopps1-31/+40
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-11bgpd: fix debug rpki display in show runPhilippe Guibert1-8/+28
Only include "debug rpki" in "show run" if it was requested from the configure mode but not it was from the enabled mode. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11lib: implement missing YANG choice/case statements.Christian Hopps4-41/+117
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-11bgpd: add hooks for displaying module debug messagesPhilippe Guibert2-0/+15
when a plugin is attached, some debugs may be attached to that plugin. For that, add one hook that is interacting with vty: a boolean indicates what the usage is for: either for impacting the 'show running-config', or for impacting the 'show debugging' command. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11doc: add show rpki configurationLouis Scalbert1-0/+4
Add documentation about the new "show rpki configuration" command. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11bgpd: do not show default rpki timers in show runPhilippe Guibert1-0/+50
"show run" displays the default RPKI timers when at least one cache server is configured. Only display the RPKI timers that differs from the default values. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11bgpd: remove double spaces with rpki running config & sshPhilippe Guibert1-1/+1
remove double spaces when doing show running-config. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11bgpd: fix resetting rpki timer at no rpkiLouis Scalbert1-0/+4
RPKI configuration is not totally flushed when doing "no rpki". Timers remains to default values. > r2# sh run bgpd > [...] > rpki > rpki retry_interval 5 > rpki cache 192.0.2.1 15432 preference 1 > exit > [...] > r2# conf t > r2(config)# no rpki > r2(config)# do sh run > [...] > rpki > rpki retry_interval 5 > exit Reset the timers after doing "no rpki" Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11bgpd: fix crash when re-adding a rpki serverLouis Scalbert1-0/+4
Fix a crash when re-adding a rpki server: > r2# sh run bgpd > [...] > rpki > rpki retry_interval 5 > rpki cache 192.0.2.1 15432 preference 1 > exit > [...] > r2# conf t > r2(config)# rpki > r2(config-rpki)# no rpki cache 192.0.2.1 15432 preference 1 > r2(config-rpki)# do show rpki cache-connection > Cannot find a connected group. > r2(config-rpki)# rpki cache 192.0.2.1 15432 preference 1 > r2(config-rpki)# do show rpki cache-connection > vtysh: error reading from bgpd: Resource temporarily unavailable (11)Warning: closing connection to bgpd because of an I/O error! > #0 raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50 > #1 0x00007f3fd2d16e57 in core_handler (signo=11, siginfo=0x7ffffd5931b0, context=0x7ffffd593080) at lib/sigevent.c:246 > #2 <signal handler called> > #3 0x00007f3fd26926b4 in tommy_list_head (list=0x2e322e302e323931) at /home/lscalber/git/rtrlib/./third-party/tommyds/tommylist.h:125 > #4 0x00007f3fd2693812 in rtr_mgr_get_first_group (config=0x55fbf31d7f00) at /home/lscalber/git/rtrlib/rtrlib/rtr_mgr.c:409 > #5 0x00007f3fd2ebef59 in get_connected_group () at bgpd/bgp_rpki.c:718 > #6 0x00007f3fd2ec0b39 in show_rpki_cache_connection_magic (self=0x7f3fd2ec69c0 <show_rpki_cache_connection_cmd>, vty=0x55fbf31f9ef0, argc=3, argv=0x55fbf31f99d0, uj=0x0) > # at bgpd/bgp_rpki.c:1575 > #7 0x00007f3fd2ebd4da in show_rpki_cache_connection (self=0x7f3fd2ec69c0 <show_rpki_cache_connection_cmd>, vty=0x55fbf31f9ef0, argc=3, argv=0x55fbf31f99d0) at ./bgpd/bgp_rpki_clippy.c:648 > #8 0x00007f3fd2c8a142 in cmd_execute_command_real (vline=0x55fbf31f9990, vty=0x55fbf31f9ef0, cmd=0x0, up_level=0) at lib/command.c:978 > #9 0x00007f3fd2c8a25c in cmd_execute_command (vline=0x55fbf31e5260, vty=0x55fbf31f9ef0, cmd=0x0, vtysh=0) at lib/command.c:1028 > #10 0x00007f3fd2c8a7f1 in cmd_execute (vty=0x55fbf31f9ef0, cmd=0x55fbf3200680 "do show rpki cache-connection ", matched=0x0, vtysh=0) at lib/command.c:1203 > #11 0x00007f3fd2d36548 in vty_command (vty=0x55fbf31f9ef0, buf=0x55fbf3200680 "do show rpki cache-connection ") at lib/vty.c:594 > #12 0x00007f3fd2d382e1 in vty_execute (vty=0x55fbf31f9ef0) at lib/vty.c:1357 > #13 0x00007f3fd2d3a519 in vtysh_read (thread=0x7ffffd5963c0) at lib/vty.c:2365 > #14 0x00007f3fd2d2faf6 in event_call (thread=0x7ffffd5963c0) at lib/event.c:1974 > #15 0x00007f3fd2cc238e in frr_run (master=0x55fbf2a0cd60) at lib/libfrr.c:1214 > #16 0x000055fbf073de40 in main (argc=9, argv=0x7ffffd596618) at bgpd/bgp_main.c:510 Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11topotests: bgp_rpki_topo1, failure on error packetLouis Scalbert2-0/+23
RPKI FRR module should not send any RPKI error packet during the tests. Exit rtrd when receiving error packet. Skip tests with errors if rtrd has stopped. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11topotests: log bgp_rpki_topo1 pyrtr outputLouis Scalbert2-4/+16
Log bgp_rpki_topo1 pyrtr output Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-11topotests: add bgp_rpki_topo1Louis Scalbert17-0/+808
Add bgp_rpki_topo1 topotest to validate the RPKI feature. Use a RTR RPKI server from the above link with a black cleaning. Link: https://raw.githubusercontent.com/tmshlvck/pyrtr/90df586375396aae08b07069187308b5b7b8823b/pyrtr/__init__.py Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>