Commit graph

967 commits

Author SHA1 Message Date
Donatas Abraitis 6520483a8f
Merge pull request #12704 from donaldsharp/pim6_route_map
pimd: v6 intentionally turned off route-maps.  Turn it on.
2023-01-31 20:51:45 +02:00
Mark Stapp 3b337b7d27
Merge pull request #12687 from opensourcerouting/build-mkdir-p
build: consistently mkdir -p output for redirect
2023-01-31 11:28:32 -05:00
Donald Sharp f51c430a17 pimd: v6 intentionally turned off route-maps. Turn it on.
Why?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-30 09:18:15 -05:00
David Lamparter c84e518709 *: no-warn pragmas for non-const format strings
We do use non-constant/literal format strings in a few places for more
or less valid reasons;  put `ignored "-Wformat-nonliteral"` around those
so we can have the warning enabled for everywhere else.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27 12:01:20 +01:00
David Lamparter d173381edc build: consistently mkdir -p output for redirect
When running the build in a separate build directory, redirecting output
into a file can error out if the directory does not exist yet.  Some
places already had `mkdir -p` calls, but not all.

Make all occurences of this consistently use `@$(MKDIR_P)`.

(Extension of PR #12575 to catch more places.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-24 17:46:57 +01:00
anlan_cs 99c5b6d430 vtysh: fix build failure for certain case
The build failed if two conditions are met at the same time:

1. Configure with `--disable-dependency-tracking`
2. Set an indenpendent build directory

```
anlan@host:~/frr/build$ make
make: Entering directory '/home/anlan/frr/build'
true
/usr/bin/perl ../vtysh/daemons.pl zebra bgpd ripd ripngd ospfd ospf6d isisd fabricd nhrpd ldpd babeld eigrpd  pimd pim6d pbrd staticd bfdd vrrpd pathd > vtysh/vtysh_daemons.h
/bin/bash: line 1: vtysh/vtysh_daemons.h: No such file or directory
make: *** [Makefile:17644: vtysh/vtysh_daemons.h] Error 1
make: Leaving directory '/home/anlan/frr/build'
```

`~/frr/` is source directory, `~/frr/build/` is the specified build
directory.

So, just create necessary directory - `vtysh/`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-01-09 09:28:35 +08:00
Donald Sharp 99a9f25ce8 vtysh: Remove double retrieve of env VTYSH_HISTFILE
The code is double checking the VTYSH_HISTFILE env variable,
additionally clang-15 when running SA over it doesn't fully
understand the code pattern.  Reduce the double check to
one check to reduce program run-time (ha!) and make SA happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-21 08:04:34 -05:00
Russ White be51a45984
Merge pull request #12410 from ghzserg/master
Add motd command
2022-12-06 08:55:20 -05:00
Donatas Abraitis 90bf4243fb
Merge pull request #12443 from donaldsharp/vtysh_mem_leak_2
vtysh: free memory given to us by readline
2022-12-06 08:57:00 +02:00
Donald Sharp ab91425266 vtysh: Cleanup memory leak
When multiple daemons report a exit line for the same
node, vtysh was just dropping the previous pointer.
Ensure that we free it first.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-05 08:50:24 -05:00
Donald Sharp 5098d577d2 vtysh: free memory given to us by readline
The rl_callback_handler_install function manual says this:

Set up the terminal for Readline I/O and display the initial expanded value of prompt.
Save the value of lhandler to use as a handler function to call when a complete line
of input has been entered. The handler function receives the text of the line as an
argument. As with readline(), the handler function should free the line when it is
finished with it.

Adding a free removes this memory leak that I am seeing with address sanitizer enabled;

SUMMARY: AddressSanitizer: 99 byte(s) leaked in 5 allocation(s).:
2022-12-05 07:50:57,231 INFO: topolog.r7: vtysh result:
	Hello, this is FRRouting (version 8.5-dev).
	Copyright 1996-2005 Kunihiro Ishiguro, et al.

	r7# clear log cmdline-targets
	r7# conf t
	r7(config)# log file staticd.log debug
	r7(config)# log commands
	r7(config)# log timestamp precision 3
	r7(config)#

	=================================================================
	==976989==ERROR: LeakSanitizer: detected memory leaks

	Direct leak of 99 byte(s) in 5 object(s) allocated from:
	    #0 0x49cadd in malloc (/usr/bin/vtysh+0x49cadd)
	    #1 0x7fc57135d8e8 in xmalloc build/shlib/./xmalloc.c:59:10

	SUMMARY: AddressSanitizer: 99 byte(s) leaked in 5 allocation(s).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-05 08:26:01 -05:00
Sergei Rozhkov 012f7ae4e9 vtysh: add motd command
Add "show motd" commad.
The vtysh user can call the "show motd" command to re-show the welcome message.
This is necessary if the user saves frequently used commands in motd.

Signed-off-by: Sergei Rozhkov <gh@zserg.ru>
2022-11-30 09:43:55 +05:00
Donald Sharp e6648f01be lib, vtysh: Allow watchfrr to receive start/end lines
Watchfrr really should receive notification about start/end
read of configuration.  Let's fix that.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-21 12:04:12 -05:00
Donald Sharp f0f618dcdb lib, vtysh: Add ability to specify resilient nhgs
Add the ability to specify a resilient nexthop group

nexthop-group A
 resilient buckets 32 idle_timer 100 unbalanced_timer 500
 nexthop 192.168.100.1 enp7s0
 nexthop 192.168.100.33 enp7s0
 nexthop 192.168.122.1 enp1s0

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-04 13:34:27 -04:00
Donald Sharp f531fae829 vtysh: Allow service ... lines to not repeat
When any `service ...` line is entered and there are multiple
daemons running prevent this from being displayed multiple times.

Fixes: #5475
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-03 13:01:35 -04:00
Donald Sharp d7cde18c63
Merge pull request #12196 from opensourcerouting/xref-vtysh
*: rewrite `extract.pl` using `xref` infra
2022-11-03 08:54:09 -04:00
David Lamparter 89cb86aeb0 build, vtysh: extract vtysh commands from .xref
Rather than running selected source files through the preprocessor and a
bunch of perl regex'ing to get the list of all DEFUNs, use the data
collected in frr.xref.

This not only eliminates issues we've been having with preprocessor
failures due to nonexistent header files, but is also much faster.
Where extract.pl would take 5s, this now finishes in 0.2s.  And since
this is a non-parallelizable build step towards the end of the build
(dependent on a lot of other things being done already), the speedup is
actually noticeable.

Also files containing CLI no longer need to be listed in `vtysh_scan`
since the .xref data covers everything.  `#ifndef VTYSH_EXTRACT_PL`
checks are equally obsolete.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
Nico Berlee 36d223bb6b
vtysh: Ensure an empty string does not get printed for host/domain
vtysh show running-config is showing:
frr version 8.3.1_git
frr defaults traditional
hostname test
log file /etc/frr/frr.log informational
log timestamp precision 3
domainname
service integrated-vtysh-config

domainname should not be printed in this case at all. If the
host has no search/domainname configured, frr_reload.py
crashes on invalid config from `vtysh show running-config`

Basically the same change as commit a7141b8

Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
2022-10-25 07:40:01 +02:00
David Lamparter 8ba718d7f7 vtysh: fix bugged command definitions
DAEMON_LIST really needs a space.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06 15:40:06 +02:00
Donatas Abraitis ac67c0e4c7 vtysh: Show allow-reserved-ranges once in config
Before:

```
donatas-pc# sh run | include allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
donatas-pc#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-27 21:41:24 +03:00
Donald Sharp 17c149ff1b vtysh: Properly handle service cputime-warning XX in config
Prevent duplicate lines from each daemon in vtysh output.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-27 09:05:30 -04:00
Donald Sharp 54b7d471f3 vtysh: Properly handle [no] service cputime-stats in config
Prevent duplicate lines from each daemon in vtysh output.

Fixes: #12022
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-27 09:02:26 -04:00
Philippe Guibert 4cd690ae4d bgpd: add 'mpls bgp forwarding' to ease mpls vpn ebgp peering
RFC4364 describes peerings between multiple AS domains, to ease
the continuity of VPN services across multiple SPs. This commit
implements a sub-set of IETF option b) described in chapter 10 b.

The ASBR to ASBR approach is taken, with an EBGP peering between
the two routers. The EBGP peering must be directly connected to
the outgoing interface used. In those conditions, the next hop
is directly connected, and there is no need to have a transport
label to convey the VPN label. A new vty command is added on a
per interface basis:

This command if enabled, will permit to convey BGP VPN labels
without any transport labels (i.e. with implicit-null label).

restriction:
this command is used only for EBGP directly connected peerings.
Other use cases are not covered.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
Donatas Abraitis 149a3fffe0 vtysh: Handle SIGTSTP (C-z) without exiting the vty shell
After 4c92dd90d3 switching to poll-based I/O,
vtysh prompt exits on C-z signal.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-10 16:18:49 +03:00
Donatas Abraitis ce2e1a0ed8 vtysh: Ignore end when parsing frr.conf
If we have `end` at the end of the frr.conf, then we never execute
XFRR_end_configuration command, and start/end markers do not work.

This leads to for example waiting BGP configuration parsing thread to hang,
and the peers are in shutdown state until the timer expires.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-20 22:57:33 +03:00
Donatas Abraitis 00e6edb97d bgpd: Add constants for some repetitive CLI strings
"Address Family\n"
"Address Family modifier\n"

Before:

```
donatas-laptop(config-router)# address-family ipv4
  <cr>
  flowspec         Address Family Modifier
  labeled-unicast  Address Family modifier
  multicast        Address Family modifier
  unicast          Address Family Modifier
  vpn              Address Family modifier
```

After:

```
donatas-laptop(config-router)# address-family
  ipv4   Address Family
  ipv6   Address Family
  l2vpn  Address Family
donatas-laptop(config-router)# address-family ipv4
  <cr>
  flowspec         Address Family modifier
  labeled-unicast  Address Family modifier
  multicast        Address Family modifier
  unicast          Address Family modifier
  vpn              Address Family modifier
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-18 10:12:57 +03:00
Donatas Abraitis ac156aecb5 lib, vtysh: Add allow-reserved-ranges global command
It will be used to allow/deny using IPv4 reserved ranges (Class E) for Zebra
(configuring interface address) or BGP (allow next-hop to be from this range).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 23:24:52 +03:00
Anuradha Karuppiah 36c3b29675 zebra: infastructure for the new dataplane plugin
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-06-27 07:56:55 -04:00
rgirada 264a2a273f vtysh: Account validity should be verified when authenticating users with PAM.
Description:
	SonarQube detects the following behaviour as a vulanarability.
	When authenticating users using PAM, it is strongly recommended to
	check the validity of the account (not locked, not expired ...),
	otherwise it leads to unauthorized access to resources.

	pam_acct_mgmt() should be called for account validity after
	calling pam_authenticate().

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-06-23 11:15:47 -07:00
Donatas Abraitis bfe7dcb880 vtysh: Add autocomplete for VRFs when using with router bgp
```
donatas-laptop(config)# router bgp 123 vrf ?
  VIEWVRFNAME  View/VRF name
       default mgmt1 servers2
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-14 13:41:13 +03:00
Donatas Abraitis 6006b807b1 *: Properly use memset() when zeroing
Wrong: memset(&a, 0, sizeof(struct ...));
    Good:  memset(&a, 0, sizeof(a));

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-11 14:08:47 +03:00
Donatas Abraitis 789c5919cf vtysh: Call fflush+fsync before calling fclose() when saving the config
A safety check we flushed the data to the storage.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-19 14:01:13 +03:00
David Lamparter edae23ff58 vtysh: remove extraneous newline
vtysh_client_execute() expects just a string without a newline; the
newline is passed through and ends up in logging output where newlines
are not quite wanted.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-07 17:55:35 +02:00
Donald Sharp f75b916348 bgpd, vtysh: Fix spelliing of explicitely
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02 07:25:18 -04:00
Russ White dcaba5ae1a
Merge pull request #10719 from opensourcerouting/nb-show-fixes
lib: fix and improve yang operational data display
2022-03-29 10:51:02 -04:00
Mobashshera Rasool ec6ac9b197 pim6d: Correct the show ip prefix-list display for pim6d
Currently the PIM6d component is getting displayed under
"show ip prefix-list" instead of "show ipv6 prefix-list".
Fixed it.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-28 03:23:48 -07:00
sarita patra 8fc3ba676e pim6d: Enable protocol as VTYSH_PIM6D for pim6_cmd.c
Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-15 23:16:41 -07:00
David Lamparter a4af82ee2b lib, vtysh: report lost messages on live log
The vtysh live logs don't try to buffer messages when vtysh isn't
reading them fast enough.  Either the kernel has space and can accept
messages without delay, or it doesn't and we continue on.

While this is intentional (otherwise slow vtysh could block a routing
daemon), at least give the user an indication if messages were dropped.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-07 18:03:16 +01:00
David Lamparter 834585bdb9 lib: add a few more bits to live log header
... and add some comments explaining the individual fields.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-07 18:03:16 +01:00
Rafael Zalamena 54aeec5ef0 lib,vtysh: show operational data with config
Add option to merge configuration data in the operational data show
command.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-03-02 16:37:43 -03:00
David Lamparter 3030e7b5ac vtysh: fix coverity issues in live-log code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-01 16:00:56 +01:00
David Lamparter 2821405a69
Merge pull request #10640 from donaldsharp/thread_timers 2022-03-01 11:45:36 +01:00
David Lamparter bec667a6bc vtysh: show live log messages
https://www.youtube.com/watch?v=8psFQCEgA18

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:33:27 +01:00
David Lamparter 4c92dd90d3 vtysh: use poll/callback-driven readline interface
Create a thread_master and funnel readline terminal I/O through it.
This allows processing other input in parallel, e.g. log messages.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:28:43 +01:00
David Lamparter 12d25fa69a vtysh: receive file descriptors from daemons
The other half of yielding back a file descriptor from a daemon to
vtysh.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:28:43 +01:00
Donald Sharp 22f31b8c52 lib, vtysh: Add show thread timers command
Add the ability to inspect the timers and when they will pop
per daemon:

sharpd@eva ~/frr (thread_return_null)> vtysh -c "show thread timers"
Thread timers for zebra:

Showing timers for default
--------------------------
  rtadv_timer                                       00:00:00.520
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.746
  if_zebra_speed_update                             00:00:02.744
  if_zebra_speed_update                             00:00:02.745

Showing timers for Zebra dplane thread
--------------------------------------

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 06:39:07 -05:00
David Lamparter d7da6520e9
Merge pull request #10376 from patrasar/master_pimv6_vtysh 2022-02-28 10:26:22 +01:00
sarita patra e8515e32a4 pim6d: Adding PIMV6 as VTYSH client
Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-25 06:08:42 -08:00
Donald Sharp 11743d1041 vtysh: Fix spelling mistakes
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:56:04 -05:00
Abhinay Ramesh b25bd2ad6e ospf6d: support keychain for ospf6 authentication
Problem Statement:
==================
As of now there is no support for ospf6 authentication.
To support ospf6 authentication need to have keychain support for
managing the auth key. 
 
RCA:
====
New support
 
Fix:
====
Enabling keychain for ospf6 authentication feature.
 
Risk:
=====
Low risk
 
Tests Executed:
===============
Have verified the support for ospf6 auth trailer feature.

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2022-02-09 01:56:38 +00:00
Yamato Sugawara 1b3aea985e zebra: fix segment-routing command not found error with --disable-pathd
Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
2022-01-16 21:46:22 +09:00
Fabrice Fontaine c919fce32d configure.ac: drop --enable-pcep option and HAVE_PATHD_PCEP
Drop --enable-pcep option and HAVE_PATHD_PCEP which does nothing since
749714731e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-12-15 16:51:33 +01:00
Igor Ryzhov 4b639f9967 vtysh: fix duplicated output of key chain configuration
When both ripd and eigrpd run at the same time, all key configuration in
key chain node is duplicated. This change adds a concept of nested nodes
into vtysh to fix the issue.

Before:
```
key chain test
 key 1
  key-string 1
 exit
 key 1
  key-string 1
 exit
exit
!
```
After:
```
key chain test
 key 1
  key-string 1
 exit
exit
!
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-12-03 18:52:42 +03:00
Igor Ryzhov eebb826040 vtysh: add missing rpki node when showing config
Before:
```
frr version 8.2-dev
frr defaults traditional
hostname frr
rpki
 rpki polling_period 20
 rpki cache 192.0.2.1 8080 preference 1
service integrated-vtysh-config
!
```

After:
```
frr version 8.2-dev
frr defaults traditional
hostname frr
service integrated-vtysh-config
!
rpki
 rpki polling_period 20
 rpki cache 192.0.2.1 8080 preference 1
exit
!
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-29 00:37:38 +03:00
Donatas Abraitis 8f241168b7 lib: Use autocomplete for route-map <name> <action> <seq>
```
exit1-debian-11(config)# route-map ?
  RMAP_NAME  Route map tag
     belekas testas
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-23 16:10:10 +02:00
Igor Ryzhov 0609190219
Merge pull request #10074 from opensourcerouting/assorted-20211116
lib/vtysh/ospf6d: assorted small bits
2021-11-19 15:43:10 +03:00
Donald Sharp 1822c2af07 vtysh: Really remove address-family evpn
I don't know how my original compile didn't fail
or I didn't notice :(

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-17 11:20:43 -05:00
Donald Sharp 8e653596c4 tools, vtysh: Remove final vestige of address-family evpn
This was deprecated over a year ago now.  Let's finally
remove it from the system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-17 07:49:56 -05:00
David Lamparter 0beb61abc2 vtysh: dispatch unique-id backtrace cmd properly
i.e. to whoever cares, since some unique IDs (from libfrr) are valid
everywhere but some others (from the daemons) only apply to specific
daemons.

(Default handling aborts on first error, so configuring any unique IDs
that don't exist on the first daemon vtysh connects to just failed
before this.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-16 18:51:22 +01:00
David Lamparter dd2c81b8c0 lib: rework vty_check_node_for_xpath_decrement
...by having a flag in struct cmd_node rather than hardcoding it in
`lib/command.c`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-16 18:51:22 +01:00
Donald Sharp e36f61b507 *: Rename quagga_timestamp with frr_timestamp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-11 14:41:27 -05:00
David Lamparter 0e06eb8b2e vtysh: defer CLI tree building
We don't need the CLI tree until we actually enter the node.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-18 19:48:11 +02:00
Igor Ryzhov a8a5b21514
Merge pull request #9429 from yar-fed/vtysh-err-not-running
vtysh: Add error code if daemon is not running
2021-09-22 22:52:52 +03:00
Yaroslav Fedoriachenko a32f6a107f vtysh: Add error code if daemon is not running
After `<daemon_name> is not running` message vtysh does not return
error. For example if you disable ospf in `/etc/frr/daemons` and run
`vtysh -c configure -c "router ospf"` it prints the message to stderr,
but returns 0.

This commit will make vtysh return error when not in interractive mode.

But if you run commands from vtysh, you will still be able to enter
views and exit them if daemon is not running.

Signed-off-by: Yaroslav Fedoriachenko <yar.fed99@gmail.com>
2021-09-21 17:51:04 +03:00
Igor Ryzhov d98d4a1e7d vtysh: remove sorting of vrf node commands
A simple strcmp-based sorting done by `config_add_line_uniq` breaks the
correct advanced sorting of static routes done by staticd. We don't
actually need to check vrf node commands for uniqueness as all commands
are daemon specific, so let's use simple `config_add_line` that doesn't
sort commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-09-20 21:18:17 +03:00
Donald Sharp b504f65baf vtysh: Allow us to gather a bit more data when extract.pl dies
When extract.pl dies, it was dieing in a manner that provided
absolutely no useful data as to what went wrong.  Let's add
a tiny bit of debug code.  So we can see what is going wrong.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-14 12:56:58 -04:00
David Lamparter 9c1490843a build: ignore prototype warnings from readline
Readline contains some truly ancient cruft.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-09-02 13:00:35 +02:00
Igor Ryzhov af581c003b vtysh: make node walkup code more generic
No need to have special processing for every single node. Just always
use "exit" the necessary number of times - it works for all nodes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-27 00:09:21 +03:00
Christian Hopps d448e2c5f9
Merge pull request #9331 from idryzhov/explicit-exit
*: explicitly print "exit" at the end of every node config
2021-08-26 11:57:33 -04:00
Igor Ryzhov 37cb0475e1 lib, zebra: move vrf netns commands from lib to zebra
"[no] netns NAME" commands are part of the lib, but they are actually
zebra-only:
- they are using vrf_netns_handler_create and its description clearly
  says that it "should be called from zebra only"
- vtysh sends these commands only to zebra
- only zebra outputs the netns related config
- zebra notifies other daemons about netns attachment

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-23 23:54:12 +03:00
Igor Ryzhov 07679ad98a *: explicitly print "exit" at the end of every node config
There is a possibility that the same line can be matched as a command in
some node and its parent node. In this case, when reading the config,
this line is always executed as a command of the child node.

For example, with the following config:
```
router ospf
 network 193.168.0.0/16 area 0
!
mpls ldp
 discovery hello interval 111
!
```
Line `mpls ldp` is processed as command `mpls ldp-sync` inside the
`router ospf` node. This leads to a complete loss of `mpls ldp` node
configuration.

To eliminate this issue and all possible similar issues, let's print an
explicit "exit" at the end of every node config.

This commit also changes indentation for a couple of existing exit
commands so that all existing commands are on the same level as their
corresponding node-entering commands.

Fixes #9206.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-23 22:08:20 +03:00
anlan_cs 9231ec75be vtysh: add "exit" for bfd's profile node
Since no "exit-bfd-profile", need add "exit" for profile node.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-08-18 04:09:20 -04:00
Igor Ryzhov 53fc645d33 vtysh, pathd: fix pcep node-entering commands
pce-config, pce and pcc node-entering commands in vtysh include no-form,
which is incorrect. Currently, when user passes a no-form command like
`no pcc`, vtysh enters the node while pathd deletes the node and this
leads to a desynchronization.

Regular and no-form commands should be defined separately to fix this.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-11 17:46:36 +03:00
Igor Ryzhov ee78534054 vtysh: fix daemon for srv6 commands
All these commands are zebra-only. We shouldn't send them to pathd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-08 22:41:10 +03:00
Igor Ryzhov c54796288e vtysh: don't install "enable" command in user mode
Recent change in d1b287e only fixed the problem for 3-letter words.

We were still displaying error for longer words starting with "ena":
```
nfware> enac
% Command not allowed: enable
nfware> enad
% Command not allowed: enable
nfware> enaena
% Command not allowed: enable
```

If we don't allow "enable" command in user mode, why add it at all?

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-25 13:08:04 +03:00
Donald Sharp d1b287e172 vtysh: Handle en better when in -u for vtysh
vtysh was unable to distinguish between end and ena.  The
code can now do so:

sharpd@eva ~/frr5 (master)> sudo vtysh/vtysh -u sharpd

Hello, this is FRRouting (version 8.1-dev).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

eva> e
% Ambiguous command: e
eva> en
% Command not allowed: enable
eva> ena
% Command not allowed: enable
eva> enab
% Command not allowed: enable
eva> enabl
% Command not allowed: enable
eva> enable
% Command not allowed: enable
eva> enb
% Unknown command: enb
eva> enc
% Unknown command: enc
eva> end
% Unknown command: end
eva> ene
% Unknown command: ene
eva> quit

Fixes: #2296
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-22 12:00:58 -04:00
Igor Ryzhov 92de4c7fb6 vtysh: fix exit from zebra-only nodes
When exiting from link-params and pseudowire nodes, we were sending exit
command to all VTYSH_INTERFACE daemons. This led to a desynchronized
state in vtysh and daemons other then zebra. We must send exit command
only to zebra.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-21 17:22:40 +03:00
Christian Hopps 744bc17db5 vtysh: add CLI timestamp '-t' flag
Example output:

    flk# show version
    % 2021/06/29 00:25:01.562

    FRRouting 8.1-dev-my-manual-build (flk).
    Copyright 1996-2005 Kunihiro Ishiguro, et al.

    ...

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-30 15:46:10 +00:00
David Lamparter 45f0118832 lib: make cputime checks runtime options (v2)
...really no reason to force this into a compile time decision.  The
only point is avoiding the getrusage() syscall, which can easily be a
runtime decision.

[v2: also split cputime & walltime limits]

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-06-24 16:42:59 +02:00
Donald Sharp 5df73b0543 vtysh: Expose SR node for non pathd use cases
The SR node is hidden by a `--enable-pathd` configuration option.
But the recent commit of SRv6 uses this node as well.  Let's expose
this node and let things work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-23 08:28:02 -04:00
Igor Ryzhov f5eef2d5a8 lib: remove vrf-interface config when removing the VRF
If we have the following configuration:
```
vrf red
 smth
 exit-vrf
!
interface red vrf red
 smth
```
And we delete the VRF using "no vrf red" command, we end up with:
```
interface red
 smth
```
Interface config is preserved but moved to the default VRF.

This is not an expected behavior. We should remove the interface config
when the VRF is deleted.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-21 18:04:46 +03:00
Quentin Young fdb7f5d54f
Merge pull request #8593 from idryzhov/cmd-ambiguous
vtysh: fix searching commands in parent nodes
2021-06-08 15:41:45 +00:00
Rafael Zalamena 4548fb256c
Merge pull request #8781 from idryzhov/fix-list-find
lib: fix output of "list" and "find" commands
2021-06-07 08:32:31 -03:00
Igor Ryzhov c22789620d lib, vtysh: reduce code duplication
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-03 02:03:15 +03:00
Hiroki Shirokura bfaab44d1e *: new cli-nodes for BGP SRv6 VPNv4 (step4)
This commit add just CLI-nodes for MP-BGP VPN configuration
with SRv6 backend rather than MPLS. Actual configuration cli
will be implemented after this commit.

Example Configuration follow.
This cli design is based on Cisco IOS-XR but actual cli
tree design is defferent between FRR and Cisco.
It's just based on cisco.

ref:
https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r6-6/segment-routing/configuration/guide/b-segment-routing-cg-asr9000-66x/b-segment-routing-cg-asr9000-66x_chapter_011.html#concept_hwj_trf_dlb

router bgp 1
 bgp router-id 1.1.1.1
 !
 segment-routing srv6 ! new cli-node
  locator LOC1 ! this cli will be added after this commit.
 !
!

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura 6c0a7c0941 *: new cli-nodes for SRv6 manager (step2)
This commit is a part of #5853 that add new cmd-node for SRv6 configuration.
This commit just add cmd-node and moving node cli only, acutual SRv6 config
command isn't added. (that is added later commit. of this branch)

new cli nodes:
* SRv6
* SRv6-locators
* SRv6-locator

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:47 -04:00
Christian Hopps 3bb513c399 lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of:
https://github.com/CESNET/libyang

staticd init load time of 10k routes now 6s vs ly1 time of 150s

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-13 16:24:48 -04:00
Rafael Zalamena 4478793c43
Merge pull request #8636 from idryzhov/ospfv3-vrf-support
OSPFv3 VRF support
2021-05-06 08:50:32 -03:00
harios_niral d48ef099db ospf6d: add vty support for multiple vrfs
Co-authored-by: Kaushik Nath <kaushiknath.null@gmail.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
2021-05-06 10:54:31 +03:00
Donatas Abraitis ed0e57e3f0 bgpd: Create BGP alias names for community/large-community
Show alias name instead of numerical value in `show bgp <prefix>. E.g.:

```
root@exit1-debian-9:~/frr# vtysh -c 'sh run' | grep 'bgp community alias'
bgp community alias 65001:123 community-1
bgp community alias 65001:123:1 lcommunity-1
root@exit1-debian-9:~/frr#
```

```
exit1-debian-9# sh ip bgp 172.16.16.1/32
BGP routing table entry for 172.16.16.1/32, version 21
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  65030
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (172.16.16.1)
      Origin incomplete, metric 0, valid, external, best (Neighbor IP)
      Community: 65001:12 65001:13 community-1 65001:65534
      Large Community: lcommunity-1 65001:123:2
      Last update: Fri Apr 16 12:51:27 2021
exit1-debian-9#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-05 16:37:00 +03:00
Donald Sharp 458133dbc5 lib, ripd, ripngd, vtysh: Move distribute list to correct spot
Allow the `distribute-list...` command in ripd and ripngd to
work correctly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-04 16:23:37 -04:00
Pavel Ivashchenko 4bb7f7c2dd vtysh: fix searching commands in parent nodes
Do not check parent command nodes in case of ambiguous and incomplete commands

Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
2021-04-29 18:35:07 +03:00
Mark Stapp 861ea6f268
Merge pull request #8465 from opensourcerouting/vtysh-scan-snafu
fix vtysh_scan SNAFUs
2021-04-16 08:23:20 -04:00
David Lamparter ee4dcee834 vtysh: add lib/thread.c to vtysh_scan
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
David Lamparter 9cb089fc43 vtysh: add lib/resolver.c to vtysh_scan
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
David Lamparter c4e57cd52e vtysh: add lib/spf_backoff.c to vtysh_scan
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
David Lamparter 48843422d3 vtysh: add lib/log_vty.c to vtysh_scan
Rather than copying everything over, include the file in vtysh_scan for
automatic pickup.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
Donald Sharp 1ff339ac05
Merge pull request #8450 from ton31337/feature/frr_history_turn_on_off
vtysh: Set history file on demand
2021-04-14 09:59:09 -04:00
David Lamparter 5a4ee981d0 vtysh: fix extract.pl for commands with "_cmd"
If the command includes `_cmd`, hilarity ensues ;)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-13 23:57:14 +02:00
Renato Westphal b6241291ee
Merge pull request #8389 from idryzhov/route-map-optimization-nb
lib: convert route-map optimization to NB
2021-04-13 00:26:20 -03:00
David Lamparter 1df904706c
Merge pull request #8288 from qlyoung/readd-space-support-to-find-command 2021-04-13 02:22:46 +02:00
Donatas Abraitis 69d4cc70ee vtysh: Set history file on demand
It's sometimes needed to disable logging all FRR commands at all.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 17:33:35 +03:00
Igor Ryzhov 38133c4a11 lib, doc: add "route-map NAME optimization" command
Currently we have a "route-map optimization" command which is entered
from inside the route-map entry but actually applies to the whole
route-map. In addition, this command is not shown in the running-config
and not stored to the startup-config during "write".

Let's add a new command on the config node level to control this setting
and show it in the running-config to make possible to save it during
"write".

The old command is saved for the backward compatibility but hidden and
marked as deprecated.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-09 20:58:36 +03:00
Quentin Young b832909b42 *: remove *.conf.sample files
Most of these are many, many years out of date. All of them vary
randomly in quality. They show up by default in packages where they
aren't really useful now that we use integrated config. Remove them.

The useful ones have been moved to the docs.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-09 13:14:30 -04:00
Igor Ryzhov f09e0369f6 vtysh: add "show memory" for a single daemon
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-08 18:47:43 +03:00
Quentin Young 767f67a456 lib, vtysh: re-add support for spaces in 'find'
Lost ability to handle them in the regex patch

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:39:56 -04:00
Igor Ryzhov 0a01b0f44d bfdd: fix profiles autocompletion
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-01 15:49:46 +03:00
Igor Ryzhov 122ee38ab4 vtysh: hide "show configuration running" command
This command is currently useful only for developers.
Let's hide it to not confuse end users by having both
"show runnning-config" and "show configuration running".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-24 13:16:15 +03:00
David Lamparter 960b9a5383 *: require semicolon after DEFINE_<typesafe...>
Again, see previous commits.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
David Lamparter bf8d3d6aca *: require semicolon after DEFINE_MTYPE & co
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet.  Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition.  And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...

With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.

Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:17 +01:00
David Lamparter 15c05f1edf *: require ISO C11 (or C++11)
It's 2021... time to drop some 10yo compat stuff.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:17 +01:00
Renato Westphal e1908ceb42
Merge pull request #7945 from volta-networks/feat_isis_snmp
isisd: add support for read-only snmp mibs objects
2021-03-14 22:14:27 -03:00
lynne 1ee746d990 isisd: support for snmp
Add support for read only mib objects from RFC4444.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-03-02 10:06:31 -05:00
Santosh P K 0a1e7b612a
Merge pull request #8073 from idryzhov/vtysh-show-config
lib: allow "show config running" command for non-transactional CLI
2021-03-01 18:40:06 +05:30
Igor Ryzhov a4e2dac168 vtysh: fix show_per_daemon for multi-instance ospfd
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-02-24 15:31:20 +03:00
Igor Ryzhov bcbe60d456 lib: allow "show config running" command for non-transactional CLI
This command doesn't rely on transactional CLI and works perfectly for
daemons converted to northbound configuration.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-02-12 18:18:34 +03:00
Quentin Young dab6893f15 vtysh: disable bracketed paste in readline
GNU Readline 8.1 enables bracketed paste by default. This results in
newlines not ending the readline() call, which breaks the ability of
users to paste in configs to vtysh's interactive shell.

Disable bracketed paste.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2021-02-07 22:51:07 -05:00
David Lamparter 01485adb9d lib/xref: add xrefs for install_element()
Combined with the DEFUN xrefs, this means we can extract the full CLI
tree from a binary file.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-01 17:28:11 +01:00
Sebastien Merle f7f6a796e8 pathd: Skip SR-TE topotests if pathd has been disabled
* If pathd binary is not found, skip the SR-TE topotests.
 * Fix some compilation warnings when pathd is not built.

Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2021-01-11 12:52:15 +01:00
Olivier Dugeon 065f7c7cc0
Merge pull request #7351 from opensourcerouting/feature/pathd
Add a new SR-TE policy management daemon and an optional PCEP module
2020-12-18 20:28:22 +01:00
Sebastien Merle efba0985fc pathd: Add optional support for PCEP to pathd
This new dynamic module makes pathd behave as a PCC for dynamic candidate path
using the external library pcpelib https://github.com/volta-networks/pceplib .

The candidate paths defined as dynamic will trigger computation requests to the
configured PCE, and the PCE response will be used to update the policy.

It supports multiple PCE. The one with smaller precedence will be elected
as the master PCE, and only if the connection repeatedly fails, the PCC will
switch to another PCE.

Example of configuration:

segment-routing
 traffic-eng
  pcep
   pce-config CONF
    source-address ip 10.10.10.10
    sr-draft07
   !
   pce PCE1
    config CONF
    address ip 1.1.1.1
   !
   pce PCE2
    config CONF
    address ip 2.2.2.2
   !
   pcc
    peer PCE1 precedence 10
    peer PCE2 precedence 20
   !
  !
 !
!

Co-authored-by: Brady Johnson <brady@voltanet.io>
Co-authored-by: Emanuele Di Pascale <emanuele@voltanet.io>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Co-authored-by: Javier Garcia <javier.garcia@voltanet.io>
Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: Sebastien Merle <sebastien@netdef.org>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-12-18 16:47:52 +01:00
Sebastien Merle 4d7b695d3a pathd: New SR-TE policy management daemon
This new daemon manages Segment-Routing Traffic-Engineering
(SR-TE) Policies and installs them into zebra. It provides
the usual yang support and vtysh commands to define or change
SR-TE Policies.

In a nutshell SR-TE Policies provide the possibility to steer
traffic through a (possibly dynamic) list of Segment Routing
segments to the endpoint of the policy. This list of segments
is part of a Candidate Path which again belongs to the SR-TE
Policy. SR-TE Policies are uniquely identified by their color
and endpoint. The color can be used to e.g. match BGP
communities on incoming traffic.

There can be multiple Candidate Paths for a single
policy, the active Candidate Path is chosen according to
certain conditions of which the most important is its
preference. Candidate Paths can be explicit (fixed list of
segments) or dynamic (list of segment comes from e.g. PCEP, see
below).

Configuration example:

segment-routing
 traffic-eng
  segment-list SL
   index 10 mpls label 1111
   index 20 mpls label 2222
  !
  policy color 4 endpoint 10.10.10.4
   name POL4
   binding-sid 104
   candidate-path preference 100 name exp explicit segment-list SL
   candidate-path preference 200 name dyn dynamic
  !
 !
!

There is an important connection between dynamic Candidate
Paths and the overall topic of Path Computation. Later on for
pathd a dynamic module will be introduced that is capable
of communicating via the PCEP protocol with a PCE (Path
Computation Element) which again is capable of calculating
paths according to its local TED (Traffic Engineering Database).
This dynamic module will be able to inject the mentioned
dynamic Candidate Paths into pathd based on calculated paths
from a PCE.

https://tools.ietf.org/html/draft-ietf-spring-segment-routing-policy-06

Co-authored-by: Sebastien Merle <sebastien@netdef.org>
Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Co-authored-by: Emanuele Di Pascale <emanuele@voltanet.io>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-12-18 16:34:02 +01:00
Donald Sharp 77f7b4b018 vtysh: When dry-running no need to start/end configuration
When doing a dry run don't send start/end configuration
commands.

Ticket: CM-32665
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-15 15:33:17 -05:00
Donald Sharp 8de2b3d990 lib, vtysh: Modify start/end configuration commands to be more hidden
There exists a world where some people have put `end` in their
configuration.  Then vtysh will command search for it and find
it and then bad things happen.

Ticket: CM-32665
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-15 15:33:17 -05:00
Mark Stapp 0114e2edc9
Merge pull request #7667 from donaldsharp/vtysh_more_useful_data
Vtysh more useful data
2020-12-04 08:14:23 -05:00
Donald Sharp 1400069124 vtysh: Have help dump the how FRR was built
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-03 22:23:57 -05:00
Donald Sharp dce33234c7 vtysh: Display version w/ vtysh --help
Add a bit of useful data to know what version of FRR we
are playing with in this vtysh instance.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-03 22:21:43 -05:00
Donald Sharp a65f4b5dc0 doc, vtysh: Add a show history command
Dump the cli history to the user in vtysh when a `show history`
command is entered.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-03 12:36:29 -05:00
Igor Ryzhov 6df43392d8 vtysh: fix incorrect memory statistics
As code comment states, 1 count of MTYPE_COMPLETION is leaked for each
autocompleted token. Let's manually decrement the counter before passing
the pointer to readline.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-30 18:55:40 +03:00
Igor Ryzhov 40ab41115d vtysh: fix memory leak
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-30 18:55:40 +03:00
Donatas Abraitis 9bcab3130b
Merge pull request #7577 from donaldsharp/datacenter_stuff
Datacenter stuff
2020-11-24 10:02:39 +02:00
Quentin Young a3014b9ac7
Merge pull request #7223 from idryzhov/fix-vtysh-view-node
vtysh: fix execution of commands from the view node
2020-11-23 13:36:41 -05:00
Igor Ryzhov 88c7120070 vtysh: fix node for "show yang operational-data"
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-21 15:15:45 +03:00
Igor Ryzhov a5eb3b0dde vtysh: fix execution of commands from the view node
We should not prepend "do" when executing commands from the view node,
because view node doesn't support "do" shortcut.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-21 15:15:45 +03:00
Donald Sharp 98cc8dd473 vtysh: Start deprecation cycle for address-family evpn
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-20 13:47:14 -05:00
Donald Sharp 64aaa92dff
Merge pull request #7574 from idryzhov/fix-quit
vtysh: send quit command to watchfrr
2020-11-20 13:00:56 -05:00
Igor Ryzhov 5772415bd3 vtysh: send quit command to watchfrr
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-20 17:42:39 +03:00
Donald Sharp 22d7226542
Merge pull request #7546 from mjstapp/limit_fds
lib: add startup-time option to limit fds used
2020-11-19 19:28:57 -05:00
Donald Sharp f8e6ada882 lib, sharpd, vtysh: When reading a file in for config send start/end indicators
When reading a file in for configuration, send start and end indicators
to interested parties.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-19 09:52:11 -05:00
Vincent Bernat dfca5be576 vtysh: fix out-of-tree build not finding vtysh/daemons.pl
This is needed to build with:

    mkdir build && cd build && ../configure && make

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
2020-11-17 20:51:23 +01:00
Mark Stapp 85dcff6e41 vtysh: remove weird whitespace
Clean up a weird tab on an empty line.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-16 17:02:33 -05:00
Donatas Abraitis cefa7492f5
Merge pull request #7251 from wesleycoakley/fix-vtysh-node-build-warn-errors
vtysh: fix build-time errors for some --enable flags
2020-10-12 21:31:04 +03:00
Renato Westphal 8b6b6b694d
Merge pull request #7222 from idryzhov/fix-debug
fix debug commands node inconsistencies
2020-10-09 21:58:24 -03:00
Igor Ryzhov d06f839e4a vtysh: remove unnecessary include
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-07 15:27:12 +03:00
Wesley Coakley 57a75dc6d5 vtysh: ignore generated file vtysh_daemons.h
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2020-10-06 17:32:09 -04:00
Wesley Coakley 662a1b0500 vtysh: Fix vtysh node build warn errors
Two vtysh nodes were misplaced during a recent refactor and were not
included under appropriate #ifdef directives and consequently triggered
build warnings (errors)

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2020-10-06 17:32:07 -04:00
Donald Sharp 25a7a8e5e5
Merge pull request #7225 from idryzhov/vtysh-fix-domainname
vtysh: fix multiple "domainname" commands in running config
2020-10-02 18:15:26 -04:00
Igor Ryzhov d7b86ae4fe vtysh: dynamically generate the list of daemons for commands
Some daemons were actually missing from the static definitions: nhrpd,
babeld, eigrpd and bfdd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 15:06:27 +03:00
Igor Ryzhov dd73744d8c *: move "show debugging ..." commands to enable node
Use the same node for "show debugging" commands in all daemons.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 15:06:05 +03:00
Igor Ryzhov cf8c39655a vtysh: fix multiple "domainname" commands in running config
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 13:00:06 +03:00