summaryrefslogtreecommitdiff
path: root/lib/command.h
AgeCommit message (Collapse)Author
2020-07-14Revert "Rpki Encapsulation"revert-5015-rpki_vrf_encapsulationQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-07-02bgpd: duplicate config commands into rpki-vrf subnodePhilippe Guibert
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-06-10lib,sharpd: add a SHARP_STR aliasMark Stapp
Add a vty-friendly protocol name alias for sharpd. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-05-20bfdd,lib,vtysh: new command node for BFD profilesRafael Zalamena
Add the necessary code to implement the BFD profile command node. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-16Merge pull request #6135 from opensourcerouting/cli-node-cleanupDonald Sharp
*: clean up the mess that is CLI command nodes
2020-04-16lib: #define FRR_CMD_NODE_20200416David Lamparter
... requested by Lou. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-16*: add ->node_exit to struct cmd_nodeDavid Lamparter
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-16zebra: fix FPM node reusing VTY_NODEDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
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*: move CLI parent data to cmd_node->parent_nodeDavid Lamparter
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*: remove second parameter on install_node()David Lamparter
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*: remove cmd_node->vtyshDavid Lamparter
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-01lib: rewrite zlog lock-free & TLS-bufferedDavid Lamparter
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-01-23bgpd: Adding BGP GR Global & Per Neighbour FSM changesbisdhdh
* 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-23bgpd: BGP Graceful Restart Per Neighbor(BGPN), DS & header files.bisdhdh
This pr contains all the header files changes for BGP GR per Neighbour(BGPN) feature. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2019-11-30lib: make cmd_element & qobj_type constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-19Merge pull request #5224 from manuhalo/fix_frr_reload_pathsQuentin Young
Fixes and extensions to frr_reload.py
2019-10-31vtysh: Add an option to set banner motd from an inputDonatas Abraitis
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-29lib: include ldpd to the list of daemonsEmanuele Di Pascale
... for commands such as 'show running-config X'. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-10-08lib: fix typoIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2019-08-30bgpd/bmp: BMP implementationDavid Lamparter
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-02all: remove logical-router functionalityIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2019-07-03lib: split off c-ares code from nhrpdDavid Lamparter
This is useful in other places too, e.g. for BMP outbound connections. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-07-03Run-time log filtering via vtysh commands (#4524)David Lamparter
Run-time log filtering via vtysh commands
2019-06-21lib: use MTYPE_STATICDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-06-19lib: Add vrrpd,sharpd to DAEMONS_* stringsStephen Worley
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-19lib,vtysh: Add vtysh commands for log-filterStephen Worley
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-19lib: Add some all daemon command stringsStephen Worley
Add some strings for defining vty commands that target all daemons. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-06-11Lib: Debugs for route-map code in FRRAmeya Dharkar
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-05-31lib: crash when FRR hostname length > 80 charsLakshman Krishnamoorthy
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-17vrrpd: add support for configuration writingQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-20lib: Allow DEFPY_HIDDEN to exist in vtyshDonald Sharp
The DEFPY_HIDDEN commands were not being picked up into vtysh. Fix this issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-11lib: add extern "C" {} blocks to all libfrr headersRenato Westphal
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>
2018-11-08Merge pull request #3202 from donaldsharp/evpn_dumpRuss White
Evpn dump
2018-10-31bgpd, lib, vtysh, zebra: Convert to using CMD_VNI_RANGEDonald Sharp
For the vni range use a macro to keep track of it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-27lib: introduce new northbound APIRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-25*: spelchekDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-11lib, vtysh: Allow notification across multiple lines of failureDonald Sharp
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-09-05fabricd: add new daemon as build of isisdChristian Franke
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-08-14Merge branch 'master' into bfd-finalDonald Sharp
2018-08-13lib: implement DEFPY_NOSHRenato Westphal
This is the DEFPY equivalent of DEFUN_NOSH. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-08bfdd: add vty shell commandsRafael Zalamena
Implement vty shell integration and allow `bfdd` to be configured through FRR's vtysh. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-07bgpd: clean up evpn prefix debugging commandsQuentin Young
* 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-06-25lib: remove DEFUN_DEPRECATEDQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-19lib: Add --log-level to daemonsDonald Sharp
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-19lib: Add new cli to specify where to output logs on startupDonald Sharp
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-06lib: add hook for preprocessing commandsQuentin Young
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-06lib: add string utilitiesQuentin Young
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-05-13lib: Moved no-password warnings into header filePascal Mathis
The warning string which appears when the users executes 'no (enable) password' was moved into command.h and declared as a constant named 'NO_PASSWD_CMD_WARNING'. This avoids duplicate code and makes it easy to change the warning message in all places at once. Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-05-08lib: move ip node above vrf node for config orderQuentin Young
VRF static route commands adopt global static config if static config is placed after a vrf context with no separator, workaround by always writing static route config before vrf config Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>