Commit Graph

387 Commits

Author SHA1 Message Date
Donald Sharp
61408536df zebra: Add ability for default vrf to route-leak
Allow the end user to specify static routes that leak
across vrf's in the default vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:26:42 -05:00
Donald Sharp
37728041b6 zebra: Move ip route ... generation to vrf control
Move the code that generates the 'show run' output for
'ip route' to be controlled by the vrf config generation
code.  Since it really belongs there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:26:41 -05:00
Donald Sharp
b2ffa06b4f zebra: Add vrf level 'ip route ...' commands
Add the ability to accept 'ip route ...' commands
from within a vrf context.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:25:07 -05:00
Donald Sharp
cbb0dbf6bd zebra: Add the zvrf pointer to the 'struct static_route'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:22:46 -05:00
Donald Sharp
2f03bc8f72 zebra: Add zebra_static_route_leak function
Add a function to handle the route leaking of a static
route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:22:46 -05:00
Donald Sharp
2793a0980d zebra: When displaying nexthop information show correct vrf
If the vrf for the nexthop is different than the vrf the
route is in, display the nexthops vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:20:36 -05:00
Donald Sharp
99b9d9609f zebra: Use the correct vrf id to lookup the ifp pointer
Use the nexthop vrf_id to properly lookup the ifp pointer
for display purposes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:20:36 -05:00
Mitesh Kanjariya
9bb77a5b3d
Merge branch 'master' into evpn-symmetric-routing 2018-01-11 09:00:23 -08:00
Renato Westphal
fb6f7c2c25
Merge pull request #1515 from donaldsharp/selected_to_front1
Store selected_fib as a pointer off of rib_dest_t
2017-12-19 14:09:03 -02:00
mitesh
0412988bd5 zebra: only show vrf matched to a l3-vni in show vrf vni
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
mitesh
3f02fbab67 zebra: pass ERR_STR_SZ in zebra_vxlan_process_vrf_vni_cmd
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
Mitesh Kanjariya
90384b2471 zebra: vrf to vni mapping command is only valid under vrf submode
Ticket: CM-18821
Review: Trivial
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
316f4ca4d9 zebra: json support for show evpn rmac specific mac command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
c0e519d32d zebra: json support for show evpn specific next-hop command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
35be5542dd zebra: json support for show vrf vni command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
9aa741eae8 zebra: show commands for specific rmac/nh entries
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
b7cfce934f zebra, lib: zebra changes for symmetric routing support
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:56:44 -08:00
Donald Sharp
0efb5e9b4b zebra: Display if a taged route is being used as a realm
When displaying a specific route and if it has a tag
and if we have turned on realm support notify the user
that a tag value of (1-255) is installed into the kernel
with the realm set.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-14 09:49:43 -05:00
Donald Sharp
c0d136aec2 zebra: Try to move non zapi cli commands from zserv.c
zserv.c has become a bit of a dumping ground for zebra cli.
I'd like to focus the zserv.c code into it's core functionality
which is handling the zapi interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-13 07:57:15 -05:00
Donald Sharp
5f7a4718e2 zebra: Replace SELECTED_FIB flag with a rib_dest_t pointer
The SELECTED_FIB flag was placed upon the entry that we
have inserted into the kernel.  Remove this flag and replace
with a `rib_dest_t` *selected_fib.  Just keep track of the
selected_fib as we modify it.  This removes allot of
FOREACH_RE loops as that we do not need to find the
entry anymore.

At this point in time I think this is a very minor performance
boost.  Most `rib_dest_t` structures do not typically carry
more than 1 route_entry, but the minute you start having more
than one entry you can and will start having significant processing
time spent finding the selected_fib.

A future commit may re-order the route entries and possibly
keep more pointers on `rib_dest_t` to avoid lookup.  This
is a bit tricky because of the FIB_OVERRIDE code.

Signed-off-by Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-05 17:26:32 -05:00
Quentin Young
10c61d28bf
zebra: add back support for nUlL0
Re-add support for typos when specifying a null route.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-28 14:12:07 -05:00
Renato Westphal
88aa65f849
Merge pull request #1470 from donaldsharp/zebra_multicast
Zebra multicast
2017-11-21 12:50:46 -02:00
Donald Sharp
fba31af2b5 zebra: Fix 'show ip rpf' to actually work
Rework of do_show_ip_route caused the 'show ip rpf'
cli to stop working.  This put's it back into working
order.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-19 19:47:32 -05:00
Donald Sharp
ab59f4f7e3 ldpd, zebra: Fix make dist compiles
The original clippy implementation used if VTYSH_EXTRACT_PL
was defined or not to know to include as part of the creation
of vtysh.

Follow their lead here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-09 11:14:33 -05:00
Russ White
453a5340a8
Merge pull request #1363 from donaldsharp/z_improvements
Z improvements
2017-10-31 20:27:19 -04:00
Renato Westphal
5ce91022c1 zebra: unify the ipv4/ipv6 'show ip route' commands - part 2/2
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-25 16:03:56 -02:00
Donald Sharp
62d52dedf0 zebra: Add Hidden 'zebra zapi-packets (1-10000)' command
Allow the end user to specify how many packets we want
to process at one time coming down the zapi, before
we yield and let other things process.

This is a Hidden command because it is not necessarily
something that we want end users to be able to play with

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25 11:13:42 -04:00
Donald Sharp
3a30f50f3f zebra: Allow user to specify work-queue processing hold time
Allow the user to modify the work-queue processing hold time
from 10ms to a value from (0-10000).  Make the command hidden
as that it's a semi-dangerous command and it could cause
issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25 10:59:05 -04:00
Renato Westphal
ce0ff16bd9 zebra: fix route node leak on error path
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:23:33 -02:00
Renato Westphal
a3e13ef37f zebra: 'show ip route' with multiple options at the same time
Now it's possible to specify multiple options when viewing the RIB or
FIB.

Example: 'show ip route 192.168.0.0/16 longer-prefixes tag 10 ospf'

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:23:33 -02:00
Renato Westphal
ecffa493c0 zebra: unify the ipv4/ipv6 'show ip route' commands - part 1/2
Note: I had to remove one assert in clidef.py in order to fix a build
error when using a preprocessor string (FRR_IP_REDIST_STR_ZEBRA) inside
a DEFPY command. This should be revisited later.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:12:40 -02:00
Renato Westphal
8526b84200 zebra: fix display of negative route metrics and tags
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-05 22:55:58 -03:00
Renato Westphal
67c0a9206c Merge pull request #1180 from dwalton76/ipv6-static-route-null0
Ipv6 static route null0
2017-09-27 13:42:53 -03:00
Daniel Walton
1e058f38c2 zebra: split ip route DEFUNs for blackhole, reject, etc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-27 15:35:28 +00:00
Daniel Walton
d7d75634e9 zebra: cleanup reject vs blackhole vs null0 vs Null0
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-20 22:24:27 +04:00
Renato Westphal
a2addae8fe *: use clang's 'ForEachMacros' format style option
This fixes the broken indentation of several foreach loops throughout
the code.

From clang's documentation[1]:
  ForEachMacros: A vector of macros that should be interpreted as foreach
  loops instead of as function calls.

[1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-15 14:53:46 -03:00
Daniel Walton
bb92922eaa zebra: cleanup reject vs blackhole vs null0 vs Null0
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-14 18:11:29 +00:00
Donald Sharp
14a481d916 zebra: Allow 'show ip route...' to display uptime for all routes
Display uptime for all route types instead of just for RIP,
OSPFv2, ISIS, NHRP, TABLE? and BGP routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12 14:58:10 -04:00
Donald Sharp
eaf5150f58 zebra: Modify 'show ip route ...' to show duplicated nexthops
Add the ability for person issuing 'show ip route...' commands
to see if we've suppressed adding a nexthop to the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12 14:52:20 -04:00
Renato Westphal
57a58d777f zebra: accept Null0 again in addition to null0
Restore behavior before commit a830942.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-05 11:50:34 -03:00
Renato Westphal
9aabb2ea74 zebra: display static blackhole routes consistently
If we configure a static route pointing to null0 and zebra displays
it with the 'blackhole' keyword in the running configuration, the
frr-reload.py script will have issues. Fix this by introducing the
'static_blackhole_type' enum.

Fixes #1091.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-05 11:50:34 -03:00
Renato Westphal
cc54cfee3a zebra: remove refcnt from the route_entry structure
This reference counter was introduced in 2001, apparently to solve a
problem with connected routes being added/removed multiple times. The RIB
code changed a lot since then, and giving the current callers of rib_add()
and rib_delete() it's safe to assume that we don't need this anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-31 21:17:11 -03:00
Renato Westphal
b3c18264e4 Merge pull request #1079 from qlyoung/fix-style-a
*: fix style
2017-08-31 13:22:55 -03:00
Jafar Al-Gharaibeh
959768e8d0 Merge pull request #1044 from donaldsharp/combination
Coverity Cleanup of Stuff
2017-08-31 10:25:55 -05:00
Quentin Young
60466a63f2
*: fix style
Fixes style nits introduced by recent pull requests.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-30 11:27:11 -04:00
David Lamparter
a830942228 zebra: cleanup blackhole support
blackhole support was horribly broken. cleanup by removing blackhole
stuff from ZEBRA_FLAG_*

introduces support for "prohibit" routes (Linux/netlink only)
also clean up blackhole options on "ip route" vty commands.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-28 05:07:51 +02:00
Renato Westphal
0af35d90a1 *: fix assorted issues detected by Coverity Scan
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-24 21:49:39 -03:00
Renato Westphal
b81ef7b30a zebra: fix display of static routes pointing to nonexistent interfaces
Bug introduced a couple of weeks ago by myself. Only happens when the
route has an IP nexthop + a nexthop interface.

Example:
debian(config)# ip route 10.0.1.0/24 172.16.1.10 fake1
debian(config)# do sh run
Building configuration...
[snip]
!
ip route 10.0.1.0/24 172.16.1.10 unknown
!
end

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-22 10:52:07 -03:00
David Lamparter
695bb8f0d1 Merge branch 'frr/pull/822' ("EVPN fixes")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-09 21:34:10 +02:00
Donald Sharp
d3d9c86f54 Merge pull request #919 from opensourcerouting/static-routes-ifindex-update
fixup static routes' ifindexes when interfaces (dis)appear
2017-08-08 13:39:19 -04:00
Donald Sharp
bd592158ef zebra: Use JSON_STR
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-08 10:30:13 -04:00
Chirag Shah
cd23307906 zebra: Enable JSON for EVPN show cmds
Ticket: CM-16959
Reviewed By: CCR-6401
Testing Done:
Execute 'show evpn .... json' form of outputs with local/remote vteps

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-08-08 10:28:50 -04:00
Donald Sharp
99a6a31e50 *: Define the number of seconds in a Day, Week and year
The defines:

ONE_DAY_SECOND
ONE_WEEK_SECOND
ONE_YEAR_SECOND

were being defined all over the system, move the
define to a central location.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-08 09:06:22 -04:00
David Lamparter
c3c0406378 zebra: static: update on ifindex changes
Whenever an interface is created or deleted in the system, we need to
check whether we have static routes referencing that interface by name.
If so, we need to [un]install these routes.

This has the unfortunate side effect of making static routes with
non-existent interfaces disappear from "show ip route", but I think
that's acceptable (and I don't see a "good" fix for that).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-06 05:17:09 +02:00
David Lamparter
23443030d3 zebra: static: rename IFINDEX -> IFNAME
Static routes are really held by ifname, not ifindex.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-06 05:17:09 +02:00
Jorge Boncompte
925c2f8853 zebra: do not hide distance and metric for kernel routes
There's no reason for not showing this information.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
2017-08-04 10:19:36 +02:00
Jorge Boncompte
1994ae60ee zebra: show nexthop MTU if available on detailed 'show ip route'
Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
2017-08-04 10:19:36 +02:00
Renato Westphal
00685a85e2 zebra: use DEFPY for static routes
Now we have a single command for IPv4 static routes and another one for
IPv6 static routes (+ one command for IPv4 multicast static routes).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-28 00:46:59 -03:00
Renato Westphal
1d3f0eff59 zebra: unify the ipv4/ipv6 static route functions
Addresses Issue #655.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 23:46:56 -03:00
Renato Westphal
599186ad97 zebra: allow fully specified static ipv4 routes
Fully specified routes are useful when you need to ensure that the
nexthop address is reachable through the specified interface.

Addresses Issue #641.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 23:46:41 -03:00
Renato Westphal
c6cef20ba9 zebra: refactor zebra_static_ipv4() and static_ipv6_func()
This is a preliminary step to join both functions into one later.

The main idea here is to make these functions have separate arguments
for the nexthop address and the nexthop interface, and adjust the call
sites appropriately. Having an argument that could be a nexthop address
OR a nexthop interface was making the code very hard to follow. With
this simplification, a lot of code duplication was removed and now both
functions look very similar.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 23:39:35 -03:00
Renato Westphal
33df4bb219 zebra: accept static v6 routes with non-existent nexthop interfaces
We don't need to enforce that the interface exists because the route can
be activated later once the interface becomes available. We already do
this for IPv4 routes and IPv6 routes with both a nexthop address and a
nexthop interface.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 23:39:27 -03:00
Renato Westphal
d97c792e9f zebra: remove redundant DEFUNs for labeled static routes
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 21:47:23 -03:00
Renato Westphal
8bcbf3b0d7 zebra: remove weird blackhole/reject ipv6 static routes
This is the v6 counterpart of commit 74d263466b.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 21:45:01 -03:00
Renato Westphal
2f8aa457e0 zebra: use curly braces for optional arguments of static routes
This way the optional arguments can be provided in any order.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 21:44:34 -03:00
Daniel Walton
1ac79ce8df zebra: static route cleanup
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

- The 'reject' keyword was being lost
- Hide the "ip route A.B.C.D A.B.C.D" config options since these will be
  displayed as "ip route A.B.C.D/X"
2017-07-25 13:24:45 -07:00
David Lamparter
9d303b37d7 Revert "*: reindent pt. 2"
This reverts commit c14777c6bf.

clang 5 is not widely available enough for people to indent with.  This
is particularly problematic when rebasing/adjusting branches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22 14:52:33 +02:00
whitespace / reindent
c14777c6bf
*: reindent pt. 2
w/ clang 5

* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
2017-07-17 15:26:02 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
Donald Sharp
2850f0ea58 bgpd, zebra: Cleanup warnings from new code
1) Clean up VTY_NEWLINE -> \n
2) Remove usages of VTY_GET_INTEGER

Signed-off-by: Donald Sharp
2017-07-14 08:52:45 -04:00
Donald Sharp
1ea6b3f237 Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attr 2017-07-14 08:24:46 -04:00
Donald Sharp
da571b7a6c Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attr 2017-07-14 08:11:05 -04:00
Russ White
28bd1c1158 Merge pull request #813 from opensourcerouting/newline-redux
newline redux
2017-07-14 08:00:43 -04:00
Donald Sharp
eef83e96f7 Merge pull request #762 from bingen/mutiple_nh_recursive_levels
Allow for more than 1 NH recursion level
2017-07-14 07:44:02 -04:00
David Lamparter
2d8270596a Merge remote-tracking branch 'frr/master' into newline-redux
Lots of conflicts from CMD_WARNING_CONFIG_FAILED...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 13:07:30 +02:00
David Lamparter
55f70b671f *: remove VTYNL, part 4 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
61b7d449bd *: remove VTYNL, part 3 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
26a429fe8e *: remove VTYNL, part 2 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
David Lamparter
6d3c2ed4ed *: remove VTYNL, part 1 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
Daniel Walton
f1a05de982 vtysh: return non-zero for configuration failures
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

This allows frr-reload.py (or anything else that scripts via vtysh)
to know if the vtysh command worked or hit an error.
2017-07-13 19:56:08 +00:00
David Lamparter
5c7571d43f *: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13 20:29:22 +02:00
vivek
cec2e17d27 zebra: EVPN/VxLAN UI definitions and handling
Implement various UI (vty) commands for EVPN/VxLAN.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12 12:29:27 -04:00
Christian Franke
e3054ee94f zebra: prettier format for multilevel-recursive routes
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-07-12 18:28:40 +02:00
ßingen
62b3c03f53 Avoid to make indentation even worse 2017-07-10 22:52:16 +02:00
ßingen
8e688dbd58 Rename ALL_NEXTHOPS_RO to ALL_NEXTHOPS 2017-07-10 21:14:59 +02:00
Daniel Walton
dfd8121281 Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3
Conflicts:
	bgpd/bgp_route.c
	bgpd/bgp_zebra.c
2017-07-10 13:06:19 +00:00
Daniel Walton
dd6bd0f16d bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-05 20:46:48 +00:00
Quentin Young
7111c1a0cd
*: fix excess docstring
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05 15:33:00 -04:00
Quentin Young
e31b6333f4 *: vty_outln (vty, "") --> vty_out (vty, VTYNL)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:56 +00:00
Quentin Young
1318e7c841 *: s/VTY_NEWLINE/VTYNL/g
Should be able to fit more vty_out onto one line now

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:54 +00:00
Quentin Young
96ade3ed77 *: use vty_outln
Saves 400 lines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:31:28 +00:00
Russ White
0bc44f61c9 Merge pull request #754 from qlyoung/fix-argv-arg
use argv->text where appropriate
2017-06-29 11:06:15 -04:00
Jafar Al-Gharaibeh
0eef52fd95 Merge pull request #759 from qlyoung/remove-vty-argparsers
*: remove VTY_GET_*
2017-06-29 09:36:06 -05:00
Donald Sharp
b440fe5c82 Merge remote-tracking branch 'origin/stable/3.0' 2017-06-29 10:10:15 -04:00
ßingen
f9e1b38e1a Allow for more than 1 NH recursion level
Before, only one level of recursive resolution was supported.

Signed-off-by: ßingen <bingen@voltanet.io>
2017-06-28 21:32:18 +02:00
Quentin Young
facfee22f5 *: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.

spatch follows
----------------

@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>

@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>

@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>

@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 19:04:41 +00:00
Quentin Young
7e045c3d42 *: use ->text and strmatch where appropriate
Still need to go fix all the places where we do a 1-char strncmp...

spatch follows
------------------

@asdf@
expression idx;
@@
<...
 strcmp (
- argv[idx]->arg,
+ argv[idx]->text,
  ...)
...>

@depends on asdf@
expression idx;
@@
<...
- !strcmp (argv[idx]->text,
+ strmatch (argv[idx]->text,
           ...)
...>

@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) == 0
+ strmatch (argv[idx]->text, arg)
...>

@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) != 0
+ !strmatch (argv[idx]->text, arg)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 17:46:42 +00:00
Christian Franke
59b28c4523 zebra: fix ipv6 route command description strings
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-06-14 09:23:40 +02:00
Christian Franke
2664233e71 zebra: pass srcdest information also when creating blackhole routes
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-06-14 09:23:36 +02:00
David Lamparter
e885ed85bb Merge pull request #624 "Babel"
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-13 16:11:32 +02:00
David Lamparter
97bd5c48de Merge remote-tracking branch 'frr/master' into pull-624 2017-06-13 09:18:14 +02:00
Donald Sharp
d722f26e09 zebra: Fix memory leak
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-10 16:39:41 -04:00
Donald Sharp
6201488ab3 zebra: Fix possible buffer overrun
Use the correct size of the string.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-10 15:42:13 -04:00
Quentin Young
31c6fa450a zebra: remove extraneous help string
caused tag to display null0 helpstr

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-04 21:01:52 +00:00
Renato Westphal
e91163e78c Merge pull request #647 from qlyoung/zebra-mpls-error-messages
zebra: more informative error messages & help strings for mpls labels
2017-06-02 22:53:53 -03:00
Donald Sharp
f0f77c9a59 zebra: Refactor 'struct rib' to be 'struct route_entry'
The 'struct rib' data structure is missnamed.  It really
is a 'struct route_entry' as part of the 'struct route_node'.
We have 1 'struct route_entry' per route src.  As such
1 route node can have multiple route entries if multiple
protocols attempt to install the same route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-01 08:00:05 -04:00
Quentin Young
6feb1a21af zebra: define mpls label helpstr
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-31 21:50:20 +00:00
Quentin Young
8062bf1c6b zebra: more informative error messages for mpls labels
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-31 21:31:55 +00:00
Donald Sharp
241a2f5603 zebra: Fix 'show ip route babel'...
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-30 14:05:46 -04:00
Daniel Walton
acb25e73f4 zebra: one "show ip route" to rule them all
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-05-22 19:56:11 +00:00
Renato Westphal
e89f016d3e Merge pull request #561 from donaldsharp/static_config2
Static config2
2017-05-17 14:18:51 -03:00
Donald Sharp
9de498ecad zebra: Consolidate static_config_ipv[4|6] into one function.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-17 07:51:19 -04:00
David Lamparter
896014f4bc *: make consistent & update GPLv2 file headers
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>
2017-05-15 16:37:41 +02:00
Renato Westphal
05910d5938 Merge pull request #495 from donaldsharp/mpls_fixes
Mpls fixes
2017-05-12 12:23:52 -03:00
Christian Franke
4d345ab695 zebra: add 'show ipv6 fib' command
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-05-11 00:31:57 +02:00
Christian Franke
87a8896290 zebra: add 'show ip fib' commands
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-05-11 00:31:57 +02:00
Daniel Walton
4caac24b23 zebra: lsp_install() failed due to ZEBRA_FLAG_SELECTED check
ZEBRA_FLAG_SELECTED hasn't been set yet by the time lsp_install is
called.  The call path is:
rib_process -> rib_process_add_fib -> zebra_mpls_lsp_install -> lsp_install

but ZEBRA_FLAG_SELECTED is set in rib_process after it calls
rib_process_add_fib.  I can't think of anything that it would hurt to
install the LSP regardless of whether ZEBRA_FLAG_SELECTED is set later.

I also cleaned up some UI (json and display the pretty label names
instead of their numeric values).

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-05-10 10:06:47 -04:00
Renato Westphal
313605cb92 *: fix a bunch of segfaults detected by a CLI fuzzer
This patch fixes the following segfaults:
zebra aborted: vtysh -c "show ipv6 mroute"
zebra aborted: vtysh -c "configure terminal" -c "debug zebra kernel msgdump"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no packet-loss"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no metric"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no ava-bw"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no res-bw"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no use-bw"
ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "area 1.1.1.1 nssa"
ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "area 4294967295 nssa"
pimd aborted: vtysh -c "show ip msdp sa 1.1.1.1"
pimd aborted: vtysh -c "configure terminal" -c "ip ssmpingd"
pimd aborted: vtysh -c "configure terminal" -c "no ip ssmpingd"
pimd aborted: vtysh -c "configure terminal" -c "no ip msdp mesh-group WORD source"
pimd aborted: vtysh -c "configure terminal" -c "interface eth99" -c "ip pim hello 180"
bgpd aborted: vtysh -c "show bgp l2vpn evpn rd 1:1"
bgpd aborted: vtysh -c "clear vnc nve un *"
bgpd aborted: vtysh -c "clear vnc nve un 1.1.1.1"
bgpd aborted: vtysh -c "clear vnc nve un 2001:db8::1"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 cost 255 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 cost 255"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 cost 255 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 cost 255"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 cost 255 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 cost 255"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 cost 255 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 cost 255"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp ipv4 prefix-list NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp ipv6 prefix-list NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp route-map NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra ipv4 prefix-list NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra ipv6 prefix-list NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra route-map NAME"
bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "no set ipv6 vpn next-hop"
bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "set vpnv4 next-hop"
bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "set vpnv6 next-hop"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "address-family ipv6 vpn" -c "network 2001:db8::1/128 rd 1:1 tag WORD"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "address-family vpnv6 unicast" -c "network 2001:db8::1/128 rd 1:1 tag WORD"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "no neighbor WORD shutdown message MSG..."
bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "neighbor WORD shutdown message MSG..."

More to come later.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-05-04 14:39:58 -03:00
Renato Westphal
10dad4242a zebra: fix v4/v6 typos in some show commands
This fixes a few problems like this one:
vtysh# show ipv6 route ospf6
Unknown route type

Also, replace SAFI_UNICAST with SAFI_MULTICAST in the "show ipv6 mroute
vrf all" command.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-03 22:24:42 -03:00
Donald Sharp
17d990c1d3 zebra: Fix non-Null Terminated help string
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15 10:45:13 -04:00
Donald Sharp
baaea325e6 *: Refactor ifindex2ifname to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15 10:43:21 -04:00
Donald Sharp
1306c09a1b *: Refactor if_lookup_by_name to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15 10:36:23 -04:00
David Lamparter
4487fc74e8 *: fix some user-visible Quagga remnants
(Note: the allow_delete thing is called "zebra" on the commandline
because that's the clearest context there, while it is called "FRR" in
the CLI because that's considerably less confusing in a vtysh env.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 16:15:10 +01:00
Timo Teräs
2fb975da77 nhrpd: implement next hop resolution protocol
This provides DMVPN support and integrates to strongSwan. Please read
README.nhrpd and README.kernel for more details.

[DL: cherry-picked from dafa05e65fe4b3b3ed5525443f554215ba14f42c]
[DL: merge partially resolved, this commit will not build.]
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-07 16:20:29 +01:00
Christian Franke
c423229b54 zebra: support static srcdest routes
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-01-30 13:54:46 +01:00
Christian Franke
0573778371 zebra: add srcdest support to rib
Add srcdest support to the zebra rib and to the kernel
and redistribution interfaces.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-01-30 13:54:46 +01:00
Donald Sharp
40d1cbfbb3 *: 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>
2017-01-27 15:52:12 -05:00
Donald Sharp
4b2792b53b zebra: Cleanup zebra_static CLANG/SA issues.
When compiling using CLANG's SA, cleanup the
SA issues found.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-17 18:45:02 -05:00
Donald Sharp
1d666fcb50 zebra: Fix include order for build 2017-01-17 18:37:34 -05:00
David Lamparter
b6f1faf045 Merge branch 'stable/2.0-for-merge'
Conflicts (CLI vs. atol()):
- bgpd/bgp_vty.c
- ospfd/ospf_vty.c
- zebra/zebra_vty.c

NB: pull req #65 (LabNConsulting/working/2.0/afi-safi-vty/c) was
excluded from this merge.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-13 15:24:25 +01:00
Quentin Young
b84aadae44 Merge branch 'master' into fix-proto_redistnum 2017-01-06 19:44:46 -05:00
Donald Sharp
40bfb7248f Merge pull request #32 from qlyoung/fix-cli-nits2
bgpd, ospfd, zebra: remove duplicate cli installs
2017-01-06 19:38:28 -05:00
Donald Sharp
ec91182539 zebra: Allow tag values greater than 2 billion on arm
Due to the usage of atol, values that are larger than
2 billion on arm for tag are not converted correctly.

Ticket: CM-14099
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-06 12:37:44 -05:00
Donald Sharp
3b14d86eed Merge remote-tracking branch 'origin/stable/2.0' 2017-01-06 09:58:21 -05:00
Quentin Young
271ad8d53f bgpd, ospfd, zebra: remove duplicate cli installs
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-29 05:44:49 +00:00
David Lamparter
ab0181eed3 build: rename (2 of ?): route_types macros
All of the autogenerated macros in lib/route_types.pl are now called
FRR_* instead of QUAGGA_*.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 18:34:29 +01:00
Quentin Young
6d681bd874 all: use ->text when parsing protocol argument
and match on full protocol name in proto_redistnum()

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-16 05:39:44 +00:00
Renato Westphal
e5dd4bef5e zebra-mpls: fix regression caused by wrong conflict resolution
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-12-14 13:21:08 -05:00
Quentin Young
74d263466b zebra: Remove weird blackhole/reject static routes
Doesn't make sense to fully configure a static route and then
specify that it should be rejected. Remove & rename relevant
commands.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-14 08:26:37 -02:00
David Lamparter
04cb240868 Merge branch 'fixes/command'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-08 15:07:24 +01:00
Quentin Young
6fd800be4a Merge remote-tracking branch 'osr/master' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	lib/command_match.c
2016-12-06 19:51:33 +00:00
Christian Franke
6fa4ca0669 zebra: use correct cmd index for 'no ipv6 route' command
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-12-05 19:52:55 +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
Quentin Young
9973d18404 all: Replace "JavaScript Object Notation\n" with JSON_STR
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-29 23:26:03 +00:00
Quentin Young
3a2d747c2e all: Fix all underfull doc strings
Additionally:
* Add [ip] to a couple bgp show commands
* Quick refactor of a couple ISIS commands
* Quick refactor of a couple OSPF6 commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-29 23:07:11 +00:00
Renato Westphal
661512bf05 zebra/lib: remove redundant fields from zebra_vrf
There's no need to duplicate the 'vrf_id' and 'name' fields from the 'vrf'
structure into the 'zebra_vrf' structure. Instead of that, add a back
pointer in 'zebra_vrf' that should point to the associated 'vrf' structure.

Additionally, modify the vrf callbacks to pass the whole vrf structure
as a parameter. This allow us to make further simplifications in the code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 16:18:35 -02:00
Renato Westphal
05e8e11e54 lib/zebra: put vrf_get() on a diet
Also, for some reason we had two functions to search a VRF by its name:
zebra_vrf_lookup_by_name() and zebra_vrf_list_lookup_by_name().  The first
one would loop through vrf_table and the other one through vrf_list. This
is not necessary anymore, so remove zebra_vrf_lookup_by_name() and rename
zebra_vrf_list_lookup_by_name() to zebra_vrf_lookup_by_name().

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 16:18:35 -02:00
Renato Westphal
a62c490110 zebra: order VRFs by name on user output
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 16:18:35 -02:00
Renato Westphal
806f87607e lib/zebra: convert vrf_list to a red-black tree
Since we're already using a red-black tree to store VRFs sorted by their
vrf_id's, create a new tree to store VRFs sorted by their names.

The biggest advantage of doing this is that we reduce the time complexity
of vrf_list_lookup_by_name() from O(n) to O(log n).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 16:18:35 -02:00
Renato Westphal
1a1a70655c lib: convert vrf code to use red-black trees as well
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 16:18:35 -02:00