summaryrefslogtreecommitdiffstats
path: root/vtysh (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib: rename memory_vty.c to lib_vty.cDavid Lamparter2019-12-062-2/+1
| | | | | | And memory_init() to lib_cmd_init(). Signed-off-by: David Lamparter <equinox@diac24.net>
* Merge pull request #5224 from manuhalo/fix_frr_reload_pathsQuentin Young2019-11-191-3/+3
|\ | | | | Fixes and extensions to frr_reload.py
| * tools, vtysh: improved fix for ldpd ifacesEmanuele Di Pascale2019-11-121-0/+2
| | | | | | | | | | | | | | | | | | instead of suppressing the 'exit' markers at the end of each 'interface XXX' clause in the mpls ldp configuration, mark those with a special marker 'exit-ldp-if' and teach the reload script to correctly recognize the new sub-subcontext Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
| * tools, vtysh: fix ldpd + frr-reload.pyEmanuele Di Pascale2019-10-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | frr-reload.py has many special case rules that did not consider ldpd at all. Specifically: 1. The bulk of ldp configuration comes in a big 'mpls ldp' context, which was previously considered a single-line context as it started with 'mpls'. This rule should only apply to labels and lsps. 2. ldp has a 'router-id' config line that fell into the same rule as the above one. It should not be considered a single-line context as more ldp configuration can follow. 3. enabled interfaces should not end their context. A better fix would actually require popping a new context for each interface in case there is any interface-specific config, but at least this fix will address the most common use case. 4. when declaring pseudowires, any line with 'member pseudowire XXX' should be considered a sub-context of the 'l2vpn YYY type ZZZ' context. Without this fix, changes in the first psuedowire declared would not correctly be processed (e.g. removing a 'control-word exclude' line would not be picked up). Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* | Merge pull request #5209 from ton31337/feature/banner_motd_from_inputRenato Westphal2019-11-121-0/+21
|\ \ | | | | | | vtysh: Add an option to set banner motd from an input
| * | vtysh: Add an option to set banner motd from an inputDonatas Abraitis2019-10-311-0/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* / vtysh: be helpful and kind to unprivileged usersQuentin Young2019-11-081-0/+3
|/ | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #5171 from donaldsharp/remove_getrusageMark Stapp2019-10-171-0/+4
|\ | | | | *: Allow disabling of `getrusage` calls
| * *: Allow disabling of `getrusage` callsDonald Sharp2019-10-161-0/+4
| | | | | | | | | | | | | | | | | | | | getrusage, in a heavily stressed system, can account for signficant running time due to process switching to the kernel. Allow the end-operator to specify `--disable-cpu-time` to avoid this call. Additionally we cause `show thread cpu` to not show up if this is selected. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | lib, vtysh: add new libyang option to the "debug northbound" commandRenato Westphal2019-10-161-1/+3
| | | | | | | | | | | | | | Guard the libyang debug messages under this command so that only people interested on those messages will see them. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | vtysh: remove DEFPY variable namesRenato Westphal2019-10-161-7/+7
|/ | | | | | | Some DEFPY commands were copied to vtysh without being cleaned up properly. Fix this. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* vtysh: fix searching commands in parent nodesPavel Ivashchenko2019-10-081-0/+2
| | | | | | Do not check parent command nodes in case of ambiguous and incomplete commands Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
* Merge pull request #5042 from opensourcerouting/vtysh-nb-cmdsQuentin Young2019-09-241-0/+52
|\ | | | | vtysh: add two commands from the northbound
| * vtysh: add the "show yang operational-data" commandRenato Westphal2019-09-231-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The right way to implement this command in vtysh is the following: * Send the command to each running FRR daemon; * Collect the command output from each daemon; * Parse the text outputs into libyang lyd_node structures. Then merge all these data trees into a single one. Finally, print the merged data trees to the standard output (libyang will take care of combining duplicate nodes as necessary). What this commit does is to allow vtysh to send the "show yang operational-data" command to a single daemon only (the last parameter). It's a quick workaround to allow us to write topotests using YANG-modeled data until we do the real thing (full vtysh northbound integration). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * vtysh: add the "debug northbound" commandRenato Westphal2019-09-231-0/+26
| | | | | | | | | | | | | | | | | | | | This command is defined in the lib/northbound_cli.c file, which is not being parsed by vtysh since most commands from there need special handling in the context of vtysh. The "debug northbound" command, however, can be made available to vtysh without problems. Introduce a new DEFUNSH to do that. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | vtysh: fix "no log facility" commandIgor Ryzhov2019-09-231-2/+3
|/ | | | | | | Actual command from the library accepts only supported facilities, not any random word. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* vtysh: fix multiple "no ip/ipv6 prefix-list sequence-number" lines in ↵Igor Ryzhov2019-09-181-1/+3
| | | | | | running-config Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* vtysh, lib: allow regexp in `find` commandQuentin Young2019-09-031-7/+59
| | | | | | ¯\_(ツ)_/¯ Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #4797 from opensourcerouting/eigrpd-vrfRuss White2019-09-031-2/+3
|\ | | | | eigrpd: vrf support
| * eigrpd: Add `router eigrp AS [vrf NAME]` and various stuffDonald Sharp2019-08-071-2/+3
| | | | | | | | | | | | | | Add the ability to parse `router eigrp AS [vrf NAME]` and modify eigrp_lookup to actually handle a vrf_id for us. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | bgpd/bmp: BMP implementationDavid Lamparter2019-08-301-1/+35
| | | | | | | | | | | | | | | | 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>
* | vtysh: fix rare crash(es)Quentin Young2019-08-231-6/+10
| | | | | | | | | | | | | | Couple code paths end up trying to dereference vty->of which can be null in one special case. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #4706 from qlyoung/fix-exit-vrf-markfileSri Mohana Singamsetty2019-08-131-0/+4
|\ \ | |/ |/| vtysh: mark exit-vrf with end when using vtysh -m
| * vtysh: mark exit-vrf with end when using vtysh -mQuentin Young2019-07-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VRF context blocks have a context-specific exit command in order to explicitly force an exit to the top level config node. This command exists because 'ip route' commands are accepted in both VRF_NODE and CONFIG_NODE, so static routes intended to be accepted in CONFIG_NODE that immediately follow a VRF_NODE block will be shoved into the VRF_NODE block unless the VRF context is explicitly exited. However, because this is a command that exits to CONFIG_NODE, vtysh -m should be printing an `end` at the end of the context, since frr-reload.py relies on this context ender to know when it's back in CONFIG_NODE. But since this is the only explicit context exit command that also exits to CONFIG_NODE we don't really have a good way of doing this already. Hence this god-awful patch. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #4790 from opensourcerouting/ctype-castQuentin Young2019-08-061-4/+5
|\ \ | | | | | | *: fix ctype casts
| * | *: fix ctype (isalpha & co.) castsDavid Lamparter2019-08-061-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The correct cast for these is (unsigned char), because "char" could be signed and thus have some negative value. isalpha & co. expect an int arg that is positive, i.e. 0-255. So we need to cast to (unsigned char) when calling any of these. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | | all: remove logical-router functionality (#4774)David Lamparter2019-08-064-55/+0
|\ \ \ | |/ / |/| | all: remove logical-router functionality
| * | all: remove logical-router functionalityIgor Ryzhov2019-08-024-55/+0
| | | | | | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | vtysh: Replace linked-list in vtysh_config with RB-treeJuergen Werner2019-08-021-17/+21
|/ / | | | | | | | | | | | | ...for faster look-ups Fixes: 4673 Signed-off-by: Juergen Werner <juergen@opensourcerouting.org>
* | vtysh: style nits for error code cli handlerQuentin Young2019-07-291-0/+2
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | vtysh: only show error codes onceQuentin Young2019-07-292-8/+25
| | | | | | | | | | | | | | When using `show error` commands, show errors shared between multiple daemons only once. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | vtysh: send vtysh_quit_nexthop_group to pbrd and sharpdIgor Ryzhov2019-07-251-1/+1
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | vtysh: send "exit-vrf" command to staticdIgor Ryzhov2019-07-241-1/+1
|/ | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* vtysh: Make nexthop-group submode line uniqueDonald Sharp2019-07-131-1/+2
| | | | | | | | Now that multiple daemons understand nexthop-groups, we need to ensure that vtysh doesn't double print out the individual nexthops that are part of a nexthop-group. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: split off c-ares code from nhrpdDavid Lamparter2019-07-031-1/+4
| | | | | | This is useful in other places too, e.g. for BMP outbound connections. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Run-time log filtering via vtysh commands (#4524)David Lamparter2019-07-031-46/+140
|\ | | | | Run-time log filtering via vtysh commands
| * lib: Remove extraneous spacing/output filter cmdsStephen Worley2019-06-191-3/+3
| | | | | | | | | | | | | | | | Use %% style for errors in log commands and switch tabs to a single space in output. Also, remove un-needed output for success. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
| * lib,vtysh: Add vtysh commands for log-filterStephen Worley2019-06-191-0/+100
| | | | | | | | | | | | | | | | 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>
| * vtysh: Make show work-queue execute by nameStephen Worley2019-06-191-10/+2
| | | | | | | | | | | | | | Update show work-queue to use the execute_name() code path when dispatching to a specific daemon. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
| * vtysh: Execute command on client by name onlyStephen Worley2019-06-191-0/+32
| | | | | | | | | | | | | | Add static function path for exectuting a command on a client daemon via a string of its name only. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
| * vtysh: Update vtysh commands with all daemon strStephen Worley2019-06-191-36/+6
| | | | | | | | | | | | | | Update the vtysh commands that target all daemons to use the DAEMONS_* macro. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* | vtysh: Try to be perscriptive about pam failuresDonald Sharp2019-06-261-20/+5
|/ | | | | | | | | When using pam for authentication, the code just silently fails and gives no indication to the end user what has gone wrong. Try to increase messaging about what has gone wrong by outputting some more data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Lib: Debugs for route-map code in FRRAmeya Dharkar2019-06-121-1/+6
| | | | | | | | | | | | | 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>
* pbrd: Allow autocompletion for pbr-map PBRMAPDonald Sharp2019-06-051-2/+2
| | | | | | Allow the end user to auto-complete the pbr-map name. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, pbrd, sharpd, vtysh: Add autocompletion for 'nexthop-group'Donald Sharp2019-06-051-2/+2
| | | | | | Add some auto-completion for the nexthop-group command Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert over to all -N namespace to change DAEMON_VTY_DIRDonald Sharp2019-06-051-0/+2
| | | | | | | | When the user specifies -N namespace allow it to influence the frr_vtydir(DAEMON_VTY_DIR) to have namespace in it's path like so: $frrstate_dir/<namespace> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #4430 from lkrishnamoor/hostname_crashDonald Sharp2019-05-312-3/+3
|\ | | | | lib: crash when FRR hostname length > 80 chars
| * lib: crash when FRR hostname length > 80 charsLakshman Krishnamoorthy2019-05-312-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | lib, vtysh: make debug memstats work in vtyshMark Stapp2019-05-301-0/+11
|/ | | | | | | Allow vtysh to send the 'debug memstats-on-exit' command to the running daemons. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* vtysh: strcpy -> strlcpy, strcat -> strlcatQuentin Young2019-05-291-4/+5
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>