summaryrefslogtreecommitdiffstats
path: root/lib/command.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib: remove DEFUN_DEPRECATEDQuentin Young2018-06-251-3/+0
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: Add --log-level to daemonsDonald Sharp2018-06-191-1/+1
| | | | | | | | 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>
* lib: Add new cli to specify where to output logs on startupDonald Sharp2018-06-191-0/+1
| | | | | | | | | | | 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>
* lib: add hook for preprocessing commandsQuentin Young2018-06-061-0/+22
| | | | | | | | | | | 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>
* lib: add string utilitiesQuentin Young2018-06-061-3/+0
| | | | | | | | 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>
* lib: Moved no-password warnings into header filePascal Mathis2018-05-131-0/+4
| | | | | | | | | | | 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>
* lib: move ip node above vrf node for config orderQuentin Young2018-05-091-1/+1
| | | | | | | | 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>
* lib: add ability to dump cli mode graphQuentin Young2018-04-221-0/+1
| | | | | | | | | 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>
* Merge pull request #1989 from qlyoung/defpy-hiddenLou Berger2018-04-121-0/+10
|\ | | | | lib, python: DEFPY_ATTR, DEFPY_HIDDEN
| * lib, python: DEFPY_ATTR, DEFPY_HIDDENQuentin Young2018-04-101-0/+10
| | | | | | | | | | | | Add support for element attributes in DEFPY macros. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | pbrd: Add PBR to FRRDonald Sharp2018-04-061-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge pull request #2006 from qlyoung/remove-irdp-nodeRuss White2018-04-051-1/+0
|\ | | | | lib: remove IRDP_NODE
| * lib: remove IRDP_NODEQuentin Young2018-04-031-1/+0
| | | | | | | | | | | | Unused Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #2002 from qlyoung/remove-undebugRuss White2018-04-051-1/+1
|\ \ | |/ |/| bgpd, pim: remove undebug
| * bgpd, pim: remove undebugQuentin Young2018-04-021-1/+1
| | | | | | | | | | | | | | This 'undebug' syntax is only used in 5 commands and serves no apparent purpose. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #2005 from qlyoung/remove-masc-nodeRafael Zalamena2018-04-021-1/+0
|\ \ | | | | | | lib: remove MASC_NODE
| * | lib: remove MASC_NODEQuentin Young2018-03-301-1/+0
| |/ | | | | | | | | | | Unused Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* / lib: remove SERVICE_NODEQuentin Young2018-03-301-1/+0
|/ | | | | | Unused Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: add flowspec featurejaydom2018-03-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* bgpd: new vpn-policy CLIG. Paul Ziemba2018-03-201-2/+0
| | | | | | | | | | | | | | | | | | | | | 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>
* lib: Keep indent/clang happyG. Paul Ziemba2018-03-091-69/+69
| | | | Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* lib: add new BGP VPN policy command nodeG. Paul Ziemba2018-03-091-0/+2
| | | | Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* lib, vtysh: Start cli for nexthop-groupDonald Sharp2018-03-091-0/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-3/+4
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* lib: split logicalrouter and vrf netns featurePhilippe Guibert2018-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge pull request #1653 from Orange-OpenSource/SR-RoutingDonald Sharp2018-02-061-0/+1
|\ | | | | OSPFD: Add Experimental Segment Routing support
| * OSPFD: Add Experimental Segment Routing supportOlivier Dugeon2018-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | lib, pimd: Remove PIM_NODE as it is not neededDonald Sharp2018-01-301-1/+0
|/ | | | | | | | 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>
* lib, bgpd: fixup use of of CMD_ARGC_MAXQuentin Young2018-01-111-1/+1
| | | | | | | 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>
* bgpd: Add RPKI/RTR supportMarcel Röthke2017-11-101-0/+1
| | | | | | | | | 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>
* lib, ospf6d, ospfd, zebra: Add ZEBRA_STRDonald Sharp2017-10-251-0/+1
| | | | | | Allow us to use a ZEBRA_STR for commands Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: Add some documentation about argv_findDonald Sharp2017-10-101-0/+7
| | | | | | | | | 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>
* *: watchfrr needs 'show debugging' DEFUNDaniel Walton2017-09-201-0/+1
| | | | | | | | | | | | | | | | | | | 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#
* lib: new APIs for get/set system hostname/domainnameMitesh Kanjariya2017-08-291-2/+3
| | | | | | | | | 1. Change hostname_get to cmd_hostname_get 2. Change domainname_get to cmd_domainname_get 3. New API to set domainname 3. Provide a CLI command to set domainname Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* provide/use API to get hostname/domainnameMitesh Kanjariya2017-08-251-1/+1
| | | | | | | | Set default hostname in frr to unix hostname. Provide APIs to get the hostname/domaninanme Use this APIs where needed Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* lib/bgpd: provide/use API to get hostname/domainnameMitesh Kanjariya2017-08-251-0/+5
| | | | Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* Merge branch 'frr/pull/822' ("EVPN fixes")David Lamparter2017-08-091-0/+1
|\ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd, lib, vtysh: Added support for mac filtering in route-mapsMitesh Kanjariya2017-08-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 1. Added support to create mac filters 2. Enabled route-map commands for EVPN address family 3. Provision to add mac filters under match clause in route-maps Ticket: CM-16349 Review: CCR-6190 Unit-test: Manual (logs attached to ticket) Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* | zebra: add support for static pseudowiresRenato Westphal2017-08-091-0/+1
|/ | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospfd: Fix MI-OSPF configuraton clisChirag Shah2017-08-041-0/+1
| | | | | | | | | | | | | | | | Multi-Instance OSPF configuration CLI would fail because first client return error upon seeing qobj_index being 0. With new marco generate new error code to return from each instance (vtysh client) and if the command is intended for given instance, its qobj_index would be nonzero and process the command and push correct ospf context. Other instance would return the error. On vtysh end, check all instance return an error log a message to a file. Testing Done: Verfied various MI-OSPF configuration CLI with multi instances. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* lib, vtysh: add `find COMMAND`Quentin Young2017-07-271-1/+2
| | | | | | Substring search through all defined commands in all nodes. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: add CLI node namesQuentin Young2017-07-271-1/+4
| | | | | | | Adds an array of descriptive names for each CLI node, plus a runtime check to make sure folks don't forget to update it. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-216/+227
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attrDonald Sharp2017-07-141-1/+1
|\
| * lib, vtysh: remove now-useless newline argDavid Lamparter2017-07-141-1/+1
| | | | | | | | | | | | It's always \n now, hooray. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attrDonald Sharp2017-07-141-0/+3
|\|
| * Merge pull request #808 from qlyoung/vtysh-termcolsRuss White2017-07-141-0/+1
| |\ | | | | | | lib, vtysh: pretty-print variable autocompletions
| | * lib, vtysh: pretty-print variable autocompletionsQuentin Young2017-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Pretty-prints variable autocompletions by breaking them up into multiple lines, indenting them consistently and respecting the column width of the terminal. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * | vtysh: return non-zero for configuration failuresDaniel Walton2017-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
| * | bgpd: --enable-multipath=256 setting is ignoredDaniel Walton2017-07-111-0/+1
| |/ | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Restoring some code that was unintentionally removed when we were migrating to Quentin's parser.