]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agobgpd: Fixup some cli help strings that were missing
Donald Sharp [Fri, 27 Jan 2017 17:45:34 +0000 (12:45 -0500)]
bgpd: Fixup some cli help strings that were missing

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'origin/pr/113' into pr/111
Donald Sharp [Fri, 27 Jan 2017 17:39:06 +0000 (12:39 -0500)]
Merge remote-tracking branch 'origin/pr/113' into pr/111

7 years agoMerge remote-tracking branch 'origin/master' into pr/111
Donald Sharp [Fri, 27 Jan 2017 16:44:42 +0000 (11:44 -0500)]
Merge remote-tracking branch 'origin/master' into pr/111

7 years agoMerge pull request #107 from donaldsharp/bgpafisafi
Lou Berger [Fri, 27 Jan 2017 15:57:46 +0000 (10:57 -0500)]
Merge pull request #107 from donaldsharp/bgpafisafi

Bgp afi safi fixes

7 years agobgpd: Fix assert condition error.
Donald Sharp [Fri, 27 Jan 2017 14:49:30 +0000 (09:49 -0500)]
bgpd: Fix assert condition error.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgp: Add Asserts and remove dead code
Donald Sharp [Fri, 27 Jan 2017 14:07:44 +0000 (09:07 -0500)]
bgp: Add Asserts and remove dead code

Add asserts to how I expect bgp_vty_find_and_parse_afi_safi
to be used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Make usage of idx consistent
Donald Sharp [Fri, 27 Jan 2017 13:12:53 +0000 (08:12 -0500)]
bgpd: Make usage of idx consistent

Convert the idx to &idx to make our api more consistent

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Fix possible crash and some minor CR issues
Donald Sharp [Fri, 27 Jan 2017 09:57:44 +0000 (04:57 -0500)]
bgpd: Fix possible crash and some minor CR issues

This fix addresses these things:

1) Clean up documentation as requested
2) Fix a wrong search for "exact-match"
3) Fix possible crash.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #123 from opensourcerouting/graph-fixes
Donald Sharp [Thu, 26 Jan 2017 15:45:22 +0000 (10:45 -0500)]
Merge pull request #123 from opensourcerouting/graph-fixes

lib/graph.c fixes

7 years agoMerge remote-tracking branch 'origin/master' into bgpafisafi
Donald Sharp [Thu, 26 Jan 2017 15:38:07 +0000 (10:38 -0500)]
Merge remote-tracking branch 'origin/master' into bgpafisafi

7 years agoMerge branch 'master' into working/master/patch-set/4-misc-fixes
Lou Berger [Thu, 26 Jan 2017 14:59:03 +0000 (09:59 -0500)]
Merge branch 'master' into working/master/patch-set/4-misc-fixes

Merged pull request with master

Conflicts:
bgpd/bgp_mplsvpn.c
bgpd/bgp_route.c
bgpd/rfapi/rfapi_vty.c

7 years agolib: graph: fix vector_remove()
David Lamparter [Thu, 26 Jan 2017 04:59:50 +0000 (05:59 +0100)]
lib: graph: fix vector_remove()

vector_remove would corrupt the data in the following sequence:
1. assume vector v = [a, b], active = 2
2. vector_unset(v, 0) => v = [NULL, b], active = 2
3. vector_remove(v, 1)

vector_remove calls vector_unset(v, 1), vector_unset notices index #0 is
also NULL and thus sets active to 0.

The equality test in vector_remove() now fails, leading it to decrement
v->active *again*, leading to an underflow that will likely crash the
daemon (and might even be exploitable).

This call sequence does not happen in existing code since vector_unset()
is not used on graph from/to lists.  Nonetheless this is a buried land
mine in the code at best.

Rewrite the function - while we're at it, there's no reason to move the
entire array around, just fill the hole with the last element.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: graph: speed up node deletion
David Lamparter [Thu, 26 Jan 2017 05:56:48 +0000 (06:56 +0100)]
lib: graph: speed up node deletion

We don't need to copy the from/to arrays, we can just iterate backwards.

NB: this makes graph_remove_edge delete only one edge (which is more
consistent with graph_add_edge allowing parallel edges).

Iterating graph->nodes backwards also makes graph_delete_graph faster
since that also iterates backwards.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: graph: fix deletions
David Lamparter [Wed, 25 Jan 2017 03:13:14 +0000 (04:13 +0100)]
lib: graph: fix deletions

Iterating over an array while deleting items needs to consider
interactions between the iteration position and deletion.  The previous
code completely ignored that problem, leading to memleaks (graph_delete
skipping half of the nodes) and dangling pointers (if parallel edges
exist in graph_remove_edge).

Iterating backwards is safe and reduces "move to fill hole" overhead in
deletion.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge branch 'frr/pull/118'
David Lamparter [Thu, 26 Jan 2017 02:15:33 +0000 (03:15 +0100)]
Merge branch 'frr/pull/118'

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #101 from LabNConsulting/working/master/patch-set/3-vrf
Donald Sharp [Wed, 25 Jan 2017 23:26:15 +0000 (18:26 -0500)]
Merge pull request #101 from LabNConsulting/working/master/patch-set/3-vrf

Master version of basic vrf commands & some other missed fixes

7 years agoMerge branch 'frr/pull/92' (BGP Large Community support)
David Lamparter [Wed, 25 Jan 2017 22:04:29 +0000 (23:04 +0100)]
Merge branch 'frr/pull/92' (BGP Large Community support)

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: lcommunity: fix minor issues
David Lamparter [Wed, 25 Jan 2017 21:33:29 +0000 (22:33 +0100)]
bgpd: lcommunity: fix minor issues

- route_set_lcommunity would do nothing (and leak memory) if attr->extra
  wasn't up yet
- an if() arch in bgp_show_table() was duplicated (with no effect)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: lcommunity: fix whitespace & copyright
David Lamparter [Wed, 25 Jan 2017 21:29:31 +0000 (22:29 +0100)]
bgpd: lcommunity: fix whitespace & copyright

(to match surrounding code)
"git diff -w" should be almost empty.

Copyright edited to say FRR, this is not GNU Zebra :)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: Remove redundant warning message
Donald Sharp [Wed, 25 Jan 2017 14:43:11 +0000 (09:43 -0500)]
bgpd: Remove redundant warning message

When bgp_vty_find_and_parse_afi_safi_vrf detects
a invalidly named vrf, it warns the user.  There
is no need for the calling function to warn
again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Add some documentation for bgp_vty_find_and_parse_afi_safi_vrf
Donald Sharp [Wed, 25 Jan 2017 14:37:13 +0000 (09:37 -0500)]
bgpd: Add some documentation for bgp_vty_find_and_parse_afi_safi_vrf

The use of this function was causing some confusion.  As
such let's add some documentation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup some missing help strings.
Donald Sharp [Wed, 25 Jan 2017 14:13:46 +0000 (09:13 -0500)]
pimd: Cleanup some missing help strings.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #116 from bingen/bugfix/zclient_missing_break
Donald Sharp [Wed, 25 Jan 2017 13:56:33 +0000 (08:56 -0500)]
Merge pull request #116 from bingen/bugfix/zclient_missing_break

lib: Fix missing break in zlcient switch

7 years agolib: Fix missing break in zlcient switch
ßingen [Wed, 25 Jan 2017 13:33:01 +0000 (14:33 +0100)]
lib: Fix missing break in zlcient switch

7 years agobgpd: Add ability to clean lcommunity hash
Donald Sharp [Wed, 25 Jan 2017 13:26:21 +0000 (08:26 -0500)]
bgpd: Add ability to clean lcommunity hash

Ensure that we don't leak any memory on shutdown.
Since the bgp_lcommunity.c file mirrors bgp_ecommunity.c
Add the same code for shutdown that ecommunity has.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix double add of command
Donald Sharp [Wed, 25 Jan 2017 13:20:06 +0000 (08:20 -0500)]
pimd: Fix double add of command

We were adding the 'ip msdp ...' command to
the parser 2x.  Some new code added to the
parser apparently catches this for us now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #105 from opensourcerouting/cli_merge_step_prep
Donald Sharp [Wed, 25 Jan 2017 12:49:21 +0000 (07:49 -0500)]
Merge pull request #105 from opensourcerouting/cli_merge_step_prep

Prepare for split-off cli parser "merge" step

7 years agoMerge pull request #114 from opensourcerouting/parser-mtypes
Quentin Young [Wed, 25 Jan 2017 02:16:23 +0000 (21:16 -0500)]
Merge pull request #114 from opensourcerouting/parser-mtypes

lib: parser: fix memory management

7 years agolib: parser: fix memory management
David Lamparter [Wed, 25 Jan 2017 01:27:29 +0000 (02:27 +0100)]
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>
7 years agobgpd: more VPN&ENCAP show afi safi related cleanup
Lou Berger [Tue, 24 Jan 2017 19:52:06 +0000 (14:52 -0500)]
bgpd: more VPN&ENCAP show afi safi related cleanup
      Issued ID'ed by regression

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: restore show bgp neighbors command
Lou Berger [Mon, 23 Jan 2017 20:39:04 +0000 (15:39 -0500)]
bgpd: restore show bgp neighbors command

7 years agobgpd: disambiguate differet forms of
Lou Berger [Mon, 23 Jan 2017 01:51:12 +0000 (20:51 -0500)]
bgpd: disambiguate differet forms of
      show bgp ipv4 vpn
      address-family ipv4&6 vpn

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: Shift rfapi receive hooks for vpn and encap safis into
G. Paul Ziemba [Mon, 16 Jan 2017 19:09:12 +0000 (11:09 -0800)]
bgpd rfapi: Shift rfapi receive hooks for vpn and encap safis into
     bgp_update/bgp_withdraw (Issue #91)

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agobgpd rfapi: fix issue where advertised prefixes were not being disambiguated
Lou Berger [Sun, 15 Jan 2017 21:43:20 +0000 (16:43 -0500)]
bgpd rfapi: fix issue where advertised prefixes were not being disambiguated
        by RD

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agoMerge pull request #104 from opensourcerouting/time-cleanup
Donald Sharp [Tue, 24 Jan 2017 16:43:32 +0000 (11:43 -0500)]
Merge pull request #104 from opensourcerouting/time-cleanup

Time cleanup

7 years agoMerge pull request #42 from donaldsharp/pim_lib_work2
David Lamparter [Tue, 24 Jan 2017 16:10:09 +0000 (17:10 +0100)]
Merge pull request #42 from donaldsharp/pim_lib_work2

Pim-SM + MSDP

7 years agobgpd: fix show ip bgp ipv4|ipv6 vpn command
Philippe Guibert [Tue, 24 Jan 2017 15:17:30 +0000 (16:17 +0100)]
bgpd: fix show ip bgp ipv4|ipv6 vpn command

The fix consists in setting the correct safi value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agobgpd: move bgp_show_type enumerate to bgp_route.h
Philippe Guibert [Fri, 20 Jan 2017 10:44:18 +0000 (11:44 +0100)]
bgpd: move bgp_show_type enumerate to bgp_route.h

This bgp_show_type enumerate was duplicated and modified in several
places. The commit takes the enumerate with the biggest enumerate, so
that it can be used by all the functions using this enumerate.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agobgpd: fix ambiguity between show ip bgp ipv4|ipv6 encap|vpn commands
Philippe Guibert [Tue, 24 Jan 2017 14:49:47 +0000 (15:49 +0100)]
bgpd: fix ambiguity between show ip bgp ipv4|ipv6 encap|vpn commands

The commit is removed duplicated command show ip bgp ipv4|ipv6 enca|vpn
command that is conflicting between bgp_route.c and
bgp_mplsvpn.c/bgp_encap.c files. The fix is integrating the call to
specific mpls or encap settings from inside bgp_show_route() function.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agobgpd: remove duplicated vty command to enter in vpn address family node
Philippe Guibert [Tue, 24 Jan 2017 09:13:37 +0000 (10:13 +0100)]
bgpd: remove duplicated vty command to enter in vpn address family node

Because the vpn configuration command was duplicate, there was an
ambiguity to raise. This is a fix that permits configuring vpnv4 or
vpnv6 address-families on bgp.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agobgpd: Fix crash with parsing the community
Donald Sharp [Tue, 24 Jan 2017 14:47:59 +0000 (09:47 -0500)]
bgpd: Fix crash with parsing the community

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Clean up 'show bgp neighbor ...' commands
Donald Sharp [Tue, 24 Jan 2017 03:30:37 +0000 (22:30 -0500)]
bgpd: Clean up 'show bgp neighbor ...' commands

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Cleanup 'show .... statistics' command
Donald Sharp [Tue, 24 Jan 2017 02:34:36 +0000 (21:34 -0500)]
bgpd: Cleanup 'show .... statistics' command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Cleanup 'view all' command
Donald Sharp [Tue, 24 Jan 2017 01:50:50 +0000 (20:50 -0500)]
bgpd: Cleanup 'view all' command

1) Make [<view|vrf> WORD] consistent
2) Fix inconsistent help string
3) Fix the show .. vrf all command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgp: Fix 'show .... regexp REGEX...'
Donald Sharp [Tue, 24 Jan 2017 01:29:54 +0000 (20:29 -0500)]
bgp: Fix 'show .... regexp REGEX...'

Fix this command to use the correct format for
a show command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Cleanup 'show .... <bestpath|multipath>'
Donald Sharp [Tue, 24 Jan 2017 00:58:56 +0000 (19:58 -0500)]
bgpd: Cleanup 'show .... <bestpath|multipath>'

Cleanup the bgp bestpath or multipath show commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Start cleanup of 'show [ip] bgp ...' commands
Donald Sharp [Tue, 24 Jan 2017 00:48:24 +0000 (19:48 -0500)]
bgpd: Start cleanup of 'show [ip] bgp ...' commands

Create bgp_vty_find_and_parse_afi_safi_vrf that
will parse the
`show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]]'
part of a command and to return the correct spot we are in the command.

Cleanup 'dampening parameters' part of this command.

Consolidate the creation of the bgp data structure to be a bit cleaner.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Fix vpn commands cli
Donald Sharp [Sun, 22 Jan 2017 18:13:48 +0000 (13:13 -0500)]
bgpd: Fix vpn commands cli

The parser was incorrect for the 'set ... vpn nexthop ...' commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Remove unused function bgp_parse_safi
Donald Sharp [Sun, 22 Jan 2017 16:05:04 +0000 (11:05 -0500)]
bgpd: Remove unused function bgp_parse_safi

The bgp_parse_safi function is never called remove it.
Especially as that later commits will properly handle
what this function was trying to do.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Fix function used only within KEEP_OLD_VPN_COMMANDS
Donald Sharp [Sun, 22 Jan 2017 16:01:09 +0000 (11:01 -0500)]
bgpd: Fix function used only within KEEP_OLD_VPN_COMMANDS

The show_adj_route_vpn function is only currently used
in conjunction with the KEEP_OLD_VPN_COMMANDS #define.
Add this function to that define for the moment.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Add VRF_ALL define
Donald Sharp [Sat, 21 Jan 2017 12:07:46 +0000 (07:07 -0500)]
lib: Add VRF_ALL define

Allow the specification of a VRF_ALL to be
used for CLI.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'frr/pull/93'
David Lamparter [Tue, 24 Jan 2017 02:16:01 +0000 (03:16 +0100)]
Merge branch 'frr/pull/93'

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: fix whitespace
David Lamparter [Tue, 24 Jan 2017 02:15:26 +0000 (03:15 +0100)]
bgpd: fix whitespace

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #96 from qlyoung/guard-strict-dedup
David Lamparter [Tue, 24 Jan 2017 02:10:55 +0000 (03:10 +0100)]
Merge pull request #96 from qlyoung/guard-strict-dedup

lib: guard strict cli completions

7 years agozebra: fpm: fix --enable-dev-build
David Lamparter [Mon, 23 Jan 2017 22:32:01 +0000 (23:32 +0100)]
zebra: fpm: fix --enable-dev-build

I guess no one uses --enable-dev-build...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agogrammar_sandbox: detab
David Lamparter [Mon, 23 Jan 2017 22:40:07 +0000 (23:40 +0100)]
grammar_sandbox: detab

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: guard yylloc
David Lamparter [Tue, 24 Jan 2017 01:51:00 +0000 (02:51 +0100)]
lib: parser: guard yylloc

yylloc seems to be NULL on parser init for some flex+bison
combinations...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: support bison < 3.0 for parse.error=verbose
David Lamparter [Mon, 23 Jan 2017 22:26:23 +0000 (23:26 +0100)]
build: support bison < 3.0 for parse.error=verbose

*sigh*

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: time: add TIMEVAL_TO_TIMESPEC
David Lamparter [Mon, 23 Jan 2017 22:17:35 +0000 (23:17 +0100)]
lib: time: add TIMEVAL_TO_TIMESPEC

Should be in system headers, but not specified by any standard.
Not currently used anywhere yet.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: restore show bgp neighbors command
Lou Berger [Mon, 23 Jan 2017 20:39:04 +0000 (15:39 -0500)]
bgpd: restore show bgp neighbors command

7 years agogrammar_sandbox: add into daemons if DEV_BUILD
David Lamparter [Fri, 16 Dec 2016 07:11:37 +0000 (08:11 +0100)]
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>
7 years agogrammar_sandbox: add .dot file writing capability
David Lamparter [Mon, 5 Dec 2016 22:03:57 +0000 (23:03 +0100)]
grammar_sandbox: add .dot file writing capability

Writing a .dot graphviz file is very useful to get a graphical
representation of the command graph.

This code is intended solely for testing & development, it uses some
fixed-size array and may unexpectedly crash.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: add error location reporting
David Lamparter [Sat, 17 Dec 2016 06:32:58 +0000 (07:32 +0100)]
lib: parser: add error location reporting

flex+bison have nice capabilities to track the location that is
currently being processed; let's enable these and get better warnings
for broken CLI specs.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: unify subgraphs & simplify even more
David Lamparter [Sat, 17 Dec 2016 04:25:36 +0000 (05:25 +0100)]
lib: parser: unify subgraphs & simplify even more

This cuts a large piece of complexity from the parser by making the
sequences between | the same, no matter whether it's <> () or [].

This causes some changes in behaviour:
- [foo|bar] is now accepted
- <foo|[bar]> is now accepted (yes it's stupid)
- {a|b} is now means "at least one of these, in any order"; to allow
  zero use [{a|b}] instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: keep subgraph pointers on stack
David Lamparter [Sat, 17 Dec 2016 04:14:49 +0000 (05:14 +0100)]
lib: parser: keep subgraph pointers on stack

There's no need to malloc() these, we can just keep them on the stack.
The entire struct will get copied around, but replacing a 2-pointer copy
with a 1-pointer copy + malloc + free overhead is not quite efficient.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: track matching FORK_TKN & JOIN_TKN
David Lamparter [Fri, 16 Dec 2016 21:34:35 +0000 (22:34 +0100)]
lib: parser: track matching FORK_TKN & JOIN_TKN

This associates pairs of FORK and JOIN tokens, so the merge function can
identify where a subgraph begins and ends.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: simplify OPTION_TKN & SELECTOR_TKN
David Lamparter [Fri, 16 Dec 2016 21:30:36 +0000 (22:30 +0100)]
lib: parser: simplify OPTION_TKN & SELECTOR_TKN

These are functionally identical as "fork" tokens.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: free Mr. T
David Lamparter [Mon, 23 Jan 2017 20:49:21 +0000 (21:49 +0100)]
lib: parser: free Mr. T

Mr. T was abducted by the parser and held hostage for ransom.
Murdock was called, flew in and replaced him with a Tab character.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: cope with negative timeout in thread.c
David Lamparter [Mon, 23 Jan 2017 17:51:19 +0000 (18:51 +0100)]
lib: cope with negative timeout in thread.c

Since time is no longer cached, if we schedule something with zero
timeout, it will automatically be negative by the time we reach the
event loop.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: time: clean out thread.c
David Lamparter [Mon, 23 Jan 2017 17:45:43 +0000 (18:45 +0100)]
lib: time: clean out thread.c

Remove quagga_get_relative(), replace with monotime().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: simplify SPF time consumption calculations
David Lamparter [Mon, 23 Jan 2017 17:16:03 +0000 (18:16 +0100)]
ospfd: simplify SPF time consumption calculations

monotime_since() does exactly the same thing.
... and timeval_elapsed is now private to lib/thread.c

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: use monotime()
David Lamparter [Wed, 18 Jan 2017 00:30:43 +0000 (01:30 +0100)]
*: use monotime()

This is largely a bulk-replace made with coccinelle.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: remove quagga_gettime() return value checks
David Lamparter [Tue, 17 Jan 2017 22:07:59 +0000 (23:07 +0100)]
*: remove quagga_gettime() return value checks

The next patch will bulk-replace these, and monotime() has time_t as
return value, not an error indicator.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: time: remove local time helpers
David Lamparter [Tue, 17 Jan 2017 21:57:57 +0000 (22:57 +0100)]
lib: time: remove local time helpers

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: time: remove recent_time
David Lamparter [Tue, 17 Jan 2017 21:48:33 +0000 (22:48 +0100)]
lib: time: remove recent_time

This isn't even used anywhere.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: time: remove recent_relative_time()
David Lamparter [Tue, 17 Jan 2017 21:46:07 +0000 (22:46 +0100)]
lib: time: remove recent_relative_time()

Replace with monotime() [which is not cached].

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospf6d: time: remove unused/duplicate helpers
David Lamparter [Mon, 23 Jan 2017 15:54:56 +0000 (16:54 +0100)]
ospf6d: time: remove unused/duplicate helpers

timersub() & timerclear() are in sys/time.h;
timerstring_local() is unused.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: time: replace local helpers with monotime
David Lamparter [Tue, 17 Jan 2017 21:05:56 +0000 (22:05 +0100)]
ospfd: time: replace local helpers with monotime

This ditches tv_add, tv_sub, tv_cmp, etc. in favour of
monotime{,_since,_until}() which actually makes the code much more
readable in some locations.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: time: add new monotime() helpers
David Lamparter [Mon, 23 Jan 2017 15:54:51 +0000 (16:54 +0100)]
lib: time: add new monotime() helpers

This adds monotime() to retrieve monotonic clock time, as well as
monotime_since() and monotime_until() for relative monotonic time.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: disambiguate differet forms of
Lou Berger [Mon, 23 Jan 2017 01:51:12 +0000 (20:51 -0500)]
bgpd: disambiguate differet forms of
      show bgp ipv4 vpn
      address-family ipv4&6 vpn

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: add NVE/VRF name to show vnc registrations
Lou Berger [Sat, 14 Jan 2017 17:09:12 +0000 (12:09 -0500)]
bgpd rfapi: add NVE/VRF name to show vnc registrations

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: add vrf-policy config using existing vnc code
Lou Berger [Thu, 12 Jan 2017 13:30:17 +0000 (08:30 -0500)]
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>
7 years agobgpd rfapi: fix issue where advertised prefixes were not being disambiguated
Lou Berger [Sun, 15 Jan 2017 21:43:20 +0000 (16:43 -0500)]
bgpd rfapi: fix issue where advertised prefixes were not being disambiguated
        by RD

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agoMerge pull request #90 from LabNConsulting/remotes/origin/working/master/patch-set...
Donald Sharp [Fri, 20 Jan 2017 16:27:15 +0000 (11:27 -0500)]
Merge pull request #90 from LabNConsulting/remotes/origin/working/master/patch-set/2a-no-vrf

Master version of #83 Fix a number of VPN/Encap SAFI related issues (no VRF CLI changes)

7 years agoMerge pull request #88 from pguibert6WIND/mergedown_vpn_old_format
Donald Sharp [Fri, 20 Jan 2017 15:52:17 +0000 (10:52 -0500)]
Merge pull request #88 from pguibert6WIND/mergedown_vpn_old_format

Mergedown vpn old format

7 years agobgpd: Fix cli for large-communities
Donald Sharp [Fri, 20 Jan 2017 15:43:08 +0000 (10:43 -0500)]
bgpd: Fix cli for large-communities

The original commit for large communities broke
'show ip bgp' and 'show bgp ipv4 unicast' and
their ilk.  This commit fixes this as well
as some vtysh parse errors identified.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: guard strict cli completions
Quentin Young [Thu, 19 Jan 2017 17:07:39 +0000 (17:07 +0000)]
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>
7 years agopimd: Cleanup the headers.
Donald Sharp [Thu, 19 Jan 2017 15:01:02 +0000 (10:01 -0500)]
pimd: Cleanup the headers.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: PIM_MRT is a linux specific piece of code.
Donald Sharp [Thu, 19 Jan 2017 14:58:53 +0000 (09:58 -0500)]
pimd: PIM_MRT is a linux specific piece of code.

The PIM_MRT and registration for WRVIFWHOLECACHE
is a bit of linux specific code.  Until such
time that this gets implemented we will have
issues being able to work within the context
of PIM-SM.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix README file for FRR
Donald Sharp [Thu, 19 Jan 2017 13:57:17 +0000 (08:57 -0500)]
pimd: Fix README file for FRR

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup compile warnings
Donald Sharp [Thu, 19 Jan 2017 13:49:47 +0000 (08:49 -0500)]
pimd: Cleanup compile warnings

Cleanup some compile warnings in pim on *bsd.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Missing include causes compile failure on some bsd's
Donald Sharp [Thu, 19 Jan 2017 13:49:12 +0000 (08:49 -0500)]
pimd: Missing include causes compile failure on some bsd's

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'origin/master' into pim_lib_work2
Donald Sharp [Thu, 19 Jan 2017 09:32:49 +0000 (04:32 -0500)]
Merge remote-tracking branch 'origin/master' into pim_lib_work2

Conflicts:
lib/zebra.h
zebra/rt_netlink.c

7 years agoisisd: Fix unused variable in some situations.
Donald Sharp [Thu, 19 Jan 2017 00:32:25 +0000 (19:32 -0500)]
isisd: Fix unused variable in some situations.

Fix an unused variable for certain compile
options.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Fix signed/unsigned comparison
Donald Sharp [Thu, 19 Jan 2017 00:31:52 +0000 (19:31 -0500)]
zebra: Fix signed/unsigned comparison

Fix a signed/unsigned comparison.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Cleanup some compiler warnings
Donald Sharp [Thu, 19 Jan 2017 00:30:47 +0000 (19:30 -0500)]
bgpd: Cleanup some compiler warnings

Cleanup some compiler warnings discovered by
omnios.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Add some documentation to wheel.h
Donald Sharp [Thu, 19 Jan 2017 00:04:40 +0000 (19:04 -0500)]
lib: Add some documentation to wheel.h

Add some hopefully useful documentation to the
timer wheel.h code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoSupport for BGP Large Communities
Job Snijders [Tue, 15 Nov 2016 10:00:39 +0000 (19:00 +0900)]
Support for BGP Large Communities

BGP Large Communities are a novel way to signal information between
networks. An example of a Large Community is: "2914:65400:38016". Large
BGP Communities are composed of three 4-byte integers, separated by a
colon. This is easy to remember and accommodates advanced routing
policies in relation to 4-Byte ASNs.

This feature was developed by:
Keyur Patel <keyur@arrcus.com> (Arrcus, Inc.),
Job Snijders <job@ntt.net> (NTT Communications),
David Lamparter <equinox@opensourcerouting.org>
and Donald Sharp <sharpd@cumulusnetworks.com>

Signed-off-by: Job Snijders <job@ntt.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: use address-family <afi> <safi> in show running for vpn&encap (Issue #80)
Lou Berger [Tue, 17 Jan 2017 18:45:46 +0000 (13:45 -0500)]
bgpd: use address-family <afi> <safi> in show running for vpn&encap (Issue #80)

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: use VN as nexthop for MPLS tunnels too
Lou Berger [Fri, 13 Jan 2017 15:18:48 +0000 (10:18 -0500)]
bgpd rfapi: use VN as nexthop for MPLS tunnels too
     Also minor show format cleanup

Signed-off-by: Lou Berger <lberger@labn.net>