Commit Graph

272 Commits

Author SHA1 Message Date
Donald Sharp
b46be72b4a Merge branch 'master' into EIGRP 2017-05-02 11:38:06 -04:00
Don Slice
f51bae9cf9 bgpd: labeled unicast config
Implement support for activating the labeled-unicast address family in
BGP and relevant configuration for this address family.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2017-04-06 10:30:03 -04:00
Donald Sharp
97133f7915 Merge remote-tracking branch 'origin/master' into EIGRP 2017-04-05 20:52:32 -04:00
David Lamparter
3e7c8d040c Merge branch 'stable/2.0'
Fixed minor conflicts from "defaults" change on stable.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-04-04 19:01:47 +02:00
Lou Berger
447a8fe92e Rename: FreeRangeRouting FRRouting
Signed-off-by: Lou Berger <lberger@labn.net>
2017-03-30 14:22:35 -04:00
David Lamparter
8efe88eacf *: track version & "defaults" in configs
[CF]: Move default name to autoconf and update tests

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-03-28 19:18:42 +02:00
David Lamparter
4dcee34bd6 Revert "lib: Fix tab completions memleak, memory stats corruption"
This reverts commit 039dc61292.

The patch actually made the situation worse since the return value from
cmd_complete_command_real() was now inconsistently allocated from
different memory stat pools.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-09 19:23:00 +01:00
Donald Sharp
7f57883ee6 eigrp: Initial Commit
Please Note, I will be redoing this commit message with
more information.

Additionally I will rework the lib/* changes into their
own commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-08 23:07:46 -05:00
David Lamparter
deaa50db47 lib: hide away logging internals
... no need to have struct zlog generally-exposed.

A few files get to include log_int.h because they use zlog/vzlog.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 00:15:40 +01:00
David Lamparter
dd8376febd lib: remove remaining struct zlog * args
These don't serve any purpose either.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 00:15:40 +01:00
David Lamparter
bf1013e6c4 lib: simplify protocol/log naming
The protocols enum serves no purpose other than adding potential for
bugs and making it complicated to add a new protocol... nuke.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 00:15:40 +01:00
David Lamparter
bb85d700d5 lib: ditch struct zlog * argument on zlog/vzlog()
It's completely useless...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 00:15:39 +01:00
David Lamparter
4f04a76b71 *: add frr_init() infrastructure
Start centralising startup & option parsing into the library.

FRR_DAEMON_INFO is a bit weird, but it will become useful later (e.g.
for killing the ZLOG_* enum, and having the daemon name available)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-07 23:07:20 +01:00
Donald Sharp
5a1945e4e8 lib: Cleanup missing help strings for 'show commandtree..'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-03 10:54:10 -05:00
Philippe Guibert
9e6df0b7ac lib: define BGP_EVPN_NODE
This define introduces bgp sub node address-family evpn.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-02-14 13:58:57 +01:00
Donald Sharp
757abe78d8 Merge pull request #195 from opensourcerouting/cli_merge
CLI: independent merge step
2017-02-11 07:00:00 -05:00
David Lamparter
de8f7a3983 lib: parser: rewrite token deduplication
Merge the parsed graph into the existing one as a separate step.  This
makes it possible to merge identical subgraphs, which is used e.g. in
bgpd for <A.B.C.D|X:X::X:X|WORD> neighbor names.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 15:39:04 +01:00
David Lamparter
148781210f lib: fix remaining coverity issues
Reported-by: Coverity
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 15:04:06 +01:00
Donald Sharp
b9aa3abbbe Merge pull request #189 from opensourcerouting/config-write-sync
lib: use fsync() for config writes, plug fd leak
2017-02-09 09:52:58 -05:00
David Lamparter
1520d0aca9 lib: use fsync() for config writes, plug fd leak
sync() has a HUGE impact on systems that perform actual I/O, i.e. real
servers...

Also, we were leaking a fd on each config write ever since
c5e69a0 "lib/vty: add separate output fd support to VTYs"
(by myself :( ...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-09 14:25:55 +01:00
David Lamparter
056cfe496e lib: use fsync() for config writes, plug fd leak
sync() has a HUGE impact on systems that perform actual I/O, i.e. real
servers...

Also, we were leaking a fd on each config write ever since
c5e69a0 "lib/vty: add separate output fd support to VTYs"
(by myself :( ...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-09 12:54:25 +01:00
David Lamparter
a31ff449a0 lib: fix some coverity NULL check warnings
Reported-by: Coverity Scan
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 16:34:59 +01:00
David Lamparter
caeb0a4f65 lib: remove unused cmd_concat_strvec()
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 16:33:25 +01:00
David Lamparter
bff9c3e9d3 lib/tests: add cmd_hostname_set()
To make it possible for testcli to get a clean memory management bill.
(Note: XFREE() is NULL-safe, just like free().)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-31 15:28:39 +01:00
Donald Sharp
6dfe1c38d7 Merge pull request #101 from LabNConsulting/working/master/patch-set/3-vrf
Master version of basic vrf commands & some other missed fixes
2017-01-25 18:26:15 -05:00
Donald Sharp
d2ce19c9b5 Merge pull request #105 from opensourcerouting/cli_merge_step_prep
Prepare for split-off cli parser "merge" step
2017-01-25 07:49:21 -05:00
David Lamparter
83364d20d5 lib: parser: fix memory management
command.c had:
DEFINE_MTYPE_STATIC(LIB, CMD_TOKENS, "Command desc")
while command_match.c had:
DEFINE_MTYPE_STATIC(LIB, CMD_TOKENS, "Command Tokens")

... which means that there are 2 distinct MTYPE_CMD_TOKENS.
(The description text being different does not matter, even with the
same text it'd be 2 distinct types.)

command_match.c allocates token->arg in command_match_r() while
command.c frees it in del_cmd_token().  Therefore with each command
being executed, the allocation count goes up on one, down on the other.

=> clean up parser allocation counting.  Also, use separate MTYPEs for
the different fields in struct cmd_token.

Fixes: #108 / ee9216cf ("lib, ripngd: clean up merge leftovers")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
2017-01-25 02:27:29 +01:00
David Lamparter
af2567b646 grammar_sandbox: add into daemons if DEV_BUILD
Also adds "grammar access <node>" to test/dump an existing command node
(e.g. BGP_NODE).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-23 21:52:44 +01:00
David Lamparter
0bf5b1cbe3 lib: parser: simplify OPTION_TKN & SELECTOR_TKN
These are functionally identical as "fork" tokens.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-23 21:52:43 +01:00
Lou Berger
5ff06872e9 bgpd: add vrf-policy config using existing vnc code
add add/clear vrf prefix
      + Modified for FRR master parser

Signed-off-by: Lou Berger <lberger@labn.net>
2017-01-22 20:54:57 -05:00
Quentin Young
5320569435 lib: guard strict cli completions
Completions are checked for token and docstring equality before
deduplicating. Put an ifdef guard around checking docstrings because
many of them are inconsistent and may confuse users in a release build.

It is a good idea to enable VTYSH_DEBUG when adding new CLI in the
future to help check docstrings.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-01-19 17:15:45 +00:00
Donald Sharp
46c323a66b Merge pull request #27 from qlyoung/fix-derefs2
bgpd, lib: fix a few scan-build catches
2017-01-06 19:36:59 -05:00
Donald Sharp
15667da96d Merge pull request #24 from qlyoung/fix-uninitialized-jump
lib: Initialize ->allowrepeat
2017-01-06 19:34:09 -05:00
Donald Sharp
3b14d86eed Merge remote-tracking branch 'origin/stable/2.0' 2017-01-06 09:58:21 -05:00
Donald Sharp
9473e34052 watchfrr: Rename watchquagga -> watchfrr
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-03 20:13:02 -05:00
David Lamparter
9b532e09f9 Merge pull request #37 from LabNConsulting/working/2.0/patch-set-170102a
Working/2.0/patch set 170102a
2017-01-03 16:44:44 +01:00
Lou Berger
271a0c2548 lib/command.c: fix leak id'ed by valgrind
Signed-off-by: Lou Berger <lberger@labn.net>
2017-01-02 15:04:47 -05:00
David Lamparter
b2f361571b build: rename (1 of ?): configure.ac + preproc
This replaces Quagga -> FRR in most configure.ac settings as well as
a handful of preprocessor macros in the source code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 17:57:47 +01:00
Quentin Young
c01d03a658 bgpd, lib: fix a few scan-build catches
Fixes a couple null pointer derefs and uninit'd values.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-20 03:26:47 +00:00
Quentin Young
a8e4ddd408 lib: Initialize ->allowrepeat
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-18 05:39:21 +00:00
Quentin Young
55d403c9b2 lib: fix crash when tab-completing do ... commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-18 05:14:55 +00:00
David Lamparter
53d5ec3678 lib: parser: fix SEGV when Tab hits non-WORD_TKN
If <Tab> processing finds that there is only 1 candidate, but that
candidate is not a WORD_TKN that we can tab-complete on, the status
would remain at CMD_COMPLETE_FULL_MATCH, but the resulting list of
possible completions is empty.

This then SEGVs in lib/vty.c where it tries to access the first element
of the list, assuming FULL_MATCH always has 1 element there...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-16 20:42:01 +01:00
David Lamparter
04cb240868 Merge branch 'fixes/command'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-08 15:07:24 +01:00
David Lamparter
d7d73ffc8f *: fix up DEFUNs without install_element calls
These now generate warnings which will break the build with -Werror.

Note this may have enabled commands that should be disabled, or the
other way around...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-05 20:28:24 +01:00
David Lamparter
7ddcfca4fb Merge branch 'queue/osr/vtysh-generic'
WARNING: Merge contains nontrivial fixups in vrf_cmd handling.

Conflicts:
	lib/if.c
	zebra/interface.c
2016-12-05 20:04:08 +01:00
Christian Franke
74d57f5a1f lib: "write mem" should write to persistent configuration
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-12-05 19:52:50 +01:00
David Lamparter
53dc2b05c7 Merge branch 'stable/2.0'
Conflicts:
	bgpd/bgp_route.c
	lib/if.c
	ripd/rip_interface.c
	zebra/interface.c
	zebra/zebra_vty.c
2016-12-05 19:48:38 +01:00
David Lamparter
8ab22cd4be Merge branch '-renato' into stable/2.0
This contains bgp memory leak fixes as well as cleanups to VRF/namespace
handling and has been run through extended testing in Cumulus' testbed:

Tested-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-05 16:23:28 +01:00
David Lamparter
b5a1e9ef5c lib: remove misleading copy/del_cmd_element
struct cmd_element items are static global variables, they are never
allocated, copied or freed.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01 18:45:30 +01:00
David Lamparter
2ab402707f lib: move command_parse_format prototype
The function prototype for command_parse_format() is better left in
command.h, so that the bison-generated header file doesn't need to be
included for that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01 18:45:22 +01:00
David Lamparter
0b84f29490 *: make DEFUN installations file-local
This moves all install_element calls into the file where the DEFUNs are
located.  This fixes several small related bugs:

- ospf6d wasn't installing a "no interface FOO" command
- zebra had a useless copy of "interface FOO"
- pimd's copy of "interface FOO" was not setting qobj_index, which means
  "description LINE" commands would fail with an error

The next commit will do the actual act of making "foo_cmd" static.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01 17:25:56 +01:00
David Lamparter
ef736f12ba *: fix "uninitialized" warnings
reported by clang for:
- cmd_complete_command()
- show_ip_bgp_ipv4()

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-29 14:15:05 +01:00
Renato Westphal
58ac32e2d5 zebra/lib: plug several memleaks
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 16:15:27 -02:00
David Lamparter
45ef430000 build: fix -Wmaybe-uninitialized warnings
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-15 11:17:50 +09:00
Quentin Young
07321a065d Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	lib/command.c
	lib/vty.c
2016-11-12 05:17:37 +00:00
Quentin Young
17aca20bfb lib, vtysh: Fix memory leaks, change cmd_element to const
Fix a few memory issues:

* Not freeing tab-completions upon input match failure
* Invalid write when null-terminating tab-completions
* Not freeing argv[] itself in additinon to elements
* Use XFREE() instead of free() as appropriate
* Not freeing final token of an [option] during parsing

Make a few minor changes to CLI internals:

* Improve documentation on matching & completion functions
* Only make one copy of cmd_token's when building argv,
  instead of three
* Don't make a copy of the matching cmd_element

Make one major(ish) change to CLI internals:

* Change all pointers to struct cmd_element to const

Code outside of the core CLI units should never have an
occasion to modify the internal state of the command system.
Doing so could easily amount to having a CLI interface that
changes during runtime, and could conceivably lead to security
issues. Explicitly disallowing this removes any chance of
confusion.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-12 01:06:32 +00:00
Quentin Young
7a4662b4a9 lib: Update list [permutations]
Don't show hidden or deprecated commands.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-10 23:30:20 +00:00
Quentin Young
ce882f8168 lib: Implement hidden and deprecated commands
Each token now knows whether it is part of a hidden
or deprecated command. Command completion logic hides
such tokens when generating completions. Command
matching logic works as before and will still match on
hidden and deprecated commands.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-10 23:17:07 +00:00
David Lamparter
87f44e2f0b lib: add minimal no-config VTY mode
This silences the following warning from watchquagga:
"Can't save to configuration file, using vtysh."
which otherwise appears when doing a "write file" in vtysh when no
integrated-config is in use.

Also make "show memory" available in watchquagga.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-10 10:15:27 +01:00
Quentin Young
34f1f6dc78 lib: Remove node debug message on list output
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-03 19:18:02 +00:00
Quentin Young
5b5231b091 lib: Fix segfault on erroneous command
Command completion vector should only be copied if it is
non-null.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-31 03:34:27 +00:00
Quentin Young
ebacb4edce lib: Various minor improvements & bugfixes to CLI backend
- Do not allow tab-completion on anything except words
- Rewrite cmd_make_strvec to use strsep
- Remove a few trailing whitespaces
- Remove cmd_complete_command_lib

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-29 04:43:04 +00:00
Quentin Young
39e92c066f Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	bgpd/bgp_encap.c
	bgpd/bgp_route.c
	lib/command.c
	lib/command.h
	ospf6d/ospf6d.c
	vtysh/vtysh.c
2016-10-21 19:27:49 +00:00
Quentin Young
ae19d7dd48 lib: Add helper function for working with argv, update bgpd to use it
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-20 20:31:24 +00:00
Quentin Young
0a538fc98f Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	isisd/isis_routemap.c
	zebra/rt_netlink.c
2016-10-20 16:31:49 +00:00
Paul Jakma
274f29b2f4 lib: keep hash of node's commands to detect duplicate installs
* command.h: (struct cmd_node) Add a hash, so duplicate installs of
  a cmd_element to a command node can be detected.  To help catch
  strays from the VIEW/ENABLE node consolidation particularly
  (installs to VIEW automatically install to ENABLE too now).
* command.c: (cmd_hash_{key,cmp}) helpers for the hash - just directly
  on the pointer value is sufficient to catch the main problem.
  (install_node) setup the hash for the command node.
  (install_element) check for duplicate installs.
  The assert on the cmd_parse_format seems misplaced.
  (install_default_basic) separate the basic, VIEW, node default commands
  to here.
  (cmd_init) get rid of dupes, given consolidation.
  (cmd_terminate) clean up the node command hash.

Not done: The (struct cmd_node)'s vector could be replaced with the
cmd hash, however much of the command parser depends heavily on the
vector and it's a lot of work to change.  A vector_lookup_value could
also work, particularly if vector could be backed by a hash.

The duplicate check could be disabled in releases - but useful in
development.  It's a little extra overhead at startup.  The command
initialisation overhead is already something that bites in
micro-benchmarks - makes it easy for other implementations to show
how much faster they are with benchmarks where other load is low
enough that startup time is a factor.
2016-10-19 22:28:45 -04:00
Christian Franke
57387fb2cd lib: add api method to read current config path
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-10-18 08:39:23 -04:00
Quentin Young
e52702f29d Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	bgpd/bgp_route.c
	bgpd/bgp_routemap.c
	bgpd/bgp_vty.c
	isisd/isis_redist.c
	isisd/isis_routemap.c
	isisd/isis_vty.c
	isisd/isisd.c
	lib/command.c
	lib/distribute.c
	lib/if.c
	lib/keychain.c
	lib/routemap.c
	lib/routemap.h
	ospf6d/ospf6_asbr.c
	ospf6d/ospf6_interface.c
	ospf6d/ospf6_neighbor.c
	ospf6d/ospf6_top.c
	ospf6d/ospf6_zebra.c
	ospf6d/ospf6d.c
	ospfd/ospf_routemap.c
	ospfd/ospf_vty.c
	ripd/rip_routemap.c
	ripngd/ripng_routemap.c
	vtysh/extract.pl.in
	vtysh/vtysh.c
	zebra/interface.c
	zebra/irdp_interface.c
	zebra/rt_netlink.c
	zebra/rtadv.c
	zebra/test_main.c
	zebra/zebra_routemap.c
	zebra/zebra_vty.c
2016-10-17 23:36:21 +00:00
Renato Westphal
6694f68c3f lib/vtysh: fix duplicate installation of some vty commands
This is a followup to commits 735e62 and 0b1442, where we forgot to apply
the same VIEW/ENABLE consolidation logic to vtysh. Also, we can't call
install_default() for the ENABLE node because some of the vty commands
installed by this function were already installed in the VIEW node before.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-10-12 19:33:56 -04:00
Donald Sharp
0b1442e37b *: Consolidate all double VIEW_NODE and ENABLE_NODE's
If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well.  This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
Donald Sharp
735e62a0f2 lib: Consolidate VIEW_NODE to be ENABLE_NODE as well
If you are in VIEW_NODE, the command should exist in ENABLE_NODE
as well.  This is being done to reduce chances of code being
added to one but not the other NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
Donald Sharp
3c8ab49fd1 bgpd, lib: Remove RESTRICTED_NODE from code base
The RESTRICTED_NODE command is not used, introduces code
complexity and provides no additional levels of security.

The only way to get into RESTRICTED_NODE is to add, under
vty configuration the command 'anonymous restricted', and
then telnet to a daemon, provide a password, then type
'enable' and fail to enter the password three times.
Then the user can enter a very limited set of commands to
monitor bgp and only bgp behavior.

This commit removes both the RESTRICTED_NODE usage as well
as the lib/* usage of the code

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
Quentin Young
a2454870d6 lib: Remove show commandtree, add list permutations
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-07 21:44:10 +00:00
Quentin Young
c0f9771dcc lib: Add naive deduplication checks when installing commands
Since not all duplicate commands can be caught during graph
construction, do a linear search over all commands before
installing.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-07 18:41:41 +00:00
David Lamparter
1bf9f0270c lib: add "qobj" object-ID infrastructure
This adds 64-bit random identifiers as "safe pointers" which are also
type-tracked / can have type-specific extension methods.

This will be used by both the CLI (to keep safe references while in
config editing mode) as well as the Cap'n Proto code (to hand out
pointers to the user in a safe way and add per-type handlers)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-10-07 09:09:51 -04:00
Quentin Young
cbd7259d95 lib: Log invalid/unknown commands to log file
Ticket: CM-6855

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-06 18:39:31 +00:00
Quentin Young
6011c1b213 lib: Make <cr> appear first in completions
When a command is complete and <cr> appears in tab- or
?-completions, make sure it appears first

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-06 01:15:48 +00:00
Quentin Young
3871154b72 lib: Invalid commands are errors, fix msg formatting
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-05 23:50:49 +00:00
Quentin Young
42debbb43d lib: Add logging for invalid commands
Ticket: CM-6855

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-04 20:41:52 +00:00
Quentin Young
98463e0ab7 lib: fix password and enable password syntax
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-04 18:47:17 +00:00
Quentin Young
268316d185 lib: Clean up completions code, fix segfault on no match
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-03 23:21:11 +00:00
Lou Berger
65efcfce42 bgpd: add L3/L2VPN Virtual Network Control feature
This feature adds an L3 & L2 VPN application that makes use of the VPN
and Encap SAFIs.  This code is currently used to support IETF NVO3 style
operation.  In NVO3 terminology it provides the Network Virtualization
Authority (NVA) and the ability to import/export IP prefixes and MAC
addresses from Network Virtualization Edges (NVEs).  The code supports
per-NVE tables.

The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2
(L2) forwarding information between NVAs and NVEs is referred to as the
Remote Forwarder Protocol (RFP). OpenFlow is an example RFP.  For
general background on NVO3 and RFP concepts see [1].  For information on
Openflow see [2].

RFPs are integrated with BGP via the RF API contained in the new "rfapi"
BGP sub-directory.  Currently, only a simple example RFP is included in
Quagga. Developers may use this example as a starting point to integrate
Quagga with an RFP of their choosing, e.g., OpenFlow.  The RFAPI code
also supports the ability import/export of routing information between
VNC and customer edge routers (CEs) operating within a virtual
network. Import/export may take place between BGP views or to the
default zebera VRF.

BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN
information between NVAs. BGP based IP VPN support is defined in
RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659,
BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use
of both the Encapsulation Subsequent Address Family Identifier (SAFI)
and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation
Subsequent Address Family Identifier (SAFI) and the BGP Tunnel
Encapsulation Attribute, are supported. MAC address distribution does
not follow any standard BGB encoding, although it was inspired by the
early IETF EVPN concepts.

The feature is conditionally compiled and disabled by default.
Use the --enable-bgp-vnc configure option to enable.

The majority of this code was authored by G. Paul Ziemba
<paulz@labn.net>.

[1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req
[2] https://www.opennetworking.org/sdn-resources/technical-library

Now includes changes needed to merge with cmaster-next.
2016-10-03 08:17:02 -04:00
Quentin Young
51d41d759b lib: Null-terminate tab completions char*[]
vtysh expects the result of a tab completion to
have a null pointer as the last element

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-02 03:27:58 +00:00
Quentin Young
c5bd4620b0 lib: Fix command execution npe
Caller may pass NULL if it does not care about what
command was matched.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-01 20:05:10 +00:00
Quentin Young
a98d33ab20 lib, vtysh: refactor vtysh.c, allow parser continuance
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-30 23:03:05 +00:00
Quentin Young
76b6abb95a lib: initialize cmd_vector and add a root node to graph
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-30 19:33:11 +00:00
Daniel Walton
6de69f8305 all: added some missing <>s within []s
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 15:31:48 +00:00
Daniel Walton
58749582a9 all: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 00:16:31 +00:00
Daniel Walton
67656e9b65 all: added CHECK ME for DEFUNs that look at argc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-29 17:48:57 +00:00
Daniel Walton
199d90a10e Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-25 16:49:39 +00:00
Daniel Walton
3ce54f7812 Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>
Reviewed-by:   Sam Tannous <stannous@cumulusnetworks.com>

Ticket:
2016-09-25 14:22:48 +00:00
Daniel Walton
9ccf14f739 Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-25 14:10:48 +00:00
Quentin Young
d862bffbda lib: lib compiles
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-23 21:34:33 +00:00
Daniel Walton
c349116d7c lib: add 'int idx_foo' argv index variables
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 20:17:29 +00:00
Quentin Young
f667a580b7 lib: Implement removed ALIAS into DEFUN
N.B.: some of these are de-facto ALIAS resurrections
that are necessary due to some parser limitations; these
are marked with ALIAS_FIXME so I can go back and add
capability to the parser to handle these special cases.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-23 20:08:47 +00:00
Daniel Walton
6147e2c694 convert <1-255> to (1-255), ()s to <>s, etc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 13:47:20 +00:00
Renato Westphal
eac6e3f027 ldpd: adapt the code for Quagga
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:09 -04:00
Daniel Walton
f412b39a33 ALIAS removal for bgp, ospf, pim, isis, rip, ripng, lib and zebra
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 03:55:26 +00:00
Quentin Young
97e5b7c0b3 lib: argv fixes, XFREE -> free, rm decl in matcher
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-22 20:26:07 +00:00
Daniel Walton
e4123a9bb5 Revert "lib: Fixup more files"
This reverts commit f68cec764a.
2016-09-22 18:22:50 +00:00