Commit graph

207 commits

Author SHA1 Message Date
Renato Westphal ca77b518bd *: introduce DEFPY_YANG & friends
DEFPY_YANG will allow the CLI to identify which commands are
YANG-modeled or not before executing them. This is going to be
useful for the upcoming configuration back-off timer work that
needs to commit pending configuration changes before executing a
command that isn't YANG-modeled.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-03 15:17:03 -03:00
Igor Ryzhov dc47ff5c3a vtysh: rework DEFPY processing in extract.pl
Currently, all DEFPY commands are translated into one-liners in
vtysh_cmd.c. After the patch, DEFPY commands are correctly indented just
like DEFUN/ALIAS commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-07-20 18:18:55 +03:00
Quentin Young 1d4cfa5de1 Revert "Rpki Encapsulation"
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-07-14 15:38:20 -04:00
Philippe Guibert 4a42034fa8 bgpd: duplicate config commands into rpki-vrf subnode
rpki vrf subnode is instantiated under the vrf subnode.
It it to be noted that this commit contains a change in vtysh.
Actually, the output of bgp daemon from show running-config is extracted
in vtysh, and reengineered ( hence the vtysh_config.c change done). This
permits having a subnode under vrf sub node.
Also, add vrf node support to bgpd, as rpki command can not be found
under vrf node.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-07-02 08:17:51 +02:00
Mark Stapp 478ff17be6 lib,sharpd: add a SHARP_STR alias
Add a vty-friendly protocol name alias for sharpd.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-10 08:26:27 -04:00
Rafael Zalamena d40d6c2274 bfdd,lib,vtysh: new command node for BFD profiles
Add the necessary code to implement the BFD profile command node.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-05-20 10:39:34 -03:00
Donald Sharp 2ff99507ad
Merge pull request #6135 from opensourcerouting/cli-node-cleanup
*: clean up the mess that is CLI command nodes
2020-04-16 19:24:56 -04:00
David Lamparter d1b221f696 lib: #define FRR_CMD_NODE_20200416
... requested by Lou.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-16 12:55:59 +02:00
David Lamparter 791ded4a62 *: add ->node_exit to struct cmd_node
Rather than doing a f*gly hack for the RPKI code, let's do an on-exit
hook in cmd_node.  Also allows replacing some special-casing in the vty
code.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:54:03 +02:00
David Lamparter 893d8beb4d zebra: fix FPM node reusing VTY_NODE
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-16 12:54:03 +02:00
David Lamparter f4b8291fcb *: move CLI node names to cmd_node->name
And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:59 +02:00
David Lamparter 243895805a *: move CLI parent data to cmd_node->parent_node
Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter 612c2c15d8 *: remove second parameter on install_node()
There is really no reason to not put this in the cmd_node.

And while we're add it, rename from pointless ".func" to ".config_write".

[v2: fix forgotten ldpd config_write]

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter 249a771b63 *: remove cmd_node->vtysh
The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter 0bdeb5e58d lib: rewrite zlog lock-free & TLS-buffered
This is a full rewrite of the "back end" logging code.  It now uses a
lock-free list to iterate over logging targets, and the targets
themselves are as lock-free as possible.  (syslog() may have a hidden
internal mutex in the C library;  the file/fd targets use a single
write() call which should ensure atomicity kernel-side.)

Note that some functionality is lost in this patch:
- Solaris printstack() backtraces are ditched (unlikely to come back)
- the `log-filter` machinery is gone (re-added in followup commit)
- `terminal monitor` is temporarily stubbed out.  The old code had a
  race condition with VTYs going away.  It'll likely come back rewritten
  and with vtysh support.
- The `zebra_ext_log` hook is gone.  Instead, it's now much easier to
  add a "proper" logging target.

v2: TLS buffer to get some actual performance

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-01 06:53:26 +02:00
bisdhdh 794b37d521 bgpd: Adding BGP GR Global & Per Neighbour FSM changes
* Added FSM for peer and global configuration for graceful restart
 * Added debug option BGP_GRACEFUL_RESTART for logs specific to
 graceful restart processing

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh b0965c44e9 bgpd: BGP Graceful Restart Per Neighbor(BGPN), DS & header files.
This pr contains all the header files changes for BGP GR per Neighbour(BGPN)
feature.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
David Lamparter 154e9ca142 lib: make cmd_element & qobj_type const
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30 00:38:32 +01:00
Quentin Young 1d92edb209
Merge pull request #5224 from manuhalo/fix_frr_reload_paths
Fixes and extensions to frr_reload.py
2019-11-19 17:12:38 -05:00
Donatas Abraitis 19d61463df vtysh: Add an option to set banner motd from an input
This allows to set motd from an input instead of creating a file.

Example:

root@exit2-debian-9:~/frr# telnet 127.0.0.1 2605
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Hello, this is bgpd
User Access Verification

Password:
exit2-debian-9> enable
exit2-debian-9# sh run

Current configuration:
!
frr version 7.3-dev-MyOwnFRRVersion
frr defaults traditional
!
hostname exit2-debian-9
password belekas
log file /var/log/frr/labas.log
log syslog informational
banner motd line Hello, this is bgpd
!
!
!
line vty
!
end
exit2-debian-9#

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-10-31 15:02:47 +02:00
Emanuele Di Pascale 984fd9614d lib: include ldpd to the list of daemons
... for commands such as 'show running-config X'.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-10-29 10:32:38 +01:00
Igor Ryzhov 898d21a4a4 lib: fix typo
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2019-10-08 16:52:33 +03:00
David Lamparter ed18356f1f bgpd/bmp: BMP implementation
This implements BMP.  There's no fine-grained history here, the non-BMP
preparations are already split out from here so all that remains is BMP
proper.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-30 19:22:23 +02:00
Igor Ryzhov c7975431e6 all: remove logical-router functionality
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2019-08-02 17:10:11 +03:00
David Lamparter fe9e7b71cf lib: split off c-ares code from nhrpd
This is useful in other places too, e.g. for BMP outbound connections.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-07-03 17:15:34 +02:00
David Lamparter 1df0492687
Run-time log filtering via vtysh commands (#4524)
Run-time log filtering via vtysh commands
2019-07-03 14:39:59 +02:00
David Lamparter eaf58ba906 lib: use MTYPE_STATIC
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-06-21 08:54:25 +02:00
Stephen Worley 3b96430b72 lib: Add vrrpd,sharpd to DAEMONS_* strings
Add vrrpd and sharpd to the DAEMONS_* list so they
can be dispatched daemons independent commands
such as `show work-queues` and `log-filter`.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-06-19 17:20:24 -04:00
Stephen Worley f73126c31a lib,vtysh: Add vtysh commands for log-filter
Add vtysh commands to add/del/clear/show filters across
all daemons and independently on each one. Add automake and
clippy boilerplate for those commands as well.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-06-19 17:20:24 -04:00
Stephen Worley db9a7cf7c0 lib: Add some all daemon command strings
Add some strings for defining vty commands that target
all daemons.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-06-19 17:20:24 -04:00
Ameya Dharkar e3ab8170bd Lib: Debugs for route-map code in FRR
Added a CLI "debug route-map" to enble route-map debugs

Added debugs for following triggers
1. Add/delete a route-map
2. Add/delete a sequence in route-map
3. Add/delete a match statement(dependency)
4. Update a dependency
5. Apply a route-map

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-06-11 16:17:15 -07:00
Lakshman Krishnamoorthy 63e653a21f lib: crash when FRR hostname length > 80 chars
Although the RFC states hostname length should be < 255 chars,
FRR allows infinite length technically. However, when you try
to set a hostname > 80 chars, you would immediately notice a crash.

RCA: Crash due to buffer overflow. Large buffer sprintf'd into smaller
buffer. Usage of sprintf function instead of snprintf which is safer.

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-05-31 10:52:33 -07:00
Quentin Young f828842a69 vrrpd: add support for configuration writing
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17 00:27:08 +00:00
Donald Sharp 7f9adc7c67 lib: Allow DEFPY_HIDDEN to exist in vtysh
The DEFPY_HIDDEN commands were not being picked up
into vtysh.  Fix this issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-20 19:26:15 -05:00
Renato Westphal 5e2444690b lib: add extern "C" {} blocks to all libfrr headers
These are necessary to use functions defined in these headers from C++.

Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-11 22:34:12 -02:00
Russ White 2379dbecbd
Merge pull request #3202 from donaldsharp/evpn_dump
Evpn dump
2018-11-08 18:13:27 -05:00
Donald Sharp 093e3f23f6 bgpd, lib, vtysh, zebra: Convert to using CMD_VNI_RANGE
For the vni range use a macro to keep track of it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-31 06:23:32 -04:00
Renato Westphal 1c2facd12d lib: introduce new northbound API
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-27 16:16:12 -02:00
David Lamparter 0437e10517 *: spelchek
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-25 20:10:57 +02:00
Donald Sharp 7ab57d19ce lib, vtysh: Allow notification across multiple lines of failure
When reading in config files and we have failures on multiple
lines actually note the actual failure lines and return them.
This fixes an issue where we stopped counting errors after
the first one and we got missleading line numbers that
did not correspond to the actual problem.

This is fixed:
sharpd@donna ~/frr> sudo /usr/lib/frr/pimd --log=stdout -A 127.0.0.1 -f /etc/frr/pimd.conf
2018/10/11 09:41:01 PIM: VRF Created: default(0)
2018/10/11 09:41:01 PIM: pim_vrf_enable: for default
2018/10/11 09:41:01 PIM: zclient_lookup_sched_now: zclient lookup immediate connection scheduled
2018/10/11 09:41:01 PIM: zclient_lookup_new: zclient lookup socket initialized
2018/10/11 09:41:01 PIM: pimd 6.1-dev starting: vty@2611
2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 2: inteface lo
2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 3: ip igmp
2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 4: ip igmp join 224.1.1.1 13.13.13.2
^C2018/10/11 09:45:09 PIM: Terminating on signal SIGINT
2018/10/11 09:45:09 PIM: VRF Deletion: default(0)

Fixes: #3161
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-11 09:46:40 -04:00
Christian Franke 7c0cbd0e88 fabricd: add new daemon as build of isisd
fabricd is built using the sources of isisd. To allow differentiation
in the code, -DFABRICD=1 is added to its preprocessor flags.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:12 +02:00
Donald Sharp d6853655b5
Merge branch 'master' into bfd-final 2018-08-14 08:16:10 -04:00
Renato Westphal 26d19c83b4 lib: implement DEFPY_NOSH
This is the DEFPY equivalent of DEFUN_NOSH.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:59:31 -03:00
Rafael Zalamena c2f29cf3d7 bfdd: add vty shell commands
Implement vty shell integration and allow `bfdd` to be configured
through FRR's vtysh.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:04 -03:00
Quentin Young 377e35655a bgpd: clean up evpn prefix debugging commands
* Fix memory leaks in debug commands
* Use CLI tokens to properly sanitize input
* Remove unnecessary error handling code from debug commands
* Remove unnecessary parameters from conf print functions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-07 16:12:55 +00:00
Quentin Young 61cdcbdc02 lib: remove DEFUN_DEPRECATED
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-25 16:38:53 +00:00
Donald Sharp e9b4e74a78 lib: Add --log-level to daemons
Add the ability to specify the designated log level at startup.

--log-level <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-19 09:02:21 -04:00
Donald Sharp f8507817cf lib: Add new cli to specify where to output logs on startup
When we are starting a daemon, allow the user to specify:

--log <stdout|syslog|file:file_name>

This can be used on early startup to put the log files
where the end user wants them to show up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-19 08:43:59 -04:00
Quentin Young 01e24c4a69 lib: add hook for preprocessing commands
This patch adds a hook point intended to allow subscribers to modify the
raw text of a CLI command before it is passed to the rest of the CLI
pipeline. To give access to the raw text of the command, a new function
for executing CLI has been defined whose only difference from
`cmd_execute_command` is that it accepts the command to execute as a
string rather than as a string vector.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-06 16:15:34 +00:00
Quentin Young fe011935cd lib: add string utilities
I see lots of the same code being copy-pasted and slightly tweaked for
string processing all over the codebase. Time to start aggregating these
pieces into something consistent and correct.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-06 16:15:34 +00:00