]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agoMerge pull request #128 from donaldsharp/readme
Russ White [Mon, 30 Jan 2017 23:09:52 +0000 (18:09 -0500)]
Merge pull request #128 from donaldsharp/readme

*: Update README

7 years agoMerge pull request #127 from LabNConsulting/working/master/patch/assert-dup-free
Donald Sharp [Mon, 30 Jan 2017 18:07:44 +0000 (13:07 -0500)]
Merge pull request #127 from LabNConsulting/working/master/patch/assert-dup-free

lib: assert on duplicate free (count)

7 years agoMerge pull request #130 from LabNConsulting/working/master/patch/rev-2.1
Donald Sharp [Sun, 29 Jan 2017 23:47:24 +0000 (18:47 -0500)]
Merge pull request #130 from LabNConsulting/working/master/patch/rev-2.1

master: bump rev and change issues pointer

7 years agoMerge pull request #129 from donaldsharp/redistribute
Lou Berger [Fri, 27 Jan 2017 22:36:20 +0000 (17:36 -0500)]
Merge pull request #129 from donaldsharp/redistribute

Fix some more issues with cli

7 years agomaster: point to https://github.com/freerangerouting/frr/issues
Lou Berger [Fri, 27 Jan 2017 21:24:03 +0000 (16:24 -0500)]
master: point to https://github.com/freerangerouting/frr/issues

7 years agomaster: bump rev to 2.1-dev
Lou Berger [Fri, 27 Jan 2017 21:21:57 +0000 (16:21 -0500)]
master: bump rev to 2.1-dev

7 years agobgpd: Fix crash in a vpn command
Donald Sharp [Fri, 27 Jan 2017 21:17:08 +0000 (16:17 -0500)]
bgpd: Fix crash in a vpn command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'origin/master' into redistribute
Donald Sharp [Fri, 27 Jan 2017 21:11:55 +0000 (16:11 -0500)]
Merge remote-tracking branch 'origin/master' into redistribute

7 years agoMerge pull request #122 from donaldsharp/moreafisafi
Lou Berger [Fri, 27 Jan 2017 21:10:54 +0000 (16:10 -0500)]
Merge pull request #122 from donaldsharp/moreafisafi

More CLI fixes/cleanup

7 years agobgpd: Fix help strings
Donald Sharp [Fri, 27 Jan 2017 20:51:41 +0000 (15:51 -0500)]
bgpd: Fix help strings

Fix the missing help strings

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Fix redistribute issue
Donald Sharp [Fri, 27 Jan 2017 20:33:00 +0000 (15:33 -0500)]
*: Fix redistribute issue

Somewhere in the past we switched from
using the auto-generated redistribute statements
to a non-generated version.  This caused us to
loose new protocols to redistribute as they are
added.  Put it back.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Fix Auto generation of redistribution strings
Donald Sharp [Fri, 27 Jan 2017 20:36:09 +0000 (15:36 -0500)]
lib: Fix Auto generation of redistribution strings

When we changed the parser we forgot to update this
script to modify the '(...)' to '<...>'

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agotests: Fix conversion between iana_t and afi_t
Donald Sharp [Fri, 27 Jan 2017 20:31:47 +0000 (15:31 -0500)]
tests: Fix conversion between iana_t and afi_t

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'master' into moreafisafi
Donald Sharp [Fri, 27 Jan 2017 19:58:19 +0000 (14:58 -0500)]
Merge branch 'master' into moreafisafi

7 years agobgp: Fix merge mistake
Lou Berger [Fri, 27 Jan 2017 19:30:27 +0000 (14:30 -0500)]
bgp: Fix merge mistake

I choose the wrong merge direction.  Fixed.

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Update README
Donald Sharp [Fri, 27 Jan 2017 17:53:40 +0000 (12:53 -0500)]
*: Update README

1) Modify that PIM-SM/MSDP is now included
2) Add pointers to where people can talk to us

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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 agotests: use lib memory allocation
Lou Berger [Fri, 27 Jan 2017 14:16:43 +0000 (09:16 -0500)]
tests: use lib memory allocation

Signed-off-by: Lou Berger <lberger@labn.net>
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 agolib: assert on duplicate free (count)
Lou Berger [Fri, 27 Jan 2017 12:46:25 +0000 (07:46 -0500)]
lib: assert on duplicate free (count)

Signed-off-by: Lou Berger <lberger@labn.net>
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 agopimd: More pim cli fixup
Donald Sharp [Thu, 26 Jan 2017 14:10:54 +0000 (09:10 -0500)]
pimd: More pim cli fixup

Found some additional issues with the pim
cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Fix crash when entering 'address-family ipv4'
Donald Sharp [Thu, 26 Jan 2017 14:09:38 +0000 (09:09 -0500)]
bgpd: Fix crash when entering 'address-family ipv4'

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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 agobgpd: Allow some new cli to have correct number of help strings
Donald Sharp [Thu, 26 Jan 2017 03:08:35 +0000 (22:08 -0500)]
bgpd: Allow some new cli to have correct number of help strings

The 'add vrf NAME prefix....' command was missing a \n
and the 'no label' command was missing a help string for no.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agovtysh: Add 'vrf-policy NAME' and 'exit-vrf-policy' to ignore list.
Donald Sharp [Thu, 26 Jan 2017 03:04:49 +0000 (22:04 -0500)]
vtysh: Add 'vrf-policy NAME' and 'exit-vrf-policy' to ignore list.

vtysh needs to ignore these two commands or we'll get duplicate warnings

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Fix '[no] labels LABELLIST...' command
Donald Sharp [Thu, 26 Jan 2017 02:55:25 +0000 (21:55 -0500)]
bgpd: Fix '[no] labels LABELLIST...' command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd, vtysh: Allow bgp and vtysh to work together again
Donald Sharp [Thu, 26 Jan 2017 02:51:28 +0000 (21:51 -0500)]
bgpd, vtysh: Allow bgp and vtysh to work together again

Harmony is restored to the world as bgp and vtysh
can now, again, stay in sync with each other.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Fix error in "no set large-comm-list"
Donald Sharp [Thu, 26 Jan 2017 02:38:58 +0000 (21:38 -0500)]
bgpd: Fix error in "no set large-comm-list"

The cli for "no set large-comm-list..."
is wrong.

Signed-off-by: Donald Sharp <sharpd@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>