Commit Graph

639 Commits

Author SHA1 Message Date
Don Slice
bbde7a0f25 zebra: fix nexthop type check for kernel default route display
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-07-18 13:05:50 +00:00
Don Slice
fc132690b4 zebra: remove default vrf output for kernel vrf ipv6 blackhole default
It was reported that "show ipv6 route vrf <vrfname>", "show ipv6 route
vrf <vrfname> ::/0 " or "show ipv6 route vrf <vrfname> json" all
displayed that the nexthop was in the default vrf.  This was because
the kernel netlink messages would supply the RTA_OIF of the loopback
interface for the kernel-created default route for the vrf, where ipv4
did not supply any RTA_OIF.  This fix suppresses the display if the
nexthop and route entry are in different vrfs and the nexthop is
NEXTHOP_TYPE_BLACKHOLE.

Ticket: CM-21722
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-07-17 14:35:33 +00:00
Chirag Shah
62710e2b33 zebra: Hide default vrf instance of l3vni cmd
Hide following l3vni config from DEFAULT_VRF instance
until it is fully supported.

TORS1(config)# vni 2222456 prefix-routes-only

Ticket:CM-20572

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-06-15 15:42:20 -07:00
paco
77e03f0511 zebra: resource leak fix (Coverity 1465679)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-08 18:51:43 +02:00
Russ White
49eeb60a70
Merge pull request #2123 from qlyoung/zserv-mt
Multithreaded Zserv
2018-06-08 06:47:14 -04:00
Philippe Guibert
00384b5fbd zebra: keep one command to handle vty with/without table param
That fix is a workaround from a vtysh limitation.
Because table identifier should be accessible in configuration only for
vrf netns backends, there was a need to differentiate the vty commands.
Unfortunately, vtysh parses the two commands without knowing which
command has really been installed.
Using one single vty command will avoid having this issue in vtysh.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
b73823efa1 zebra: add in show vrf information about vrf backend kind
By default, nothing is displayed. If vrf backend is linux network
namespaces, then "netns-based vrfs" is displayed, before dumping the
list of VRFs.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
87d6ac7a04 zebra: add show ip route table vrf command
It is possible to get table per VRF, provided that vrf backend is
configured with NETNS.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
e9748a8901 zebra: table_id election with the vrf backend
As table_id for VRF with netns backend is main table ( RT_TABLE_MAIN or
zebrad.rtm_table_default), this makes possible to return the table id
that wants to be configured for those cases. ( in addition to default
VRF). In other cases ( VRF Lite presumably), then vrf table_id is
returned.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
b3b086026b zebra: add table keyword to route configuration vty command
Add the table keyword for all ip route/ip mroute/ipv6 route commands
that are available. Also, the main structure is being added a table
identifier.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Quentin Young
ccd51bd210 zebra: misc fixes, perf improvements
* Coalesce multiple write() syscalls into one
* Write larger chunks
* Decrease default read limit to 1000
* Remove unnecessary operations from hot loop (zserv_write)
* Move cross-schedule out of obuf lock
* Use atomic ops to update atomic variable

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Philippe Guibert
586f4ccf2c zebra: pbr vty show command for ipset and iptables
Two new vty show functions available:
show pbr ipset <NAME>
show pbr iptables <NAME>

Those function dump the underlying "kernel" contexts. It relies on the
zebra pbr contexts. This helps then to know which zebra pbr
context has been configured since those contexts are mainly configured
by BGP Flowspec.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Mitesh Kanjariya
cf29971433 zebra: vni [prefix-routes-only] should also be provided for the 'no' cmd
We have a command to enable symmetric routing only for type-5 routes.
This command is provided under vrf <> option in zebra as follows:
vrf <VRF>
  vni <VNI> [prefix-routes-only]
We need the corresponding no version of the command as well as follows:
vrf <VRF>
  no vni <VNI> [prefix-routes-only]

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Donald Sharp
f03098f979 zebra: Add a few more breadcrumbs
re->status and re->flags both influence our decision states
for rib processing.  Yet it's impossible to see them.  Add
a tiny bit of code to allow us to look at them when things
are not behaving like we would expect.

Additionally dump the nexthop->flags at the same time for
the same reasons.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-02 16:50:37 -04:00
Donald Sharp
d5ab760b34 zebra: Leave some warning breadcrumbs
When a user specifies static routes, there are a couple of states
where we will store the route and display it as part of the 'show run'
but it will not be installed until such time that the dependant state
is created.  Add some breadcrumbs to the user so that they can figure
out WTF just happened.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 14:04:47 -04:00
Renato Westphal
15da01e92d
Merge pull request #1973 from donaldsharp/static_nh_vrf
Static nh vrf
2018-04-10 17:27:57 -03:00
Russ White
bb04824d89
Merge pull request #2027 from qlyoung/fix-vrf-static-holdem-display
zebra: display holdem statics correctly
2018-04-06 13:21:49 -04:00
Quentin Young
cd4b15a523
zebra: display holdem statics correctly
Holdem statics display the dest (and mask, if present) string that the
user entered instead of converting to CIDR notation and applying the
mask. They need to do the latter.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-05 11:02:07 -04:00
Quentin Young
d7ca637481
zebra: consistently order static route attributes
Everyone else displays them with nexthop-vrf last.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-04 15:23:36 -04:00
Donald Sharp
4c66767c10 zebra: Prevent crash in the off-chance we make a mistake
Prevent zebra from crashing for when the nexthop vrf has
changed in some manner and the lookup fails.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-27 15:52:26 -04:00
Donald Sharp
90f86c0a4d zebra: Fixup enable/disable of static routes in vrfs
When a user enables and disables a vrf, we were not
properly cleaning up the static routes leaving us
in a state where we would crash by looking at anything
in zebra.

On disable of a vrf -> Search through all static routes
and if the nexthop vrf is the disabled vrf uninstall it.
Additionally uninstall all static routes in that zvrf

On enable of a vrf -> Search through all static routes
and if the nexthop vrf is the enabled vrf install it.
Additionally install all the static routes in that zvrf.

Ticket: CM-19768
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-27 15:52:25 -04:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Quentin Young
b88689f2a7
zebra: fix config of vrf static routes
This patch fixes two bugs with respect to static route configuration
inside vrf contexts:

* Entering a negative form of a static route created the static route.
* Once created, static routes could not be deleted.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-21 16:47:46 -04:00
Donald Sharp
6e94d41057 zebra: Fix comparison to not look at itself
The nexthop vrf comparison should not be against itself

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-20 19:16:24 -04:00
Donald Sharp
af5849b662 zebra: Fix memory leak on re-enter case
When we have a case where the user re-enters the same
ip route line, we need to delete the memory we just
malloc'ed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-20 18:41:00 -04:00
Quentin Young
be627102c0
zebra: fix static route config write
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-19 17:37:00 -04:00
Donald Sharp
6a17b1a0f2 zebra: Extend unknown vrf to vrf part of ip route
When specifying a ip route:

ip route 4.3.2.0/24 192.168.201.1 vrf DONNA

Accept DONNA even if it has not been created yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-16 18:45:29 -04:00
Donald Sharp
ad97d1c10a zebra: Allow duplicate entry of a route
If a user enters a route inside a non kernel existant vrf:

vrf BLOOP
  ip route 4.3.2.0/24 192.168.201.1
!

They should be able to enter it over and over and over and
over and over no matter how futile it is.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-16 18:38:25 -04:00
Donald Sharp
e7f96f7411 zebra: Auto create the nexthop-vrf if needed.
Currently if I try to use a nexthop-vrf that has
not been specified yet we get a failure from the cli.

Add code to zebra so that if we fail to find the nexthop-vrf
we auto create it, instead of failing the install.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-16 18:36:10 -04:00
Renato Westphal
f22ab4c3fc
Merge pull request #1819 from donaldsharp/static_stuff
Static stuff
2018-03-14 11:26:20 -03:00
Donald Sharp
7ee30f288e lib: Isolate nexthop_group functions to nexthop_group.c
Also modify `struct route_entry` to use nexthop_groups.
Move ALL_NEXTHOPS loop to nexthop_group.h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-09 11:07:41 -05:00
Donald Sharp
4060008bda zebra: Allow for storage of non-configed vrf routes
When zebra is being configed we allow for static routes
to be entered.  This presents a problem for when a vrf
is cli configed but not kernel configed yet.

Modify zebra to notice that when a static route is
entered and either the nexthop vrf or the vrf
is not fully configed, to save that config to the
side.

When vrf's become active( kernel configed ) parse
through the list of saved to the side static routes
and determine if any of them can be installed.

Additionally modify the cli to output the saved
to the side cli, so that we can properly handle
a wr mem.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-07 14:33:59 -05:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Philippe Guibert
81c9005ff6 zebra: enhance show vrf for netns and fixing
Show vrf command displays information on the vrf, if it is related to
vrf kernel or if it is related to netns.
When a vrf from kernel is detected, before creating a new vrf, a check
is done against an already present vrf, and if that vrf is not a vrf
mapped with a netns. If that is that case, then the creation is
rejected.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-02-27 11:11:24 +01:00
Philippe Guibert
ac3133a35d
Merge pull request #1736 from mkanjari/type5-with-asymm
zebra, bgp: Support type-5 routes with asymmetric routing
2018-02-27 10:36:57 +01:00
Donald Sharp
ae825b8bf0 zebra: Add code to display interesting tables
With the ability of zebra to handle random tables,
add code to display those tables via the
show <ip|ipv6> route table (1-...) [json] command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-23 07:08:36 -05:00
Donald Sharp
6447dbb372 zebra: Clean up some SA issues found by new code
1) Add asserts in a couple of spots to show we
never expect prefix to be bad.
2) Fix some bfd code where out_ctxt will
always be NULL.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-13 23:41:31 -05:00
Mitesh Kanjariya
c48d9f5f85 zebra, bgp: Support type-5 routes with asymmetric routing
Asymmetric routing is an ideal choice when all VLANs are cfged on all leafs.
It simplifies the routing configuration and
eliminates potential need for advertising subnet routes.
However, we need to reach the Internet or global destinations
or to do subnet-based routing between PODs or DCs.
This requires EVPN type-5 routes but those routes require L3 VNI configuration.

This task is to support EVPN type-5 routes for prefix-based routing in
conjunction with asymmetric routing within the POD/DC.
It is done by providing an option to use the L3 VNI only for prefix routes,
so that type-2 routes (host routes) will only use the L2 VNI.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-10 00:41:28 -08:00
Renato Westphal
a97e5c1a80
Merge pull request #1722 from donaldsharp/vrf_mc_vrf
zebra: Fix vrf routes from assuming their nh's were in the default
2018-02-09 20:54:17 -02:00
Donald Sharp
70e98a7fe7 *: Make code use a consisten definition of labels
Turns out we had 3 different ways to define labels
all of them overlapping with the same meanings.
Consolidate to 1.  This one choosen is consistent
naming wise with what the *bsd and linux kernels
use.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08 20:31:37 -05:00
Donald Sharp
4a7371e9e2 *: Track vrfs per nexthop not per route entry
Track the vfrs on a per nexthop basis instead
of on a per route entry basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08 19:35:53 -05:00
Philippe Guibert
8e71b98f72
Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancements
Evpn symmetric routing enhancements
2018-02-08 11:46:29 +01:00
Donald Sharp
dfce9b257d zebra: Fix vrf routes from assuming their nh's were in the default
Fix the read in of vrf routes on a start or restart that caused
the nexthop_vrf to be assumed to be the default vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-07 18:22:15 -05:00
Donald Sharp
2481e73221 zebra: Fix v6 nexthop-vrf and nexthop confusion
The v6 code had the same issue with how it handled
nexthop-vrf and nexthop when it was entered on the
same line.  This fixes that issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-30 00:15:45 -05:00
Donald Sharp
e65dfe7e56 zebra: Cleanup error handling of nexthop vrf and vrf
The error handling of the nexthop vrf and the vrf
for what was specified on the cli was not as clean
as it should have been.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-29 15:18:28 -05:00
Donald Sharp
e6149ab4b8 zebra: Fix to get correct nexthop-vrf
The nexthop_vrf should be looked up as appropriate,
If the nexthop_vrf was specified use that, else
use the vrf context of what was passed in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-27 05:28:51 -05:00
vivek
22bd3e9497 *: Refine the notion of a configured VRF in FRR
Refine the notion of what FRR considers as "configured" VRF. It is no longer
based on user just typing "vrf FOO" but when something is actually configured
against that VRF. Right now, in zebra, the only configuration against a VRF
are static IP routes and EVPN L3 VNI. Whenever a configuration is removed,
check and clear the "configured" flag if there is no other configuration for
this VRF. When user attempts to configure a static route and the VRF doesn't
exist, a VRF is created; the VRF is only active when also defined in the
kernel.

Updates: 8b73ea7bd479030418ca06eef59d0648d913b620
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>

Ticket: CM-10139, CM-18553
Reviewed By: CCR-7019
Testing Done:
1. Manual testing for L3 VNI and static routes - FRR restart, networking
restart etc.
2. 'vrf' smoke

<DETAILED DESCRIPTION (REPLACE)>
2018-01-23 18:49:40 -08:00
mitesh
317f1fe02f zebra/bgpd: fix compilation issues
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 16:30:40 -08:00
Mitesh Kanjariya
4cce389e0e bgpd/zebra: show command enhancements for EVPN symmetric routing
0. move all global EVPN details to 'show evpn [json]' command
1. change "VRF" to "Tenant VRF" in 'show evpn vni'
2. change 'show vrf vni' command to tabular form
   and add l3-vni related params to the output
3. show evpn rmac should show refcount only in detailed output
4. show evpn next-hop should show refcount only in detailed output
5. move VRF in 'show evpn l3vni' to the end
6. add num rmacs and num nexthops to show evpn l3vni
7. remove "info" from 'show bgp vrf <> l3vni info'
8. show evpn vni <vni> should show l2vni details or l3 vni details
9. show evpn vni should show both L2 and L3 VNIs
10. show bgp l2vpn evpn - shows all global bgp l2vpn evpn details
11. show bgp l2vpn evpn vni - will show both l2 and l3 vnis
12. show bgp l2vpn evpn vni - should show both l2 and l3 vnis
13. follow camel notation for all json keys

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Mitesh Kanjariya
e8d26197fa bgpd: vrf/vni mapping command for default instance
Ticket: CM-18906
Review: CCR-6946
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Philippe Guibert
d6fed38109
Merge pull request #1618 from donaldsharp/zebra_startup_ordering
zebra route-leaking for static routes
2018-01-23 08:25:01 +01:00
Philippe Guibert
90ac32c209 zebra: replace 0 value on zebra with VRF_DEFAULT
On some places of code, the VRF_DEFAULT define was not used. This commit
is ensuring that the macros is well used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-01-22 14:58:02 +01:00
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
Renato Westphal
51bdc5f85c zebra: nuke zvrf_list and always use vrf_list instead
zvrf_list doesn't need to exist, it's basically a duplicate version
of vrf_list.

Also, zebra_vrf_delete() wasn't removing zvrf from zvrf_list, which was
a bug.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 16:18:35 -02:00
Quentin Young
d7fa34c1bc all: Fix underfull doc strings, part 2
Add missing docstrings and separating \n.
Also eat some low-hanging refactoring fruit.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-08 01:46:04 +00:00
Quentin Young
d64ff607e8 Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	ospfd/ospf_ri.c
	zebra/zebra_vty.c
2016-10-25 20:29:52 +00:00
Quentin Young
e9e190f245 Merge branch 'cmaster-next' into vtysh-grammar
Conflicts:
	vtysh/vtysh.c
	zebra/zebra_vty.c
2016-10-25 19:38:04 +00:00
Donald Sharp
4f4caaa139 zebra: Allow v6 static routes to handle mpls not in kernel
When configuring v6 static routes, allow it to gracefully
ignore mpls commands when mpls is not turned on in the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-25 14:45:49 -04:00
Donald Sharp
c58418c110 zebra: Disable mpls slightly different
When mpls is not turned on in the kernel, we
are not installing the mpls commands into the cli.
This results in vtysh attempting to run the command
and receiving a 'WTF is this command' back from zebra.
Modify the mpls code to install commands and to check
to see if the command should be accepted based
upon mpls working or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-10-25 14:30:25 -04:00
Donald Sharp
882261e18b Merge remote-tracking branch 'origin/cmaster' into cmaster-next 2016-10-21 16:05:03 -04:00
Quentin Young
e52702f29d Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	bgpd/bgp_route.c
	bgpd/bgp_routemap.c
	bgpd/bgp_vty.c
	isisd/isis_redist.c
	isisd/isis_routemap.c
	isisd/isis_vty.c
	isisd/isisd.c
	lib/command.c
	lib/distribute.c
	lib/if.c
	lib/keychain.c
	lib/routemap.c
	lib/routemap.h
	ospf6d/ospf6_asbr.c
	ospf6d/ospf6_interface.c
	ospf6d/ospf6_neighbor.c
	ospf6d/ospf6_top.c
	ospf6d/ospf6_zebra.c
	ospf6d/ospf6d.c
	ospfd/ospf_routemap.c
	ospfd/ospf_vty.c
	ripd/rip_routemap.c
	ripngd/ripng_routemap.c
	vtysh/extract.pl.in
	vtysh/vtysh.c
	zebra/interface.c
	zebra/irdp_interface.c
	zebra/rt_netlink.c
	zebra/rtadv.c
	zebra/test_main.c
	zebra/zebra_routemap.c
	zebra/zebra_vty.c
2016-10-17 23:36:21 +00:00
Donald Sharp
0b1442e37b *: Consolidate all double VIEW_NODE and ENABLE_NODE's
If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well.  This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
Christian Franke
dc9ffce878 *: Consistently support 32-bit route tags
This patch improves zebra,ripd,ripngd,ospfd and bgpd so that they can
make use of 32-bit route tags in the case of zebra,ospf,bgp or 16-bit
route-tags in the case of ripd,ripngd.

It is based on the following patch:

    commit d25764028829a3a30cdbabe85f32408a63cccadf
    Author: Paul Jakma <paul.jakma@hpe.com>
    Date:   Fri Jul 1 14:23:45 2016 +0100

    *: Widen width of Zserv routing tag field.

But also contains the changes which make this actually useful for all
the daemons.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-10-07 21:05:05 -04:00
Don Slice
61a091c544 zebra: add support for ipv6 static to null0
Added the capability of defining an ipv6 static route to null0,
similar to the support previously in ipv4 only.

Ticket: CM-5794
Signed-off-by: Don Slice
Reviewed By: CCR-5223
Testing Done: Manual tested added to the ticket and bgp and ospf smoke
successfully completed
2016-10-06 13:58:30 -07:00
Quentin Young
3c2caef9fd zebra: Fix static route helper function
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-06 04:08:34 +00:00
Quentin Young
12dcf78e0b all: Fix various syntax errors
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-04 19:21:45 +00:00
Timo Teräs
446bb95e0f zebra: support FIB override routes
FIB override routes are for routing protocols that establish
shortcut routes, or establish point-to-point routes that should
not be redistributed. Namely this is useful NHRP daemon to come.

Zebra is extended to select two entries from RIB the "best" entry
from routing protocols, and the FIB entry to install to kernel.
FIB override routes are never selected as best entry, and thus
are never adverticed to other routing daemons. The best FIB
override, or if it does not exist the otherwise best RIB is
selected as FIB entry to be installed.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[CF: Massage to fit cumulus tree]
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-09-30 12:22:01 -04:00
Daniel Walton
6de69f8305 all: added some missing <>s within []s
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 15:31:48 +00:00
Daniel Walton
58749582a9 all: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 00:16:31 +00:00
Daniel Walton
00d7d2d345 bgpd and zebra: scrubbed argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-29 18:21:36 +00:00
Daniel Walton
67656e9b65 all: added CHECK ME for DEFUNs that look at argc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-29 17:48:57 +00:00
Daniel Walton
2aac576795 use JSON_C_TO_STRING_PRETTY for json_object_to_json_string
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-28 04:52:36 +00:00
Quentin Young
b62ecea584 zebra: finish all zebra CHECK ME's
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-28 04:47:43 +00:00
Daniel Walton
e961923c72 bgpd, etc: changed .LINE to LINE...
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-27 00:07:46 +00:00
Donald Sharp
5bebf56884 zebra: Put back missing code
When pulling forward the zebra_vty.c changes I accidently dropped
these changes from earlier commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-26 18:29:04 -04:00
Donald Sharp
28dadafced zebra: Refactor 'no ipv6 route XXXX' for new cli
Refactor the 'no ipv6 route XXXX' commands to
work under the new cli and to collapse the code
to a much smaller set.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-26 18:29:04 -04:00
Donald Sharp
96121d19fa zebra: Refactor 'ipv6 route XXXX' for new cli
Take existing code for 'ipv6 route XXX' and
refactor to use the new cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-26 18:29:04 -04:00
Donald Sharp
fb5b479d9d zebra: Fixup 'no ip route....'
Rework the 'no ip route XXXX' commands to use the new cli
and collapse all DEFUN's that we could into a much smaller
set of commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-26 18:29:04 -04:00
Donald Sharp
030721b7ef zebra: Refactore "ip route XXXXXX" commands
Convert all 'ip route XXXX' commands to use the new syntax and
collapse all functions that we can easily do.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-26 18:29:04 -04:00
Daniel Walton
3ce54f7812 Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>
Reviewed-by:   Sam Tannous <stannous@cumulusnetworks.com>

Ticket:
2016-09-25 14:22:48 +00:00
Daniel Walton
9ccf14f739 Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-25 14:10:48 +00:00
Daniel Walton
412e5cd94f lib: added strmatch()
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 22:12:11 +00:00
Daniel Walton
9bf96c846d zebra: zebra_vty.c compiles
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 21:17:10 +00:00
Daniel Walton
7c022376c8 zebra: add 'int idx_foo' argv index variables
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 19:26:31 +00:00
Daniel Walton
0a3e73dd27 zebra: fix vrf argv index numbers
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 17:22:42 +00:00
Donald Sharp
510dc06033 Revert "zebra: support FIB override routes"
This reverts commit 7569ae8bb7.
2016-09-23 12:11:00 -04:00
Daniel Walton
0c515adf43 zebra: compress multiple whitespaces in command string
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 14:02:55 +00:00
Timo Teräs
7569ae8bb7 zebra: support FIB override routes
FIB override routes are for routing protocols that establish
shortcut routes, or establish point-to-point routes that should
not be redistributed. Namely this is useful NHRP daemon to come.

Zebra is extended to select two entries from RIB the "best" entry
from routing protocols, and the FIB entry to install to kernel.
FIB override routes are never selected as best entry, and thus
are never adverticed to other routing daemons. The best FIB
override, or if it does not exist the otherwise best RIB is
selected as FIB entry to be installed.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[CF: Massage to fit cumulus tree]
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-09-23 09:51:57 -04:00
Daniel Walton
6147e2c694 convert <1-255> to (1-255), ()s to <>s, etc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 13:47:20 +00:00
Renato Westphal
41675b4c5e zebra: install MPLS CLI commands only if MPLS is enabled.
To keep things simple, zebra's code should be the same whether MPLS
is enabled or not. Then, when MPLS is not enabled, we just disable all
MPLS CLI commands. This way we don't need to add a lot of #ifdef cruft
in zebra's core, improving code readability.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:20 -04:00
Renato Westphal
1c1cf002a1 MPLS: ignore hardware restrictions when --enable-cumulus is not given.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:19 -04:00
Renato Westphal
17d38ab79a MPLS: add support for labeled IPv6 static routes.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:18 -04:00
vivek
c0f4be83a1 MPLS: Install labeled static routes
This patch installs labeled static routes in the FIB. The routes are installed
using the RTA_ENCAP (and RTA_ENCAP_TYPE) nested attributes.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-6040
Reviewed By: CCR-3091
Testing Done: Tested in SE-1, brief manual testing now
2016-09-23 09:31:02 -04:00
vivek
a22f3f5dad MPLS: Configure static routes with labels in Quagga
Introduce ability to configure static routes with labels. Only supported for
IPv4.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-6040
Reviewed By: CCR-3090
Testing Done: Testing in SE-1
2016-09-23 09:31:01 -04:00
vivek
b78b820d46 MPLS: Display enhancements and JSON support
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Vivek Venkatraman <vivek@cumulusnetworks.com>

Ticket: CM-6712, CM-6713
Reviewed By: CCR-3206, CCR-3209
Testing Done: Manual
2016-09-23 09:31:00 -04:00
vivek
3ab18ff268 Quagga: Display MPLS label forwarding table
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-4084, ...
Reviewed By: CCR-3089
Testing Done: Manual
2016-09-23 09:30:57 -04:00
vivek
7758e3f313 Quagga: Static LSP configuration
Add support for statically configuring MPLS transit LSPs. This allows the
configuration of ILM to one or more NHLFE, as defined in RFC 3031. The
currently supported nexthop types are IPv4 or IPv6.

The two label operations supported are swap and PHP; the latter is configured
by specifying the out-label as "implicit-null". Note that the operation is
against the label, so it should be the same for all NHLFEs.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-4804, ...
Reviewed By: CCR-3085
Testing Done: In combination with other patches
2016-09-23 09:30:54 -04:00
Daniel Walton
b162fa7858 Change {json} to [json]
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 11:39:50 +00:00
Daniel Walton
f412b39a33 ALIAS removal for bgp, ospf, pim, isis, rip, ripng, lib and zebra
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 03:55:26 +00:00
Daniel Walton
8b3f067710 zebra: argv update for all but zebra_vty.c
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-22 20:00:23 +00:00
Daniel Walton
ed5c254baf Revert "zebra: Fixup to use the new parser"
This reverts commit 5c94274ff7.
2016-09-22 18:21:59 +00:00
Donald Sharp
5c94274ff7 zebra: Fixup to use the new parser 2016-09-20 23:29:43 -04:00
David Lamparter
4a1ab8e405 *: split & distribute memtypes and stop (re|ab)using lib/ MTYPEs
This is a rather large mechanical commit that splits up the memory types
defined in lib/memtypes.c and distributes them into *_memory.[ch] files
in the individual daemons.

The zebra change is slightly annoying because there is no nice place to
put the #include "zebra_memory.h" statement.

bgpd, ospf6d, isisd and some tests were reusing MTYPEs defined in the
library for its own use.  This is bad practice and would break when the
memtype are made static.

Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[CF: rebased for cmaster-next]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-09-19 16:31:04 -04:00
Donald Sharp
f86a2b82fe zebra: Pass in vrf to rib_match_ipv4_multicast
Pass around the vrf_id to rib_match_ipv4_multicast
so that proper lookup can be maintained.  Not really
needed yet, but future fixing now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-14 15:34:25 -04:00
Daniel Walton
c80266bea2 json support for "show ip route" for "show ipv6 route"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-12633
(cherry picked from commit 18a4ded2a7)
2016-09-06 19:29:50 +00:00
Donald Sharp
3a3d00f1bd zebra: Refactor v4 and v6 static_add into 1 function
Refactor the static_add_ipv[4|6] functions into
1 function call.  They are basically doing the exact
same thing no need for separate code paths.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-01 07:20:18 -04:00
Donald Sharp
c7cfcb75e9 zebra: Refactor v4 and v6 static_delete
Refactor v4 and v6 static delete into 1 function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-01 07:20:18 -04:00
Donald Sharp
28f6dde859 zebra: Create zebra_static.[ch] to isolate code
Isolate the zebra static_XXX functions from zebra_rib.c
This is the first in a series of changes to clean up
the zebra code a bit more.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-01 07:20:02 -04:00
Daniel Walton
18a4ded2a7 json support for "show ip route" for "show ipv6 route"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-12633
2016-08-29 19:59:53 +00:00
Timo Teräs
c50ca33acf zebra: implement per-route mtu handling
This commits allow overriding MTU using netlink attributes on
per-route basis. This is useful for routing protocols that can
advertice prefix specific MTUs between routers (e.g. NHRP).

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
(cherry picked from commit b11f3b54c842117e22e2f5cf1561ea34eee8dfcc)
2016-08-21 13:11:42 -04:00
Don Slice
abbda2d481 zebra: resolved problem with show ip route vrf
Repaired damage done by commit upstream, which changed the way show_ip_route
is called to allow for multicast rpf table display.  Matched the technique of
the other callers to the new function.

Ticket: CM-11345
Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing and vrf-min
2016-06-27 08:31:57 -07:00
Timo Teräs
196aecefeb zebra/vty: use prefix2str and unify show ip/ipv6 route code
Use prefix2str where possible. As now ip/ipv6 are practically
identical, they are merged removing unneeded code duplication.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 53a5c39c705f917567d5b1764f1fe12ad5c5e577)
2016-06-09 08:56:48 -04:00
Donald Sharp
54fec4d508 zebra: Remove experimental warning
Remove the pimd experimental warnings that are being
displayed for some commands.

Ticket: CM-6128
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-06-01 11:44:16 -04:00
David Lamparter
7d20b83094 zebra: don't print uninitialized string (3b02fe8)
This crept in as part of the MRIB improvements and I missed the compiler
warning between other noise.  Unfortunately, printing an uninitialised
variable can in fact make zebra crash, so this is not trivial.

Fixes: 3b02fe8 ("zebra: add "show ip rpf" to get result of RPF lookup")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25 20:38:34 -04:00
Donald Sharp
63828c83f8 Removal of 'show ip mroute'
The 'show ip mroute' in zebra_vty.c collided with the
'show ip mroute' command in pim_cmd.c.  The 'show ip rpf'
command is functionally equivalent to the zebra_vty.c
'show ip mroute'.  Therefore remove the 'show ip mroute' command
in zebra_vty.c.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25 20:38:32 -04:00
David Lamparter
0b0668e619 zebra: mark multicast commands experimental
depending on feedback from actually having these commands in a released
version, we may want to adjust them.  Thus, mark them as experimental so
users are aware of this.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25 20:38:31 -04:00
David Lamparter
65dd94cffe zebra: add "show ip rpf" to get result of RPF lookup
Checking what route exactly a RPF lookup for a given source uses is
essential for an administrator to debug multicast routing issues.  This
command provides exactly that, using the multicst RPF lookup function
and printing out its result to the CLI.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25 20:38:31 -04:00
David Lamparter
4623d89737 zebra: make MRIB lookup behaviour switchable
depending on the usage scenario (and availability of multitopology IGP
protocols, which is currently zero in Quagga), different approaches of
Multicast RPF lookups are useful.

Reference behaviours from commercial vendors are urib-only/mrib-only
(Juniper, depending on inet.2 availability) and lowest-distance (Cisco).
As we are currently without MT IGP support, mrib-first seems the most
useful default for Quagga.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25 20:38:31 -04:00
David Lamparter
b8a9691548 zebra: fix optional distance on static mrib route
Unfortunately, the quagga CLI parser doesn't support [<1-255>].  Fix by
working around with an alias.

Replaces the following commits:
- zebra: mrib: [no] ip mroute - require distance.
- zebra: mrib: [no] ip mroute - make distance optional.
(Rewritten as alias)

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25 20:38:31 -04:00
Everton Marques
b78a80d742 zebra: mrib: static route support
With the MRIB being independent from the Unicast RIB, there's currently
now way to add static routes to the MRIB.  Address that by adding a
separate set of commands for MRIB static routes.

Combines these original patches:
- zebra: mrib: ip mroute command to add unicast route to MRIB for multicast RPF.
- zebra: mrib: no ip mroute: Fix removal of static multicast RPF route.
- zebra: mrib: remove unused static_add/delete_ipv4
- zebra: Cleanups to zebra_rib.
- pimd: Merge pim-only branch.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25 20:38:31 -04:00
Donald Sharp
3ff8613314 zebra: Fix show ip route for ibgp only routes
When 'show ip route summ' is entered
and there are only ibgp routes they
are not being displayed.  This commit
fixes this issue.

Ticket: CM-10931
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-05-13 15:29:37 -04:00
Don Slice
8902474bd3 zebra: Add route-map support to ip import-table
Added the ability to supply a route-map to the ip import-table command,
which greatly improves filtering between the kernel prefixes in a
non-default table that are imported into the zebra rib.

Ticket:CM-8168
Signed-off-by: Donald Slice
Reviewed By: Donald Sharp
2016-05-12 20:22:53 -04:00
Donald Sharp
a3d21ef32e zebra: Fix interface based static routes
This commit fixes interface based static routes.

static routes are now stored and if an interface
comes up it finds the route and installs it.

Ticket: CM-10869
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
2016-05-10 15:07:04 -04:00
Donald Sharp
010c141f8a zebra: fix show ip route vrf to use zvrf_list
Iterate over the zvrf_list to allow 'show ip route vrf...'
to show vrfs that are inactive -vs- not even configured

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
2016-05-06 10:41:32 -04:00
Donald Sharp
c1c747a897 zebra: Fix show vrf and show run to use the zvrf_list
The show vrf and show run commands were iterating
over the vrf_list.  Use the zvrf_list instead
so that we can understand the differences
between something configed -vs- created

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
2016-05-06 10:41:30 -04:00
Donald Sharp
fb148af4a1 zebra: Add code to add/remove statics from the rib
On enable/disable of static routes add and remove them
from the rib as appropriate.

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
2016-05-06 10:41:28 -04:00
root
825649bd9f zebra: Allow vrfs to be defined and displayed before netlink vrf add
Displays vrfs using the vrf_list rather than the route-nodes.  This allows "show vrf"
to display inactive (or not yet active) vrfs.  Also, IPv6 static routes are now
allowed to be defined and displayed prior to the netlink vrf add.

Ticket: CM-10139
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
2016-05-03 17:54:01 +00:00
Donald Sharp
b9f1114e38 zebra: Stop passing around vrf_id for static_XXX functions
The static zebra functions are passing around the vrf_id
At the crunchy edges gather the zvrf from passed in
vrf name and pass that around instead.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-02 13:17:00 -04:00
Daniel Walton
00cbc1f56c "show ip route summary" has negative values for ebgp counters
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Dinesh Dutt <ddutt@cumulusnetworks.com>

Ticket: CM-10612
2016-04-26 22:50:34 +00:00
Dinesh G Dutt
1ff0858e52 Get route counts right for show ip route summary
Ticket: CM-9974
Reviewed By: CCR-4531
Testing Done: Testing with both single & multiple NHs

Zebra is counting each NH as a separate route which leads to all wrong
stats. Count routes, not NHs.
2016-04-21 12:15:59 -07:00
Donald Sharp
7c5519562e zebra: Refactor zebra_vrf
Move zebra_vrf_XXX functionality into it's own
file so that we can isolate a bit the api edges

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2016-04-14 20:57:04 -04:00
vivek
21efedebd9 Zebra: Fix IPv6 static route config in a VRF
When configuring an IPv6 static route with the nexthop as a link-local
IPv6 address, the associated interface has to be looked up in the correct
VRF.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>

Ticket: CM-10169
Reviewed By: CCR-4382
Testing Done: Manual
2016-03-29 17:41:59 -07:00
Don Slice
4a14188257 zebra: Use vrf name instead of vrf-id for ipv6 static route configuration
Changed output of the "ipv6 route ... vrf red" to display and store with the
vrf name instead of the vrf_id, since the vrf_id would disappear on reboot
or quagga restart.

Ticket: CM-10126
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
2016-03-29 19:19:42 +00:00
vivek
6714f864c3 Zebra: Fix nexthops in IPv6 route display
Ticket: CM-10135
Reviewed By: Trivial
Testing Done: None
2016-03-28 22:21:08 -07:00
Don Slice
d511d7f168 Zebra: Move VRF keyword in show ip route commands
To make the syntax of the "show ip route" vrf commands more closely align with the bgp variety,
moved the vrf forward in the command.  In other words, show ip route 10.1.1.1/32 vrf green became
show ip route vrf green 10.0.0.1/32.  Also added a couple of missing show vrf commands (ipv4 and
ipv6 tags).

Ticket: CM-9114
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
2016-02-28 22:03:27 +00:00
Don Slice
5fe7477040 Zebra: Improve output of show ip route vrf all
Changed output to use the name and table id rather than the vrf_id, since the vrf_id
isn't really meaningful to customers reading the output.

Ticket: CM-9464
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
2016-02-24 15:48:32 +00:00
Donald Sharp
689e66945d zebra: Fix 'show ipv6 nht' to actually work
The 'show ipv6 nht' command was not properly
hooked up into the cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-02-18 09:07:55 -05:00
Daniel Walton
41d9cc6a65 quagga: remove babel
Ticket: CM-9274
Reviewed By: sharpd@cumulusnetworks.com
Testing Done:

<DETAILED DESCRIPTION (REPLACE)>
2016-02-11 08:55:24 -08:00
Donald Sharp
12f6fb9731 lib, zebra: The Bulk of the conversion over to NS and VRF
Convert the rest of zebra over to use a Namespae and VRF.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-02-01 10:55:42 -08:00
Donald Sharp
3ee39b5ba0 ZEBRA: Remove NEXTHOP_TYPE_XXX_IFNAME
The NEXTHOP_TYPE_XXX_IFNAME types were never being used.  Remove them
and the code associated with them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-12-04 10:44:37 -08:00
Donald Sharp
ba77924165 zebra: Remove STATIC_XXX_IFNAME and use _IFINDEX
When we get a static route through an interface convert the interface
name to an ifindex and pass it through to zebra_rib.c. zebra_rib.c
should not care about the ifname.

This code change will allow us to collapse some of the NEXTHOP_XXX types.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-12-04 10:29:58 -08:00
Donald Sharp
cbdee2350a Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster 2015-11-27 08:58:52 -08:00
Donald Sharp
4690c7d74c Quagga: prefix2str fixup
During CR for nexthop upstream it was noticed that usage
of prefix2str was not consistent.  This fixes this problem

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-11-23 13:31:11 -08:00
Daniel Walton
813d4307f9 Should be able to "no" the full text of any config line
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-5816
2015-11-23 18:05:03 +00:00
Vipin Kumar
d046335de6 Fixing a space before VRF_CMD_STR in ip route commands.
Ticket:
Reviewed By:
Testing Done:

<DETAILED DESCRIPTION (REPLACE)>
2015-10-30 11:41:10 -07:00
Donald Sharp
be5e48abec Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Conflicts:
	zebra/rib.h
	zebra/zebra_rib.c
	zebra/zebra_vty.c
2015-10-30 05:52:29 -07:00
Feng Lu
8f527c5e7e zebra: configure static routes in any VRF
Introduce new commands to configure static routes in any VRF, by
appending the old static route commands with a new parameter
"vrf N".

A new parameter "const char *vrf_id_str" is added to the functions
zebra_static_ipv4() and static_ipv6_func() to get the configured
VRF ID.

A new member "vrf_id" is added to the "struct static_ipv4" and
"struct static_ipv6", indicating which VRF this static route is
configured in.

But till now, no interface can exist in any non-default VRF. So
these static routes in non-default VRFs are kept inactive.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>

Conflicts:
	zebra/zebra_rib.c
	zebra/zebra_vty.c
2015-10-30 00:12:52 -07:00
Feng Lu
af41b63a5e zebra: show routes in a specified VRF or all VRFs
The present "show ip[v6] [m]route [xxx]" and "show ip rpf [xxx]"
commands now show routes only in the default VRF.

A new option is introduced to show routes in a specified VRF:
    show ip[v6] [m]route [xxx] vrf N
    show ip rpf [xxx] vrf N

and a new option is used to show routes through all VRFs:
    show ip[v6] [m]route [xxx] vrf all
    show ip rpf [xxx] vrf all

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
[DL: conflicts resolved]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>

Conflicts:
	zebra/zebra_vty.c

Conflicts:
	nhrpd/nhrp_interface.c
	zebra/zebra_rib.c
	zebra/zebra_rnh_null.c
	zebra/zebra_vty.c
2015-10-29 23:46:03 -07:00
Feng Lu
78104b9bad zebra: let FIB stand for its respective VRF
A new member "vrf_id" is added to "struct rib", reflecting the VRF
which it belongs to.

A new parameter "vrf_id" is added to the relative functions where
need, except those:
- which already have the parameter "vrf_id"; or
- which have a parameter in type of "struct rib"; or
- which have a parameter in type of "struct interface".

All incoming routes are set to default VRF.

In fact, all routes in FIB are kept in default VRF. And the logic
is not changed.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
[DL: conflicts fixed + compile warning fix]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>

Conflicts:
	zebra/connected.c
	zebra/kernel_socket.c
	zebra/rib.h
	zebra/rt_netlink.c
	zebra/zebra_rib.c
	zebra/zserv.c

Conflicts:
	zebra/connected.c
	zebra/interface.c
	zebra/kernel_socket.c
	zebra/rib.h
	zebra/rt_netlink.c
	zebra/rtread_getmsg.c
	zebra/zebra_rib.c
	zebra/zebra_vty.c
	zebra/zserv.c
2015-10-29 23:38:03 -07:00
Feng Lu
b72ede27fd lib, zebra: move "struct vrf" to be a lib module
Previously "struct vrf" is defined locally in zebra. Now it is moved
to be a lib module.

This is the first step to support multi-VRF in quagga. The
implementation is splitted into small patches for the purpose of
easy review.

* lib:
    "struct vrf" with basic members is defined in vrf.c. The member
    "void *info" is for user data.

    Some basic functions are defined in vrf.c for adding/deleting/
    looking up a VRF, scanning the VRF table and initializing the
    VRF module.

    The type "vrf_id_t" is defined specificly for VRF ID.

* zebra:
    The previous "struct vrf" is re-defined as "struct zebra_vrf";
    and previous "vrf" variables are renamed to "zvrf".

    The previous "struct vrf" related functions are removed from
    zbera_rib.c. New functions are defined to maintain the new
    "struct zebra_vrf".

    The names vrf_xxx are reserved for the functions in VRF module.
    So:
    - the previous vrf_table() are renamed to zebra_vrf_table();
    - the previous vrf_static_table() are renamed to
      zebra_vrf_static_table().

    The main logic is not changed.

    BTW: Add a statement to zebra_snmp.c telling that the SNMP is
         running only for the MIBs in the default VRF.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>

Conflicts:
	lib/Makefile.am
	zebra/zebra_rib.c
	zebra/zebra_vty.c

Conflicts:
	lib/Makefile.am
	lib/memtypes.c
	zebra/rib.h
	zebra/zebra_rib.c
	zebra/zebra_rnh.c
	zebra/zebra_rnh.h
	zebra/zebra_vty.c
2015-10-29 16:45:10 -07:00
Donald Sharp
c0551cbbaf zebra: Collapse struct static_ipv[4|6] into struct static_route
The 'struct static_ipv4' and 'struct static_ipv6' structures
are essentially the same.  Collapse them into one data structure
'struct static_route'.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-10-22 17:19:27 -07:00
Donald Sharp
6baf7bb88b Create override for quagga reinstall of originated routes
Ticket: CM-7026
Reviewed by: CCR-3315
Testing: See bug

Quagga-dev suggested these changes for the quagga override of originated routes.
2015-08-26 05:21:40 -07:00
Donald Sharp
8a92a8a00c bgpd, zebra: rfc-5549-generic.patch
This adds support for BGP RFC 5549 (Extended Next Hop Encoding capability)

     * send and receive of the capability
     * processing of IPv4->IPv6 next-hops
     * for resolving these IPv6 next-hops, itsworks with the current
       next-hop-tracking support
     * added a new message type between BGP and Zebra for such route
       install/uninstall
     * zserv side of changes to process IPv4 prefix ->IPv6 next-hops
     * required show command changes for IPv4 prefix having IPv6 next-hops

Few points to note about the implementation:

     * It does an implicit next-hop-self when a [IPv4 prefix -> IPv6 LL next-hop]
       is to be considered for advertisement to IPv4 peering (or IPv6 peering
       without Extended next-hop capability negotiated)

     * Currently feature is off by default, enable it by configuring
       'neighbor <> capability extended-nexthop'

     * Current support is for IPv4 Unicast prefixes only.

IMPORTANT NOTE:

     This patch alone isn't enough to have IPv4->IPv6 routes installed into
     the kernel. A separate patch is needed for that to work for the netlink
     interface.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
             Vivek Venkatraman <vivek@cumulusnetworks.com>
             Donald Sharp <sharpd@cumulusnetworks.com>
2015-06-11 09:19:12 -07:00
Donald Sharp
4e3afb1472 zebra: zebra-warnings.patch
Remove compiled warnings for the zebra directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
2015-05-19 18:04:26 -07:00
Donald Sharp
078430f609 bgpd-nht-import-check-fix.patch
BGP: Fix network import check use with NHT instead of scanner

When next hop tracking was implemented and the bgp scanner was eliminated,
the "network import-check" command got broken. This patch fixes that
issue. NHT is used to not just track nexthops, but also the static routes
that are announced as part of BGP's network command. The routes are
registered only when import-check is enabled. To optimize performance,
we register static routes only when import-check is enabled.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 18:04:20 -07:00
Donald Sharp
a50b580a0f Zebra: Don't resolve routes over default for nexthop tracking
Resolving routes over the default route for NHT can lead to all sorts
of problems. So, we explicitly exclude resolving routes for NHT over the
default route. A knob is provided to allow the route to be resolved over
the default in case of special circumstances.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by:   Daniel Walton <dwalton@cumulusnetworks.com>
2015-05-19 18:04:16 -07:00
Donald Sharp
7a4bb9c54e zebra-redistribute-table.patch
Zebra: Redistribute routes from non-main kernel table to main.

This can be the basis for many interesting features such as variations
of redistribute ARP, using zebra as the RIB in the presence of multiple
routing protocol stacks etc. The code only supports IPv4 for now, but
the infrastructure is in place for IPv6.

Usage:
There is a new route type introduced by this model: TABLE. Routes
imported from alternate kernel tables will have their protocol type set to
TABLE.

Routes from alternate kernel tables MUST be first imported into the main
table via "ip import-table <table id>". They can then be redistributed via
a routing protocol via the "redistribute table" command. Each imported table
can an optional administrative distance specified. In Zebra, a route with a
lower distance is chosen over routes with a higher distance. So, distance
is how the user can choose to prioritize routes from a particular table over
routes from other tables or routes learnt another way in zebra.

Route maps for imported tables are specified via "ip protocol" command in
zebra. Route maps for redistributed routes within a routing protocol are
subject to the route map options supported by the protocol. The
"match source-protocol" option in route maps can match against "table"
to filter routes learnt from alternate kernel routing tables.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 18:03:42 -07:00
Donald Sharp
7c8ff89e93 Multi-Instance OSPF Summary
——————————————-------------

- etc/init.d/quagga is modified to support creating separate ospf daemon
  process for each instance. Each individual instance is monitored by
  watchquagga just like any protocol daemons.(requires initd-mi.patch).

- Vtysh is modified to able to connect to multiple daemons of the same
  protocol (supported for OSPF only for now).

- ospfd is modified to remember the Instance-ID that its invoked with. For
  the entire life of the process it caters to any command request that
  matches that instance-ID (unless its a non instance specific command).
  Routes/messages to zebra are tagged with instance-ID.

- zebra route/redistribute mechanisms are modified to work with
  [protocol type + instance-id]

- bgpd now has ability to have multiple instance specific redistribution
  for a protocol (OSPF only supported/tested for now).

- zlog ability to display instance-id besides the protocol/daemon name.

- Changes in other daemons are to because of the needed integration with
  some of the modified APIs/routines. (Didn’t prefer replicating too many
  separate instance specific APIs.)

- config/show/debug commands are modified to take instance-id argument
  as appropriate.

Guidelines to start using multi-instance ospf
---------------------------------------------

The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.

To enable multiple instances, do the following:

     1. service quagga stop
     2. Modify /etc/quagga/daemons to add instance-ids of each desired
        instance in the following format:
        ospfd=“yes"
        ospfd_instances="1,2,3"
	assuming you want to enable 3 instances with those instance ids.
     3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
        and ospfd-3.conf.
     4. service quagga start/restart
     5. Verify that the deamons are started as expected. You should see
        ospfd started with -n <instance-id> option.
     	ps –ef | grep quagga
     	With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
	ospfd-<instance-id>/vty to each instance.
     6. vtysh to work with instances as you would with any other deamons.
     7. Overall most quagga semantics are the same working with the instance
     	deamon, like it is for any other daemon.

NOTE:
     To safeguard against errors leading to too many processes getting invoked,
     a hard limit on number of instance-ids is in place, currently its 5.
     Allowed instance-id range is <1-65535>
     Once daemons are up, show running from vtysh should show the instance-id
     of  each daemon as 'router ospf <instance-id>’  (without needing explicit
     configuration)
     Instance-id can not be changed via vtysh, other router ospf configuration
     is allowed as before.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 18:03:42 -07:00
Donald Sharp
0d9551dc3c Add support for route tags
Credit
------
A huge amount of credit for this patch goes to Piotr Chytla for
their 'route tags support' patch that was submitted to quagga-dev
in June 2007.

Documentation
-------------
All ipv4 and ipv6 static route commands now have a "tag" option
which allows the user to set a tag between 1 and 65535.

quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag ?
  <1-65535>  Tag value
quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag 40
quagga(config)#

quagga# show ip route 1.1.1.1/32
Routing entry for 1.1.1.1/32
  Known via "static", distance 1, metric 0, tag 40, best
  * 10.1.1.1, via swp1

quagga#

The route-map parser supports matching on tags and setting tags
!
route-map MATCH_TAG_18 permit 10
 match tag 18
!

!
route-map SET_TAG_22 permit 10
 set tag 22
!

BGP and OSPF support:
- matching on tags when redistribing routes from the RIB into BGP/OSPF.
- setting tags when redistribing routes from the RIB into BGP/OSPF.

BGP also supports setting a tag via a table-map, when installing BGP
routes into the RIB.

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2015-05-19 17:46:33 -07:00
Donald Sharp
518f0eb188 bgpd: bgpd-event-driven-route-map-updates.patch
BGP: Reprocess the trigger points when an attached route map changes

Currently, modifications to route maps do not affect already processed
routes; they only affect new route updates. This patch addresses this
limitation.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 17:40:45 -07:00
Donald Sharp
fb018d251e nexthop-tracking.patch
quagga: nexthop-tracking.patch

Add next hop tracking support to Quagga. Complete documentation in doc/next-hop-tracking.txt.

Signed-off-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
2015-05-19 17:40:34 -07:00
Donald Sharp
9343ce8356 Added show command to display only the routes in the RIB that
does not count ECMPs

Signed-off-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com>
2015-05-19 17:24:41 -07:00
David Lamparter
6b0655a251 *: nuke ^L (page feed)
Quagga sources have inherited a slew of Page Feed (^L, \xC) characters
from ancient history.  Among other things, these break patchwork's
XML-RPC API because \xC is not a valid character in XML documents.

Nuke them from high orbit.

Patches can be adapted simply by:
	sed -e 's%^L%%' -i filename.patch
(you can type page feeds in some environments with Ctrl-V Ctrl-L)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-06-04 06:58:02 +02:00
Christian Franke
2b00515a9b bgpd, ospfd, zebra: fix some DEFUN definitions
Fixup some DEFUNS with incorrect command strings or mixed up helpstrings.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-04-01 17:32:49 +02:00
Christian Franke
e8d3d2991f zebra: implement NEXTHOP_FLAG_ONLINK
On Linux, the kernel will only allow for a route to be installed when
its gateway is directly attached according the kernel fib.

There are cases when this restriction by the kernel is too strong, in
those cases, we deploy the RTNH_F_ONLINK netlink flag.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-09-19 18:04:40 +02:00
Christian Franke
fa713d9ee5 zebra: rework recursive route resolution
Change the datastructure for recursive routes. This brings the following
benefits:

By using struct nexthop also to store nexthops obtained by recursive
resolution, we can get rid of quite a bit of code duplication in the fib
management. (rt_netlink, rt_socket, ...)

With the new datastructure we can make use of all available paths when
recursive routes are resolved with multipath routes.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-09-19 18:04:40 +02:00
Christian Franke
5b9f51828d zebra: improve display of NEXTHOP_IPV4_IFINDEX in show ip route
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-08-06 12:41:46 +02:00
Avneesh Sachdev
9fd92e3c4b zebra: add structure to hold per-prefix state in RIB
Add the rib_dest_t structure to hold per-prefix state in the routing
information base. This gives us an appropriate place to maintain the
queueing state of a route_node. Queuing state was previously being
stored on the first rib in the list of ribs hanging off the
route_node.

  * zebra/rib.h

    - Add new structure rib_dest_t.

    - Remove the rn_status field from 'struct rib', it is no longer
      required.

    - Add macros (RNODE_FOREACH_RIB, RNODE_FOREACH_RIB_SAFE) for
      walking all 'struct ribs' corresponding to a route_node. These
      hide the fact that there is an intermediate rib_dest_t
      structure.

    - Add a few utility inlines to go between a rib_dest_t and
      associated structures.

  * zebra/zebra_rib.c

    - rib_link()/rib_unlink()

      Tweak for new behavior, where the 'info' pointer of a route_node
      points to a rib_dest_t. The list of ribs for a prefix now hangs
      off of the dest.

      Change the way we ref count route_nodes. We now hold a single
      ref count on a route_node if there is a corresponding
      rib_dest_t.

    - Maintain the queuing state of a route_node on the flags field of
      the rib_dest_t.

    - Add the rib_gc_dest() function, which deletes a rib_dest_t if it
      is no longer required. A rib_dest_t can be deleted iff there are
      no struct ribs hanging off of it.

    - Call rib_gc_dest() any time we unlink a rib from the
      rib_dest_t. Currently we only need to call it once, just before
      we return from rib_process().

  * zebra/{redistribute,zebra_rib,zebra_snmp,zebra_vty}.c

    Use new macros to walk over route_node ribs.

  * lib/memtypes.c

    Add memory type for rib_dest_t.

Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-30 21:41:16 +01:00
Joachim Nilsson
36735ed988 zebra: fix up compilation without rtadv/IPv6
let's ground the rtadv.h file if route advertisements are disabled. And
fix up the CLI for it, as well as move the "show ip mroute" to its
proper place.

  * zebra/rtadv.h: #ifdef RTADV
  * zebra/main.c: #ifdef RTADV
  * zebra/zebra_vty.c: move "show ip mroute" out of #ifdef IPV6

From: Joachim Nilsson <troglobit@gmail.com>
[moved #ifdef RTADV to rtadv.h]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-05-09 13:51:54 +02:00
Jorge Boncompte [DTI2]
ddc943dec3 bgpd, zebra: Fix format for some metric outputs
Metrics are unsigned values.

  * bgpd/bgp_{debug,route,vty}.c,
  * zebra/zebra_vty.c: replace %d with %u for metrics & distances

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[reworded commit message]
Signed-off-by: David Lamparter <equinox@diac24.net>
2012-05-02 17:03:21 +02:00
Juliusz Chroboczek
578ce371d1 zebra: Display uptime of Babel routes in show ip[v6] route. 2012-03-25 17:06:53 +01:00
G.Balaji
cb32fd690a zebra: Removal of the following warning messages
warning: too many arguments for format [-Wformat-extra-args]
2012-01-23 14:31:14 +04:00
G.Balaji
cddf391bf6 zebra: IPv4 MP-BGP Routes addition and deletion
This patch contains the following:
1. Addition of IPv4 SAFI_MULTICAST BGP routes into the RTM's RIB.
2. Deletion of IPv4 SAFI_MULTICAST BGP routes from the RTM's RIB.
2012-01-23 14:30:42 +04:00
David Lamparter
e0ca5fde7b lib: put route_types.txt to real use
this replaces most occurences of routing protocol lists by preprocessor
defines from route_types.h. the latter is autogenerated from
route_types.txt by a perl script (previously awk). adding a routing
protocol now is mostly a matter of changing route_types.txt and log.c.

Conflicts:

	lib/route_types.awk
2011-12-13 19:13:17 +04:00
Stig Thormodsrud
61691c91c1 [zebra] Fix vyatta bug 2814: Add "show ip route summary" command. 2009-06-18 20:18:25 +01:00
Stephen Hemminger
7fc626de5f [cleanup] Make command nodes static
The cmd_nodes used to configure vty, can mostly be static so
(basic data hiding 101).
2009-06-12 17:10:29 +01:00
Andrew J. Schorr
0930331446 [zebra] Trivial patches so we can compile when IPv6 is not enabled
2007-05-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* zebra_routemap.c: (route_set_src_compile) Use '#ifdef HAVE_IPV6'
	  as needed.
	* zebra_vty.c: (vty_show_ip_route_detail, vty_show_ip_route) Use
	  '#ifdef HAVE_IPV6' as needed.
	  (show_ip_protocol) Move function definition outside of
	  '#ifdef HAVE_IPV6' section.
2007-05-30 20:10:34 +00:00
Paul Jakma
7514fb7739 [zebra] Routemap support on received routes, with 'set src' command (linux)
2007-05-01 David L Stevens <dlstevens@us.ibm.com>

	* (general) These changes collectively add route-map and
	  prefix-list support to zebra and fix a bug in "show
	  route-map" (with no argument).
	* doc/main.texi: added route-map, prefix-list, ip protocol
	  and set src documentation
	* lib/command.h: added PROTOCOL_NODE type
	* lib/log.c: (proto_name2num) new function, protocol name to
	  number translation.
	* lib/routemap.c: (vty_show_route_map) fixed "show route-map"
	  without route-map name
	* lib/routemap.h: added RMAP_ZEBRA type
	* lib/zebra.h: added proto_name2num() prototype
	* vtysh/extract.pl.in: added VTYSH_ZEBRA flag for route-map and
	  plist
	* vtysh/Makefile.am: added zebra_routemap.c
	* vtysh/vtysh.h: added VTYSH_ZEBRA flag to VTYSH_RMAP
	* zebra/connected.c: (connected_up_ipv4) added src preference argument
	  to rib_add_ipv4()
	* zebra/kernel_socket.c: (rtm_read) ditto
	* zebra/main.c: added prefix list initialization
	* zebra/Makefile.am: added zebra_routemap.c source file
	* zebra/rib.h: added generic address union "g_addr" and use in
	  existing places that had an explicit union.
	  Added "src" to struct nexthop.
	  Added preferred src arg to nexthop_ipv4_add and rib_add_ipv4.
	* zebra/rt_netlink.c: (netlink_routing_table) set preferred source on
	  netlink messages.
	  (netlink_route_change) ditto
	  (netlink_route_multipath) ditto.
	* zebra/rtread_getmsg.c: (handle_route_entry) added (NULL) src to
	  rib_add_ipv4() call.
	* zebra/rtread_proc.c: (proc_route_read) ditto
	* zebra/zebra_rib.c: (nexthop_ipv4_add) add src argument.
	  (nexthop_ipv4_ifindex_add) ditto
	  (rib_add_ipv4) ditto
	  (nexthop_active_check) Add route-map processing.
	* zebra/zebra_routemap.c: new file for zebra route-map commands.
	* zebra/zebra_vty.c: (ip_protocol_cmd) Apply route-map to protocol
	  (vty_show_ip_route_detail) added "src" printing
	  (vty_show_ip_route) ditto
	  (show_ip_protocol_cmd) new command, list routemaps.
	  (config_write_protocol) write out routemap protocl config.
	  (zebra_vty_init) Install the new routemap protocol commands.
	* zebra/zserv.c: (zread_ipv4_add) added (NULL) src arg
	  (zebra_init) init zebra route-maps.
	* zebra/zserv.h: add zebra_route_map_init
2007-05-02 16:05:35 +00:00
ajs
f52d13cb2e 2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* zebra.h: Declare new functions zebra_route_string() and
	  zebra_route_char().
	* log.c: (zroute_lookup,zebra_route_string,zebra_route_char) New
	  functions to map zebra route numbers to strings.
	* zebra_vty.c: (route_type_str) Remove obsolete function: use new
	  library function zebra_route_string() instead.  Note that there
	  are a few differences: for IPv6 routes, we now get "ripng" and
	  "ospf6" instead of the old behavior ("rip" and "ospf").
	  (route_type_char) Remove obsolete function: ues new library function
	  zebra_route_char() instead.  Note that there is one difference:
	  the old function returned 'S' for a ZEBRA_ROUTE_SYSTEM route,
	  whereas the new one returns 'X'.
	  (vty_show_ip_route_detail,vty_show_ipv6_route_detail) Replace
	  route_type_str() with zebra_route_string().
	  (vty_show_ip_route,vty_show_ipv6_route) Replace route_type_char()
	  with zebra_route_char().
	* bgp_vty.c: (bgp_config_write_redistribute) Use new library function
	  zebra_route_string instead of a local hard-coded table.
	* ospf6_asbr.c: Remove local hard-coded tables zroute_name and
	  zroute_abname. Change the ZROUTE_NAME macro to use new library
	  function zebra_route_string().  Remove the ZROUTE_ABNAME macro.
	  (ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with
	  a call to zebra_route_char(), and be sure to fix the format string,
	  since we now have a char instead of a char *.
	* ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and
	  zebra_route_abname.  Note that the zebra_route_name[] table
	  contained mixed-case strings, whereas the zebra_route_string()
	  function returns lower-case strings.
	  (ospf6_zebra_read_ipv6): Change debug message to use new library
	  function zebra_route_string() instead of zebra_route_name[].
	  (show_zebra): Use new library function zebra_route_string() instead
	  of zebra_route_name[].
	* ospf_dump.c: Remove local hard-coded table ospf_redistributed_proto.
	  (ospf_redist_string) New function implemented using new library
	  function zebra_route_string().  Note that there are a few differences
	  in the output that will result: the new function returns strings
	  that are lower-case, whereas the old table was mixed case.  Also,
	  the old table mapped ZEBRA_ROUTE_OSPF6 to "OSPFv3", whereas the
	  new function returns "ospf6".
	* ospfd.h: Remove extern struct message ospf_redistributed_proto[],
	  and add extern const char *ospf_redist_string(u_int route_type)
	  instead.
	* ospf_asbr.c: (ospf_external_info_add) In two messages, use
	  ospf_redist_string instead of LOOKUP(ospf_redistributed_proto).
	* ospf_vty.c: Remove local hard-coded table distribute_str.
	  (config_write_ospf_redistribute,config_write_ospf_distribute): Use
	  new library function zebra_route_string() instead of distribute_str[].
	* ospf_zebra.c: (ospf_redistribute_set,ospf_redistribute_unset,
	  ospf_redistribute_default_set,ospf_redistribute_check)
	  In debug messages, use ospf_redist_string() instead of
	  LOOKUP(ospf_redistributed_proto).
	* rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded
	  table str[]. Replace str[] with calls to new library function
	  zebra_route_string().
	* ripd.c: Remove local hard-coded table route_info[].
	  (show_ip_rip) Replace uses of str[] with calls to new library
	  functions zebra_route_char and zebra_route_string.
	* ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded
	  table str[].  Replace str[i] with new library function
	  zebra_route_string(i).
	* ripngd.c: Remove local hard-coded table route_info[].
	  (show_ipv6_ripng) Use new library function zebra_route_char() instead
	  of table route_info[].
2005-10-01 17:38:06 +00:00
paul
a1ac18c4d5 2005-06-28 Paul Jakma <paul.jakma@sun.com>
* (global) Extern and static'ification, with related fixups
	  of declarations, ensuring files include their own headers, etc.
	  if_ioctl.c: (interface_info_ioctl) fix obvious arg mis-order in
	  list loop
2005-06-28 17:17:12 +00:00
hasso
b8adec1f98 Fix "show ipv6 route <proto>" command. 2004-12-18 16:03:28 +00:00
hasso
39db97e4e0 Some compiler warnings fixes and fix for bugzilla #119. 2004-10-12 20:50:58 +00:00
hasso
39ff11dc92 Unbreak "show ip route" command. 2004-10-12 15:55:19 +00:00
hasso
c9e52be3f4 Compiler warnings fixes. 2004-09-26 16:09:34 +00:00
jardin
9e867fe663 Merge isisd into the Quagga's framework:
- add privs support
  - use misc quagga's definitions
  - make it compile"able"
  - fix segfault cases related to hostname()
  - add debug isis xxx command

This patch has been approved by Paul Jakma.
2003-12-23 08:56:18 +00:00
paul
7021c425a9 2003-07-15 Paul Jakma <paul@dishone.st>
* lib/version.h: add ZEBRA_URL (unused for now)
        * lib/vty.c: CMD_ERR_NOTHING_TODO when reading conf file should not
          be fatal. slight reformating.
        * ospfd/ospf_zebra.c: ignore reject/blackhole routes if zebra sends
          these type of routes. probably should be a new type of route to
          allow daemons to more easily choose whether to redistribute them
          - rathen than just a flag (eg for reject/blackhole).
          reorder the is_prefix_default test for ZEBRA_IPV4_ROUTE_DELETE to
          avoid the inverted test - slightly more readable.
        * redhat/zebra.spec.in: Add ospfapi port to services file, if
          with_ospfapi.
        * zebra/rib.h: Change nexthop types to an enum.
        * zebra/rt_netlink.c: run it through indent -nut.
          Add nexthop_types_desc[] descriptive array for nexthop types.
          (netlink_route_multipath) debug statements indicate which branch
          they are in and print out nexthop type.
        * zebra/zebra_rib.c: slight reformatting.
        * zebra/zebra_vty.c: Pass ZEBRA_FLAG_BLACKHOLE flag to
          static_add_ipv4() if Null0 route is configured. print out Null0 if
          STATIC_IPV4_BLACKHOLE route, and ignore flags (shouldnt be
          possible to set flags from vty) for config and show route.
2003-07-15 12:52:22 +00:00
hasso
457ef551eb IPv4 part of "make reject|blackhole routes work without nexthop|interface". 2003-05-28 12:02:15 +00:00
paul
595db7f165 Add back support for null0 interface blackhole routes. 2003-05-25 21:35:06 +00:00
hasso
81dfcaa2e2 Route (reject|blackhole) support from 6Wind patch. 2003-05-25 19:21:25 +00:00
paul
718e374419 Initial revision 2002-12-13 20:15:29 +00:00