summaryrefslogtreecommitdiff
path: root/lib/command.h
AgeCommit message (Collapse)Author
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>
2018-04-22lib: add ability to dump cli mode graphQuentin Young
The grammar sandbox has had the ability to dump individual commands as DOT graphs, but now that generalized DOT support is present it's trivial to extend this to entire submodes. This is quite useful for visualizing the CLI space when debugging CLI errors. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-11Merge pull request #1989 from qlyoung/defpy-hiddenLou Berger
lib, python: DEFPY_ATTR, DEFPY_HIDDEN
2018-04-10lib, python: DEFPY_ATTR, DEFPY_HIDDENQuentin Young
Add support for element attributes in DEFPY macros. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-06pbrd: Add PBR to FRRDonald Sharp
This is an implementation of PBR for FRR. This implemenation uses a combination of rules and tables to determine how packets will flow. PBR introduces a new concept of 'nexthop-groups' to specify a group of nexthops that will be used for ecmp. Nexthop-groups are specified on the cli via: nexthop-group DONNA nexthop 192.168.208.1 nexthop 192.168.209.1 nexthop 192.168.210.1 ! PBR sees the nexthop-group and installs these as a default route with these nexthops starting at table 10000 robot# show pbr nexthop-groups Nexthop-Group: DONNA Table: 10001 Valid: 1 Installed: 1 Valid: 1 nexthop 192.168.209.1 Valid: 1 nexthop 192.168.210.1 Valid: 1 nexthop 192.168.208.1 I have also introduced the ability to specify a table in a 'show ip route table XXX' to see the specified tables. robot# show ip route table 10001 Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, > - selected route, * - FIB route F>* 0.0.0.0/0 [0/0] via 192.168.208.1, enp0s8, 00:14:25 * via 192.168.209.1, enp0s9, 00:14:25 * via 192.168.210.1, enp0s10, 00:14:25 PBR tracks PBR-MAPS via the pbr-map command: ! pbr-map EVA seq 10 match src-ip 4.3.4.0/24 set nexthop-group DONNA ! pbr-map EVA seq 20 match dst-ip 4.3.5.0/24 set nexthop-group DONNA ! pbr-maps can have 'match src-ip <prefix>' and 'match dst-ip <prefix>' to affect decisions about incoming packets. Additionally if you only have one nexthop to use for a pbr-map you do not need to setup a nexthop-group and can specify 'set nexthop XXXX'. To apply the pbr-map to an incoming interface you do this: interface enp0s10 pbr-policy EVA ! When a pbr-map is applied to interfaces it can be installed into the kernel as a rule: [sharpd@robot frr1]$ ip rule show 0: from all lookup local 309: from 4.3.4.0/24 iif enp0s10 lookup 10001 319: from all to 4.3.5.0/24 iif enp0s10 lookup 10001 1000: from all lookup [l3mdev-table] 32766: from all lookup main 32767: from all lookup default [sharpd@robot frr1]$ ip route show table 10001 default proto pbr metric 20 nexthop via 192.168.208.1 dev enp0s8 weight 1 nexthop via 192.168.209.1 dev enp0s9 weight 1 nexthop via 192.168.210.1 dev enp0s10 weight 1 The linux kernel now will use the rules and tables to properly apply these policies. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-04Merge pull request #2006 from qlyoung/remove-irdp-nodeRuss White
lib: remove IRDP_NODE
2018-04-04Merge pull request #2002 from qlyoung/remove-undebugRuss White
bgpd, pim: remove undebug
2018-04-03lib: remove IRDP_NODEQuentin Young
Unused Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-02Merge pull request #2005 from qlyoung/remove-masc-nodeRafael Zalamena
lib: remove MASC_NODE
2018-04-02bgpd, pim: remove undebugQuentin Young
This 'undebug' syntax is only used in 5 commands and serves no apparent purpose. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-30lib: remove MASC_NODEQuentin Young
Unused Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-30lib: remove SERVICE_NODEQuentin Young
Unused Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-30bgpd: add flowspec featurejaydom
This work is derived from a work done by China-Telecom. That initial work can be found in [0]. As the gap between frr and quagga is important, a reworks has been done in the meantime. The initial work consists of bringing the following: - Bringing the client side of flowspec. - the enhancement of address-family ipv4/ipv6 flowspec - partial data path handling at reception has been prepared - the support for ipv4 flowspec or ipv6 flowspec in BGP open messages, and the internals of BGP has been done. - the memory contexts necessary for flowspec has been provisioned In addition to this work, the following has been done: - the complement of adaptation for FS safi in bgp code - the code checkstyle has been reworked so as to match frr checkstyle - the processing of IPv6 FS NLRI is prevented - the processing of FS NLRI is stopped ( temporary) [0] https://github.com/chinatelecom-sdn-group/quagga_flowspec/ Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: jaydom <chinatelecom-sdn-group@github.com>
2018-03-19bgpd: new vpn-policy CLIG. Paul Ziemba
PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below. The code of this PR implements the vpn-specific parts of this syntax: router bgp <as> [vrf <FOO>] address-family <afi> unicast rd (vpn|evpn) export (AS:NN | IP:nn) label (vpn|evpn) export (0..1048575) rt (vpn|evpn) (import|export|both) RTLIST... nexthop vpn (import|export) (A.B.C.D | X:X::X:X) route-map (vpn|evpn|vrf NAME) (import|export) MAP [no] import|export [vpn|evpn|evpn8] [no] import|export vrf NAME User documentation of the vpn-specific parts of the above syntax is in PR #1937 Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-09lib: Keep indent/clang happyG. Paul Ziemba
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-09lib: add new BGP VPN policy command nodeG. Paul Ziemba
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-09lib, vtysh: Start cli for nexthop-groupDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-02-27lib: split logicalrouter and vrf netns featurePhilippe Guibert
This split is introducing logicalrouter.[ch] as the file that contains the vty commands to configure logical router feature. The split has as consequence that the backend of logical router is linux_netns.c formerly called ns.c. The same relationship exists between VRF and its backend which may be linux_netns.c file. The split is adapting ns and vrf fiels so as to : - clarify header - ensure that the daemon persepctive, the feature VRF or logical router is called instead of calling directly ns. - this implies that VRF will call NS apis, as logical router does. Also, like it is done for default NS and default VRF, the associated VRF is enabled first, before NETNS is enabled, so that zvrf->zns pointer is valid when NETNS discovery applies. Also, other_netns.c file is a stub handler that will be used for non linux systems. As NETNS feature is only used by Linux, some BSD systems may want to use the same backend API to benefit from NETNS. This is what that file has been done. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-02-06Merge pull request #1653 from Orange-OpenSource/SR-RoutingDonald Sharp
OSPFD: Add Experimental Segment Routing support
2018-01-30lib, pimd: Remove PIM_NODE as it is not neededDonald Sharp
The PIM_NODE command is only being used to display default vrf configuration. Move this into the vrf display and remove PIM_NODE. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-18OSPFD: Add Experimental Segment Routing supportOlivier Dugeon
This is an implementation of draft-ietf-ospf-segment-routing-extensions-24 and RFC7684 for Extended Link & Prefix Opaque LSA. Look to doc/OSPF_SR.rst for implementation details & known limitations. New files: - ospfd/ospf_sr.h: Segment Routing structure definition (SubTLVs + SRDB) - ospfd/ospf_sr.c: Main functions for Segment Routing support - ospfd/ospf_ext.h: TLVs and SubTLVs definition for RFC7684 - ospfd/ospf_ext.c: RFC7684 Extended Link / Prefix implementation - doc/OSPF-SRr.rst: Documentation Modified Files: - doc/ospfd.texi: Add new Segment Routing CLI command definition - lib/command.h: Add new string command for Segment Routing CLI - lib/mpls.h: Add default value for SRGB - lib/route_types.txt: Add new OSPF Segment Routing route type - ospfd/ospf_dump.[c,h]: Add OSPF SR debug - ospfd/ospf_memory.[c,h]: Add new Segment Routing memory type - ospfd/ospf_opaque.[c,h]: Add ospf_sr_init() starting function - ospfd/ospf_ri.c: Add new functions to Set/Get Segment Routing TLVs Add new ospf_router_info_lsa_upadte() to send Opaque LSA to ospf_sr.c() - ospfd/ospf_ri.h: Add new Router Information SR SubTLVs - ospfd/ospf_spf.c: Add new scheduler when running SPF to trigger update of NHLFE - ospfd/ospfd.h: Add new thread for Segment Routing scheduler - ospfd/subdir.am: Add new files - vtysh/Makefile.am: Add new ospf_sr.c file for vtysh - zebra/kernel_netlink.c: Add new OSPF_SR route type - zebra/rt_netlink.[c,h]: Add new OSPF_SR route type - zebra/zebra_mpls.h: Add new OSPF_SR route type Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2018-01-11lib, bgpd: fixup use of of CMD_ARGC_MAXQuentin Young
The constant to limit # of allowed cli tokens on any one line was defined in multiple places, all inconsistent with each other. Fix. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-10bgpd: Add RPKI/RTR supportMarcel Röthke
This commit adds support for the RTR protocol to receive ROA information from a RPKI cache server. That information can than be used to validate the BGP origin AS of IP prefixes. Both features are implemented using [rtrlib](http://rtrlib.realmv6.org/). Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
2017-10-25lib, ospf6d, ospfd, zebra: Add ZEBRA_STRDonald Sharp
Allow us to use a ZEBRA_STR for commands Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-10lib: Add some documentation about argv_findDonald Sharp
We expect that the index value passed in for argv_find should be initially set to 0. This way if the cli ever changes there is no need to modify the initial value. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-20*: watchfrr needs 'show debugging' DEFUNDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This fixes the following cel-redxp-10# show debugging Debugging Information for zebra: Zebra debugging status: Debugging Information for bgpd: BGP debugging status: Debugging Information for watchfrr: % Command incomplete. % Command incomplete. cel-redxp-10#