summaryrefslogtreecommitdiffstats
path: root/vtysh (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5937 from ton31337/fix/sizeofDonald Sharp2020-03-092-2/+2
|\ | | | | *: Replace `sizeof something` to sizeof(something)
| * *: Replace `sizeof something` to sizeof(something)Donatas Abraitis2020-03-082-2/+2
| | | | | | | | | | | | Satisfy checkpatch.pl requirements (check for sizeof without parenthesis) Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | Merge pull request #5904 from donaldsharp/close_itDonatas Abraitis2020-03-071-1/+3
|\ \ | |/ |/| vtysh: Fixup extract.pl to intentionally fail on error
| * vtysh: Fixup extract.pl to intentionally fail on errorDonald Sharp2020-03-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When extracting the cli for vtysh into vtysh_cmd.c when the compilation fails it will just silently ignore the issue and not include the cli in vtysh at all. Leaving everyone attempting to figure out wtf just happened. Modify the code to intentionally crash with some modicrum of a chance to allow the developer to find and fix their own mistakes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | *: use gmtime_r, localtime_r exclusivelyMark Stapp2020-03-051-2/+3
|/ | | | | | Stop using gmtime() or localtime() everywhere. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: Remove break after returnDonatas Abraitis2020-02-131-2/+0
| | | | | | Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* Merge pull request #5763 from ton31337/fix/return_without_parentRenato Westphal2020-02-103-4/+4
|\ | | | | *: Remove parenthesis on return for constants
| * *: Remove parenthesis on return for constantsDonatas Abraitis2020-02-093-4/+4
| | | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | Merge pull request #5104 from opensourcerouting/route-map-nbv2Donald Sharp2020-02-051-1/+1
|\ \ | |/ |/| lib: migrate route map to use northbound
| * lib: implement new route map CLIRafael Zalamena2020-02-041-1/+1
| | | | | | | | | | | | Use the northbound back-end instead of the old route map CLI. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | *: don't null after XFREE; XFREE does this itselfQuentin Young2020-02-031-1/+0
|/ | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vtysh: add a cli that reads a file into running-configMark Stapp2020-01-231-0/+19
| | | | | | | Add a 'copy' cli that reads a file into the current running config. Add an entry about the new cli to the user doc. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* vtysh: Ensure interface `ip mroute ...` commands are lastDonald Sharp2019-12-201-0/+2
| | | | | | | Ensure when displaying interface based ip mroute commands that they are last. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* vtysh: add an alias for the nexthop-group config targetsMark Stapp2019-12-173-5/+10
| | | | | | | Use an alias for the daemons who process the nexthop-group config cli; makes it easier to expand that list in the future. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* 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