Commit graph

197 commits

Author SHA1 Message Date
G. Paul Ziemba b9c7bc5ab0 bgpd: new vpn-policy CLI
PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below.

The code of this PR implements the vpn-specific parts of this syntax:

router bgp <as> [vrf <FOO>]
    address-family <afi> unicast
        rd (vpn|evpn) export (AS:NN | IP:nn)
        label (vpn|evpn) export (0..1048575)
        rt (vpn|evpn) (import|export|both) RTLIST...
        nexthop vpn (import|export) (A.B.C.D | X:X::X:X)
        route-map (vpn|evpn|vrf NAME) (import|export) MAP

        [no] import|export [vpn|evpn|evpn8]
        [no] import|export vrf NAME

User documentation of the vpn-specific parts of the above syntax is in PR #1937

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-19 22:13:43 -07:00
paulzlabn 3f1224cd1a
Merge branch 'master' into working/master/bgp-vpn-vrf-leaking 2018-03-14 13:31:58 -07:00
Quentin Young abccc77544
tests: add unit test for zlog
Just tests zlog_hexdump right now

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12 15:39:45 -04:00
Quentin Young e049c5fcce
lib: fixup zlog_hexdump
* Allocate correct amount of memory
* Use snprintf() instead of sprintf()

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12 15:39:34 -04:00
G. Paul Ziemba 51ade3a27f lib: add BGP VPN route type
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-09 16:40:37 -05:00
Donald Sharp e16abbb303 lib, zebra: Add rule encoding
Add some code to pass the rule we want installed into
the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-09 11:07:41 -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
Donald Sharp c83c5e4482 lib, zebra: Add new api to specify a label associated with the vrf
For L3VPN's we need to create a label associated with the specified
vrf to be installed into the kernel to allow a pop and lookup
operation.

The new api is:
zclient_send_vrf_label(struct zclient *zclient, vrf_id_t vrf_id,
                       mpls_label_t label);

For the specified vrf_id associate the specified label for
a pop and lookup operation for forwarding.

To setup a POP and Forward use MPLS_LABEL_IMPLICIT_NULL
If the same label is passed in we ignore the call.
If the label is different we update entry.
If the label is MPLS_LABEL_NONE we remove
the entry.

This sets up the api.  Future commits will have the functionality
to actually install into the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08 20:31:36 -05:00
Mitesh Kanjariya 31310b25f2 bgpd: advertise VNI subnet
In EVPN symmetric routing, not all subnets are presents everywhere.
We have multiple scenarios where a host might not get learned locally.
1. GARP miss
2. SVI down/up
3. Silent host

We need a mechanism to resolve such hosts. In order to achieve this,
we will be advertising a subnet route from a box and that box will help
in resolving the ARP to such hosts.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -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 8a71d93d85 sharpd: Add Super Happy Advanced Routing Protocol
Add a daemon that will allow us to test the zapi
as well as test route install/removal times from
the kernel.

The current commands are:

install route <starting ip address> nexthop <nexthop> (1-1000000)

This command starts installing at <starting ip address>/32
(1-100000) routes that it auto-increments by 1
Installation start time is noted in the log and finish
time is noted as well.

remove routes <starting ip address> (1-1000000)

This command removes routes at <starting ip address>/32
and removes (1-100000) routes created by the install route
command.

This code can be considered experimental and *is not*
something that should be run in a production environment.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-27 09:16:30 -05:00
Donald Sharp 7ea7b86e2b lib, zebra: Add ability to notify to Routing Protocols Success/Failure
Provide ZAPI code that can pass to an upper level protocol
what happened to it's route on install.

There are these notifications:
1) ZAPI_ROUTE_FAIL_INSTALL - The route attempted to be
   installed did not work.
2) ZAPI_ROUTE_BETTER_ADMIN_WON - A route that was installed
   has become un-installed due to another routing protocol
   installing a better admin distance
3) ZAPI_ROUTE_INSTALLED - The route specified has been installed

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-27 09:09:32 -05:00
Quentin Young c22fbb9b45
lib: smallify loglock
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-12 14:49:58 -04:00
Quentin Young dd73dca94a
lib: mt-safe log.c
Tentative thread-safety support for zlog. Functions designed to be
called from signal handlers are not mt-safe.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-12 14:28:58 -04:00
Donald Sharp 27c5d4de93 Merge pull request #1031 from opensourcerouting/small-bits
small bits
2017-08-24 08:58:46 -04:00
Renato Westphal 744899219f *: use zapi_route to send/receive redistributed routes as well
Some differences compared to the old API:
* Now the redistributed routes are sent using address-family
  independent messages (ZEBRA_REDISTRIBUTE_ROUTE_ADD and
  ZEBRA_REDISTRIBUTE_ROUTE_DEL). This allows us to unify the ipv4/ipv6
  zclient callbacks in the client daemons and thus remove a lot of
  duplicate code;

* Now zebra sends all nexthops of the redistributed routes to the client
  daemons, not only the first one. This shouldn't have any noticeable
  performance implications and will allow us to remove an ugly exception
  we had for ldpd (which needs to know all nexthops of the redistributed
  routes). The other client daemons can simply ignore the nexthops if
  they want or consult just the first one (e.g. ospfd/ospf6d/ripd/ripngd).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-23 20:25:45 -03:00
David Lamparter 9eed278b16 lib: centralized memstats-at-exit
adds a new all-daemon "debug memstats-at-exit" command.  Also saves
memstats to a file in /tmp, useful if a long-running daemon is having
weird issues (e.g. in a user install).

Fixes: #437
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-24 00:18:50 +02:00
Renato Westphal 0e51b4a368 lib/zserv: introduce address-family independent ZAPI message types
As noticed in 657cde1, the zapi_ipv[4|6]_route functions are broken in
many ways and that's the reason that many client daemons (e.g. ospfd,
isisd) need to send handcrafted messages to zebra.

The zapi_route() function introduced by Donald solves the problem
by providing a consistent way to send ipv4/ipv6 routes to zebra with
nexthops of any type, in all possible combinations including IPv4 routes
with IPv6 nexthops (for BGP unnumbered routes).

This patch goes a bit further and creates two new address-family
independent ZAPI message types that the client daemons can
use to advertise route information to zebra: ZEBRA_ROUTE_ADD and
ZEBRA_ROUTE_DELETE. The big advantage of having address-family independent
messages is that it allows us to remove a lot of duplicate code in zebra
and in the client daemons.

This patch also introduces the zapi_route_decode() function. It will be
used by zebra to decode route messages sent by the client daemons using
zclient_route_send(), which calls zapi_route_encode().

Later on we'll use this same pair of encode/decode functions to
send/receive redistributed routes from zebra to the client daemons,
taking the idea of removing code duplication to the next level.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-23 17:45:17 -03:00
Renato Westphal 153856bbe9 lib: remove redundant zebra messages
This also fixes a bug of ipv6 routes advertised by the VNC code being
ignored by zebra.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-23 17:45:17 -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 f790234f2f Merge pull request #892 from opensourcerouting/watchfrr-simplify
simplify watchfrr, add --terminal, improve startup logging
2017-08-09 14:32:44 -04:00
ßingen 6833ae01bc zebra: add pseudowire manager
Base framework for supporting MPLS pseudowires in FRR.

A consistent zserv interface is provided so that any client daemon
(e.g. ldpd, bgpd) can install/uninstall pseudowires in a standard
way. Static pseudowires can also be implemented by using the same
interface.

When zebra receives a request to install a pseudowire and the installation
in the kernel or hardware fails, a notification is sent back to the
client daemon and a new install attempt is made every 60 seconds (until
it succeeds).

Support for external dataplanes is provided by the use of hooks to
install/uninstall pseudowires.

Signed-off-by: ßingen <bingen@voltanet.io>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-09 12:35:15 +02:00
Mitesh Kanjariya 1a98c08704 bgpd/zebra/lib: EVPN support for asymmetric VxLan routing
1. Advertise gateway mac-ip in EVPN
2. Advertise VRR mac-ip in EVPN
3. Ignore gateway mac-ip advertisements in case of distributed gateway
4. Config knob to enable/disable gateway mac-ip advertisements

Ticket: CM-16456, CM-16543, CM-16555, CM-16778
Review: CCR-6283
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:28:46 -04:00
David Lamparter d34cb7f0b7 lib: plug logging hole during startup
zlog_* doesn't work in startup before we've loaded the real logging
configuration.  Add some code to log to stderr for that window of time.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-02 23:36:42 +02:00
Donald Sharp e0ae31b886 lib, pimd, zebra: Allow pim to set pimregX into appropriate vrf
The pimregX devices when created by the kernel are put into
the default vrf.  When pim gets the callback that the device
exists, check to see if it is a pimregX device and if so
move it into the appropriate vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04: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
vivek 2232a77c2b zebra: MAC and Neighbor (ARP/ND) handling
Implement handling of MACs and Neighbors (ARP/ND entries) in zebra:
- MAC and Neighbor database handlers
- Read MACs and Neighbors from the kernel, when needed and create
entries in zebra's MAC and Neighbor databases.
- Handle add/update/delete notifications from the kernel for MACs and
Neighbors and update zebra's database appropriately
- Inform locally learnt MACs and Neighbors to client
- Handle MACIP add/delete from client and install appriporiate entries
into the kernel
- Since Neighbor entries will be installed on an SVI, implement the
needed mappings

NOTE: kernel interface is only implemented for Linux/netlink

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12 12:29:25 -04:00
vivek 13d60d351c zebra: VNI and VTEP handling
Implement fundamental handling for VNIs and VTEPs:
- Handle EVPN enable/disable by client (advertise-all-vni)
- Create/update/delete VNIs based on VxLAN interface events and inform
client
- Handle VTEP add/delete from client and install into kernel
- New debug command for VxLAN/EVPN
- kernel interface (Linux/netlink only)

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12 12:26:02 -04:00
Quentin Young e0bebc7c22 lib: mt-safe tracebacks
can't be using them statics anymore sonny

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 23:32:15 +00:00
Quentin Young 56b4067930 *: simplify log message lookup
log.c provides functionality for associating a constant (typically a
protocol constant) with a string and finding the string given the
constant. However this is highly delicate code that is extremely prone
to stack overflows and off-by-one's due to requiring the developer to
always remember to update the array size constant and to do so correctly
which, as shown by example, is never a good idea.b

The original goal of this code was to try to implement lookups in O(1)
time without a linear search through the message array. Since this code
is used 99% of the time for debugs, it's worth the 5-6 additional cmp's
worst case if it means we avoid explitable bugs due to oversights...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-21 15:22:21 +00:00
Donald Sharp 293067f086 Merge remote-tracking branch 'origin/master' into babel 2017-05-30 10:58:03 -04:00
David Lamparter b85120bcb3 lib: detangle protocol name/instance from logging
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 14:07:28 -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
Donald Sharp 2579b2c144 lib: Fix up string -> proto # conversion for babel
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-13 23:15:27 -04:00
Donald Sharp 97133f7915 Merge remote-tracking branch 'origin/master' into EIGRP 2017-04-05 20:52:32 -04:00
Donald Sharp 6492ed5369 Merge pull request #310 from opensourcerouting/thread-prep
MT preparations
2017-04-05 12:39:25 -04:00
Quentin Young f257ff2cdb lib: fix proto_redistnum() oversight from #257
proto_redistnum() now accepts full protocol strings and not partial
names per #10

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-04-02 23:21:09 +00:00
David Lamparter 3f11a103a6 lib: make sure SEGV handler cannot lock up
Just adding -pthread to gcc options changes libc's behaviour, e.g.
making malloc() use proper locking.  This means a SEGV inside malloc()
(e.g. because malloc bookkeeping structures have been damaged by writing
to a broken pointer) can lead to a lockup by the following chain:

- random_function()
- malloc()
--- SEGV
- core_handler()
- zlog_backtrace_sigsafe()
- backtrace()
- malloc()

This will hang forever waiting for the malloc() lock to be released.

Another failure mode is dynamic linking with lazy binding (-z lazy,
default).  Since backtrace() is seldomly used, this means the call to
backtrace() in the core handler can in fact result in the dynamic linker
trying to resolve the "backtrace" symbol, which can also deadlock.

Add several safeguards to prevent any of this from happening.

(Unfortunately, these are not theoretical issues - I found them by
running into them headfirst.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-31 16:22:33 +02:00
ßingen fea12efb86 Implement generic label manager
Label Manager allows to share MPLS label space among different
daemons. Each daemon can request a chunk of consecutive labels and
release it if it doesn't need them anymore. Label Manager stores the
daemon protocol and instance to identify the owner client. It uses them
to perform garbage collection, releasing all label chunks from a client
when it gets disconnected or reconnected.

Additionally, every client can request that the chunk is never garbage
collected. In that case client has the responsibility to release
non-used labels.

Zebra can host the label manager itself (if no -l param is provided) or
connect to an external one using zserv/zclient (providing its address
with -l param).

Client code is in lib/zclient.c, but currently only LDP is using it.

TODO: Allow for custom ranges requests, i.e., specify the start label
besides the chunk.
TODO: Release labels from LDP.

Signed-off-by: Bingen Eguzkitza <bingen@voltanet.io>
2017-03-20 17:10:41 +01:00
Donald Sharp 7f57883ee6 eigrp: Initial Commit
Please Note, I will be redoing this commit message with
more information.

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

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

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

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

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

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

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 00:15:39 +01:00
Donald Sharp ae6ba9ba04 Merge pull request #257 from opensourcerouting/nhrpd
nhrpd
2017-03-07 15:15:23 -05: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
David Lamparter 1f806fc2c8 lib: add zlog_sanitize function
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-03-06 19:40:26 -05:00
Donald Sharp 3f3169a2e6 Merge remote-tracking branch 'origin/stable/2.0' 2017-02-24 09:32:47 -05:00
ßingen 4029782441 Add missing DESC_ENTRY to lib/log.c 2017-02-21 12:27:44 +01:00
Donald Sharp 8613585e1f lib: Moved zapi message types to zclient.h
Move the data structure used to have knowledge about
the zapi message types to zclient.h where it belongs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30 11:48:38 -05:00
Donald Sharp ac9ddce37d Merge pull request #104 from opensourcerouting/time-cleanup
Time cleanup
2017-01-24 11:43:32 -05:00
David Lamparter 3dad49ca94 lib: time: remove recent_time
This isn't even used anywhere.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-23 18:26:32 +01:00
Donald Sharp b58ed1f8a8 Merge remote-tracking branch 'origin/master' into pim_lib_work2 2017-01-17 21:01:56 -05:00
Quentin Young b84aadae44 Merge branch 'master' into fix-proto_redistnum 2017-01-06 19:44:46 -05:00
Donald Sharp 9473e34052 watchfrr: Rename watchquagga -> watchfrr
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-03 20:13:02 -05:00
David Lamparter 9b532e09f9 Merge pull request #37 from LabNConsulting/working/2.0/patch-set-170102a
Working/2.0/patch set 170102a
2017-01-03 16:44:44 +01:00
G. Paul Ziemba 5ee62c66a9 BGP: deal with vnc related string ambiguities (issue #9)
- "redist foo" parsing modified to check for foo==vnc and foo==vnc-direct
      instead of just leading 'v' character
    - string designating ZEBRA_ROUTE_VNC_DIRECT changed from "vpn" to "vnc-direct"
    - route_types.pl parser recognizes 7th field to restrict availability
      of a route type in the redist command to specific daemons
    - restrict "vnc-direct" to bgpd only (doesn't make sense elsewhere)
    - vnc documentation updated to match

Signed-off-by: Lou Berger <lberger@labn.net>
2017-01-02 15:04:47 -05:00
Donald Sharp e3be04328f lib, pimd, zebra: Allow pimd to ask the kernel about mroute info
When we need to lookup the mroute info for a route.  Allow
pimd to ask the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:06 -05: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
David Lamparter 46d5d8ec82 watchquagga: add ZLOG_WATCHQUAGGA
watchquagga logs as "NONE", which will also become visible in vtysh for
error messages.  Add "WATCHQUAGGA" log target.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-09 14:00:48 +01:00
Donald Sharp b10c5b0702 lib: Remove unknown protocol.
What is MASC anyways?

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 12:35:06 -04:00
Donald Sharp e2e210ddf0 lib: Fix ordering issue in protocol names
The protocol names and enum must be kept
in the same order.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 12:20:33 -04:00
Lou Berger 65efcfce42 bgpd: add L3/L2VPN Virtual Network Control feature
This feature adds an L3 & L2 VPN application that makes use of the VPN
and Encap SAFIs.  This code is currently used to support IETF NVO3 style
operation.  In NVO3 terminology it provides the Network Virtualization
Authority (NVA) and the ability to import/export IP prefixes and MAC
addresses from Network Virtualization Edges (NVEs).  The code supports
per-NVE tables.

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

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

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

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

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

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

Now includes changes needed to merge with cmaster-next.
2016-10-03 08:17:02 -04:00
Renato Westphal ce54994727 mpls: add support for LDP LSPs
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:12 -04:00
Renato Westphal eac6e3f027 ldpd: adapt the code for Quagga
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:09 -04:00
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
David Lamparter 3b4cd78375 lib: add new extensible memory-type handling
This rewrites Quagga's memory per-type allocation counting, without
using a fixed global list of types.  Instead, source files can declare
memory types which get handled through constructor functions called by
the dynamic linker during startup.

Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[DL: v3: forgot "nonnull" attribute on XFREE]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-09-19 17:52:05 +02:00
Donald Sharp ca531bd109 lib: Remove ZEBRA_INTERFACE_RENAME
Api in name only.  No code, so let's remove.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-16 21:07:28 -04:00
Donald Sharp 2ae2638713 lib, zebra: Remove ZEBRA_IPV[4|6]_IMPORT_NEXTHOP
Zebra api that was never used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 33361d3992c8bff66247b76e5adaf4b0de8217df)
2016-09-14 21:15:05 -04:00
Donald Sharp bbcd757a25 lib, zebra: Remove unused zserv/zclient calls
ZEBRA_IPV4_NEXTHOP_LOOKUP and ZEBRA_IPV6_NEXTHOP_LOOKUP
were never used by any protocol.  Remove dead code

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 22cd6214bf44863bfb5a34b40ab4abba3c5c4574)
2016-09-14 21:13:19 -04:00
Christian Franke d8efb772eb lib: don't have log functions change errno
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit abfd40d68202882696260617729518a6d2c99302)
2016-08-16 08:55:31 -04:00
Donald Sharp 69f30024c1 lib, bgpd: Fixup some more compile errors due to warnings
Original cherry-pick done on a fedora box with a completely
different compiler.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-06-04 20:45:43 -04:00
David Lamparter d1265948c3 lib: include thread information in backtraces
now that we know what thread we're currently executing, let's add that
information to SEGV / assert backtraces.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 615f9f18fc025757a255f936748fc1e86e922783)
2016-05-29 20:11:42 -04:00
Donald Sharp 93f7342f73 lib: Fixup zebra zapi message table
The zapi zebra_desc_table command_types code was
missing some entries.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-26 20:06:08 -04:00
Donald Sharp a9b5cbe55a lib: Fix compile warnings with zlog_hexdump
When using zlog_hexdump tell the compiler that we don't expect
to actually change the memory.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-25 20:38:35 -04:00
David Lamparter 12e41d03bd pimd: merge pimd as of 2015-01-19
Welcome pimd to the Quagga daemon zoo!

This is a merge of commit 77ae369 ("pimd: Log ifindex found for an
interface when zebra lib reports a new connected address."), with
the intermediate "reconnect" changes removed (c9adf00...d274381).
d274381 is replaced with b162ab7, which includes some changes.  In
addition, 4 reconnect-related changes and 1 cosmetic one have been
bumped out.

The rebase command used to produce the branch that is merged here is:
  git rebase --onto b162ab7 c9adf00 77ae369

Note that 3 patches had their author rewritten from
    "Anonymous SR#108542 <>" (which is not a valid git author ID)
to: "Savannah SR#108542 <nbahr@atcorp.com>" (which is the e-mail address
                               listed in the associated Savannah ticket)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25 20:38:32 -04:00
vivek 4a04e5f796 BGP: Trigger IPv6 router advertisements upon config of unnumbered neighbor
Instead of turning on IPv6 RA on every interface as soon as it has an IPv6
address, only enable it upon configuration of BGP neighbor. When the BGP
neighbor is deleted, signal that RAs can be turned off.

To support this, introduce new message interaction between BGP and Zebra.
Also, take appropriate actions in BGP upon interface add/del since the
unnumbered neighbor could exist prior to interface creation etc.

Only unnumbered IPv6 neighbors require RA, the /30 or /31 based neighbors
don't. However, to keep the interaction simple and not have to deal with
too many dynamic conditions (e.g., address deletes or neighbor change to/from
'v6only'), RAs on the interface are triggered upon any unnumbered neighbor
configuration.

BGP-triggered RAs will cause RAs to be initiated on the interface; however,
if BGP asks that RAs be stopped (upon delete of unnumbered neighbor), RAs
will continue to be exchanged if the operator has explicitly enabled.

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

Ticket: CM-10640
Reviewed By: CCR-4589
Testing Done: Various manual and automated (refer to defect)
2016-05-02 13:53:38 -07:00
radhika 055c4dfcde Support for multi-client and client reg msg
Ticket: CM-7615, CM-7773
Reviewed By: CCR-3610, CCR-3708
Testing Done: Unit, BGP Smoke and OSPF Smoke

Changes (70790261926b17200c8c9377c4576cd3b486fcef) ported from 2.5

Issue (related to CM-7615): 1. CM-7615: There is mismatch in the client name between ptm display of client BFD sessions and the zebra logs. For example, if bgpd added BFD session, zebra logs will show the client as “bgp” but the ptm display will show it as “quagga”
2. Bigger problem is when 2 clients (for example OSPF and BGP) from Quagga register for same BFD session and only one client de-registers the BFD session. This results in BFD session deletion from PTM even though other client still has the BFD registration.

Root Cause: Even though BGP, OSPF and OSPF6 are 3 different clients from Quagga that are trying to register/deregister BFD sessions with PTM, all 3 are represented as one client “quagga” from zebra. This makes it hard for PTM/BFD to distinguish between all three when BFD peer registration/deregistration happens from the clients.

Fix: Send the actual client name bgp, ospf or ospf6 from zebra with BFD reg/dereg messages instead of one unified client name “quagga”

CM-7773: BFD sessions are not getting cleaned from PTM even though no BGP peering exists in Quagga.

Root Cause: PTM cleans up stale BFD sessions from a client when it finds a change in seq id advertised by the client. But, if PTM never detects a change in the seq id then the stale BFD sessions never get cleaned up. The test restarts the quagga without saving the configuration, which results in no BGP peering. No BGP peers are registered with PTM after restart and PTM does not detect a client seq id change resulting in stale BFD sessions.

Fix: New client registration message was added in PTM. Every client that is interested in BFD monitoring will register with PTM with the client seq id. Client will register with a different seq id (typically pid) every time it restarts. This will help in detecting the change in seq id and cleanup of stale BFD sessions for a client.

Code Changes: To support the new client registration message following changes have been made
  - Added support for client registration messaging in zebra for sending messages to PTM.
  - Added support for client registration messaging between zebra and clients (BGP, OSPF and OSPF6) in BFD library.
  - Expanded the reg/de reg peer messaging between zebra and clients to support client specific seq id to distinguish between multiple clients registering for BFD peer rather than one “quagga” client.
  - Changes in bgpd, ospfd and ospf6d to send client registrations at the time of daemon initialization and on receiving BFD peer replay message.
2016-03-08 23:31:32 -08:00
vivek c8e264b60e Quagga: Implement VRF change semantics for an interface
Implement VRF change semantics for an interface to be invoked
when an interface is moved from one VRF (e.g., the Default) to
another. This includes the message definition as well as updating,
deleting or adding the interface from clients, depending on their
interest in the VRFs (old and new). Also handle replay of the
addresses on the interface upon VRF change, if required.

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

Ticket: CM-9527
Reviewed By: CCR-4174
Testing Done: Manual tests of various scenarios
2016-02-25 19:30:53 +00:00
Daniel Walton a48f437a90 Redistribute table related configs fail for BGP and OSPF
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Don Slide <dslice@cumulusnetworks.com>

Ticket: CM-9295
2016-02-19 13:31:26 +00: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 b78a42c24d lib: Fixup a compiler warning on netbsd
This code has a compiler warning on some oddball platforms

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-11-20 06:59:12 -08:00
Donald Sharp a9019bda5c lib: zlog_hexdump actually output printable ascii characters
We are getting this output from zlog_hexdump:

0x00007fffdd1f9648: 45 00 00 94 ee 63 40 00 45....6340.
0x00007fffdd1f9650: 03 00 ff 0a 14 00 0f fd ........
0x00007fffdd1f9658: e8 01 01 01 45 00 00 80 ....45...
0x00007fffdd1f9660: ee 63 40 00 0a 11 75 0a .6340...75.
0x00007fffdd1f9668: 14 00 0f fd e8 01 01 01 ........
0x00007fffdd1f9670: 10 e1 10 e1 00 6c d0 54 .....6c.54
0x00007fffdd1f9678: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f9680: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f9688: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f9690: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f9698: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96a0: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96a8: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96b0: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96b8: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96c0: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96c8: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96d0: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96d8: 00 00 00 00             ....

As you can see the ascii dump on the right is wrong and not lined
up correctly.  This commit fixes this issue:

0x00007ffcf046f228: 45 00 00 58 c6 36 40 00 E..X.6@.
0x00007ffcf046f230: 03 00 ff 73 14 00 0f fd ...s....
0x00007ffcf046f238: e8 01 01 01 45 00 00 44 ....E..D
0x00007ffcf046f240: c6 36 40 00 0a 11 9d 73 .6@....s
0x00007ffcf046f248: 14 00 0f fd e8 01 01 01 ........
0x00007ffcf046f250: 10 e1 10 e1 00 30 d0 cc .....0..
0x00007ffcf046f258: 00 00 00 00 00 00 00 00 ........
0x00007ffcf046f260: 00 00 00 00 00 00 00 00 ........
0x00007ffcf046f268: 00 00 00 00 00 00 00 00 ........
0x00007ffcf046f270: 00 00 00 00 00 00 00 00 ........
0x00007ffcf046f278: 00 00 00 00 00 00 00 00 ........

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-10-23 17:20:30 -07:00
radhika a7f6b2e219 Addition of missing zebra command descriptions
Ticket: CM-7456
Reviewed By: CCR-3528
Testing Done: Unit

Porting of the patch zebra-fix-cmd-type-desc-log.patch from 2.5 branch

Last few Zebra message command types defined were not added to the command type description table used for getting logging strings. This was causing the logs to display "unknown command type" instead of the actual command type. So, added all the missing zebra commands to the command type description table. Also, changed the order of the description table to match with the actual command type definition order.
2015-10-22 10:14:00 -07:00
Daniel Walton 99a6c6cdb5 Add zlog_hexdump() for debugging
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-7931
2015-10-21 01:46:55 +00:00
Donald Sharp 7a49a5b51f Quagga: Fix some more compile warnings
The debian build process under Jessie has a 'newer' gcc
compiler that is more stringent on warnings returned.
This commit cleans up some more warnings returned.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-10-07 09:27:09 -07:00
radhika 68fe91d6c7 Support of BFD status in Quagga
Ticket:CM-6802, CM-6952
Reviewed By: Donald, Kanna
Testing Done:

Double commit of b76943235e09472ec174edcf7204fc82d27fe966 from br2.5. But, manually resolved all the compilation errors. Also, modified the shows to support the json format which was not supported in br2.5.

CM-6802 – Currently, BFD session status can be monitored only through ptmctl. There is no way to check the BFD status of a peer/neighbor through Quagga. Debugging becomes easier if BFD status is shown in Quagga too. BFD status is relevant when it is shown against the BGP peer/OSPF neighbor. For, this following code changes have been done:
   - Only down messages from PTM were being propagated from Zebra daemon to clients (bgpd, ospfd and ospf6d). Now, both up and down messages are redistributed to the clients from zebra. BFD status field has been added to the messaging. Handling of BFD session up messages has been added to the client code. BGP/OSPF neighbor is brought down only if the old BFD session status is ‘Up’ to handle extra/initial down messages.
   - BFD status and last update timestamp fields have been added to the common BFD info structure. Also, common show functions for showing BFD information have been added to BFD lib.
   - Modified the BGP neighbor show functions to call common BFD lib functions.
   - For ospf and ospf6, BFD information was maintained only at interface level. To show BFD status per neighbor, BFD information has been added at neighbor level too. “show ip ospf interface”, “show ip ospf neighbor detail”, “show ipv6 ospf6 interface” and “show ipv6 ospf6 neighbor detail” output have been modified to show BFD information.

CM-6952 - IBGP peers were always assumed to be multi-hop since there was no easy way to determine whether an IBGP peer was single hop or multihop unlike EBGP. But, this is causing problem with IBGP link local peers since BFD doesn't allow multihop BFD session with link local IP addresses. Link local peers were discovered when the interface peering was enabled. Interface peering is always singlehop. So, added checks to treat all interface based peers as single hop irrespective of whether the peer is IBGP or EBGP.
2015-08-31 14:56:11 -07:00
Donald Sharp 6e9197093c Fixup code to use correct XMALLOC operators
Ticket: CM-7177
Reviewed-by: CCR-3396
Testing: See bug

This code change does several small things:
(A) Fix a couple detected memory leaks
(B) Fix all malloc operations to use the correct XMALLOC operation in bgpd and parts of lib
(C) Adds a few new memory types to make it easier to detect issues
2015-08-26 07:44:57 -07:00
Donald Sharp c43ed2e48a This patch changes BGP from only listening mode for BFD status updates to interactive mode of dynamically registering/deregistering BFD enabled peers with PTM/BFD through zebra. Peer is registered with BFD when it goes into established state and de-registers when it goes out of establish state.
This patch also adds BFD multihop support for BGP. Whether a peer is multi-hop or single hop is determined internally. All IGP peers are considered as multi-hop peers. EBGP peers are considered as single hop unless configured as multi-hop.

BGP BFD command enhancement to configure BFD parameters (detect multiplier, min rx and min tx).

router bgp <as-number>
  neighbor <name/ip-address> bfd <detect mult> <min rx> <min tx>

Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
Reviewed-by:   Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by:   Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by:   Kanna Rajagopal <kanna@cumulusnetworks.com>
2015-06-12 07:59:11 -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 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 16286195e4 Overhual BGP debugs
Summary of changes
- added an option to enable keepalive debugs for a specific peer
- added an option to enable inbound and/or outbound updates debugs for a specific peer
- added an option to enable update debugs for a specific prefix
- added an option to enable zebra debugs for a specific prefix
- combined "deb bgp", "deb bgp events" and "deb bgp fsm" into "deb bgp neighbor-events". "deb bgp neighbor-events" can be enabled for a specific peer.
- merged "deb bgp filters" into "deb bgp update"
- moved the per-peer logging to one central log file. We now have the ability to filter all verbose debugs on a per-peer and per-prefix basis so we no longer need to keep log files per-peer. This simplifies troubleshooting by keeping all BGP logs in one location.  The use
r can then grep for the peer IP they are interested in if they wish to see the logs for a specific peer.
- Changed "show debugging" in isis to "show debugging isis" to be consistent with all other protocols.  This was very confusing for the user because they would type "show debug" and expect to see a list of debugs enabled across all protocols.
- Removed "undebug" from the parser for BGP.  Again this was to be consisten with all other protocols.
- Removed the "all" keyword from the BGP debug parser.  The user can now do "no debug bgp" to disable all BGP debugs, before you had to type "no deb all bgp" which was confusing.

The new parse tree for BGP debugging is:

deb bgp as4
deb bgp as4 segment
deb bgp keepalives [A.B.C.D|WORD|X:X::X:X]
deb bgp neighbor-events [A.B.C.D|WORD|X:X::X:X]
deb bgp nht
deb bgp updates [in|out] [A.B.C.D|WORD|X:X::X:X]
deb bgp updates prefix [A.B.C.D/M|X:X::X:X/M]
deb bgp zebra
deb bgp zebra prefix [A.B.C.D/M|X:X::X:X/M]
2015-05-19 17:58:12 -07:00
Donald Sharp a80beece64 'neighbor <if-name> interface' config support in BGP including RA/Zebra changes.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
             Dinesh Dutt <ddutt@cumulusnetworks.com>
2015-05-19 17:40:40 -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
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
David Lamparter 4d474fa329 lib: fix backtraces broken by 837d16c...
837d16c ("*: use array_size() helper macro") accidentally changed one of
the expressions in the backtrace code, which afterwards read:

zlog_backtrace_sigsafe():
  if (((size = backtrace(array,array_size(array)) <= 0) ||

which boils down to: (size = backtrace(...)  <= 0).  The braces were
intended to go:      (size = backtrace(...)) <= 0.

All in all, this makes a nice textbook example of the original author
being too clever (trying to save a single line by pulling the assignment
into the condition) and the next person touching the code tripping over
it...

This code occurs another time in zlog_backtrace() where it is actually
correct.  Pulling out the assignment nonetheless.  Also, new test
program.

Cc: Andrew J. Schorr <ajschorr@alumni.princeton.edu>
Cc: Balaji.G <balajig81@gmail.com>
Cc: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-03-21 06:28:48 +01:00