| Age | Commit message (Collapse) | Author | 
 | 
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>
(cherry picked from commit 99a9f25ce8c1e070f7f37c4cbd439c11bb7432eb)
 | 
 | 
After 4c92dd90d3d15cff640de063ff14eec950402d25 switching to poll-based I/O,
vtysh prompt exits on C-z signal.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
 | 
 | 
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>
 | 
 | 
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
Readline contains some truly ancient cruft.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
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>
 | 
 | 
It's sometimes needed to disable logging all FRR commands at all.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
 | 
 | 
When doing a dry run don't send start/end configuration
commands.
Ticket: CM-32665
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
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>
 | 
 | 
Remove mid-string line breaks, cf. workflow doc:
  .. [#tool_style_conflicts] For example, lines over 80 characters are allowed
     for text strings to make it possible to search the code for them: please
     see `Linux kernel style (breaking long lines and strings)
     <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_
     and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_.
Scripted commit, idempotent to running:
```
python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'`
```
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Satisfy checkpatch.pl requirements (check for sizeof without parenthesis)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
 | 
 | 
Stop using gmtime() or localtime() everywhere.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
 | 
 | 
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
 | 
 | 
And memory_init() to lib_cmd_init().
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
When using `show error` commands, show errors shared between multiple
daemons only once.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
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>
 | 
 | 
- no longer try to special-case a custom terminal length; the OS has
  procedures for that (SIGWINCH & TIOCGWINSZ)
- only use a pager if requested by CLI command or VTYSH_PAGER.  The
  behaviour with VTYSH_PAGER set should be compatible to previous
  versions.
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Signed-off-by: F. Aragon <paco@voltanet.io>
 | 
 | 
The append_history function in lib readline appears to
not be universally available across all of the esoteric
platforms we may want to compile on.  As such
provide a way to gracefully do nothing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
 | 
 | 
Signed-off-by: Lou Berger <lberger@labn.net>
 | 
 | 
With a new version of clang 6.0, the compiler is detecting more
issues where we may be possibly be truncating the output string.
Fix by increasing the size of the output string to make the compiler
happy.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
fixup comments for vtysh
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
Currently, "vtysh -c" interface does not provide a logic to parse
commands ending with '?' character. In consequence, the following behavior
is observed:
$ vtysh -c "show bgp ?"
 % Unknown command.
With these changes, i'm extending FRR's parser to be able to handle
these commands, which allow a more friendly interaction with users
that rely on "vtysh -c" interface. The typical use-case here is for
scenarios in which the final users relie on external/their-own CLI and
require a friendly interface to FRR's vtysh cli.
$ vtysh -c "show bgp ?"
  <cr>
   A.B.C.D               Network in the BGP routing table to
   display
   A.B.C.D/M             IPv4 prefix
   X:X::X:X              Network in the BGP routing table to display
   X:X::X:X/M            IPv6 prefix
   attribute-info        List all bgp attribute information
   cidr-only             Display only routes with non-natural netmasks
   community             Display routes matching the communities
   community-info        List all bgp community information
 ...
Signed-off-by: Rodny Molina <rmolina@linkedin.com>
 | 
 | 
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
 | 
 | 
Signed-off-by: Lou Berger <lberger@labn.net>
 | 
 | 
Signed-off-by: Lou Berger <lberger@labn.net>
 | 
 | 
Signed-off-by: Lou Berger <lberger@labn.net>
 | 
 | 
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
Add ability to set file destination for all vtysh output, with the
exception of tab-complete and similar meta output. This is useful for
inline recording of some information without exiting the shell.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
Ignore the return value of some functions in the places we know they
can't fail, and other small fixes.
Regarding the change in bgpd/rfapi/rfapi_rib.c, asserting that
rfapiRaddr2Qprefix() didn't fail is the common idiom inside the rfapi
code.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
 | 
 | 
cmd->line shall never be null for these sections.
Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
 | 
 | 
before:
frrdev# do wr
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr//frr.conf
[OK]
frrdev#
after:
frrdev# do wr
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
frrdev#
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
It didn't work
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
Fixes style nits introduced by recent pull requests.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
Eliminate several more SUID problems (VTYSH_LOG, history file) and make
the whole SUID approach more robust.  Still possibly unsafe to use, but
much better.
[v2: wrap seteuid/setegid calls]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)
Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
Centralise read_config/daemonize/dryrun/pidfile/vty_serv into libfrr.
This also makes multi-instance pid/config handling available as part of
the library.  It's only wired up in ospfd, but the code is in lib/.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
When you run 'vtysh -h' the option '--vty_socket' is listed twice.
Fixes issue #253
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
 | 
 | 
-c was previously ignored when -C (dryrun/config-check) was present.
Change so that -C -c creates an useful dry-run mode.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
Cleanup Quagga.conf -> Frr.conf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
vtysh.conf and Quagga.conf
Only allow the override if vtysh is not run with setuid()
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
 |