summaryrefslogtreecommitdiffstats
path: root/ripngd/ripng_zebra.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* *: Track vrfs per nexthop not per route entryDonald Sharp2018-02-091-1/+1
| | | | | | | Track the vfrs on a per nexthop basis instead of on a per route entry basis. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Send/receive the nexthop vrf_idDonald Sharp2018-01-121-0/+1
| | | | | | | Modify the code to send and receive to/from zebra the nexthops vrf_id. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Make zapi route install Notifications optionalDonald Sharp2017-11-271-1/+1
| | | | | | | | | | | Allow the higher level protocol to specify if it would like to receive notifications about it's routes that it has installed. I've purposely made it part of zclient_new_notify because we need to track the routes on a per daemon basis only. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Modify zclient_init to require privs dataDonald Sharp2017-10-241-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: fix segfault when sending more than MULTIPATH_NUM nexthopsRenato Westphal2017-09-211-0/+2
| | | | | | | | | | | | | This is a fallout from PR #1022 (zapi consolidation). In the early days, the client daemons would allocate enough memory to send all nexthops to zebra. Then zebra would add all nexthops to the RIB and respect MULTIPATH_NUM only when installing the routes in the kernel. Now things are different and the client daemons can send at most MULTIPATH_NUM nexthops to zebra, and failure to respect that will result in a buffer overflow. The MULTIPATH_NUM limit in the new zebra API is a small price we pay to avoid allocating memory for each route sent to zebra. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use zapi_route to send/receive redistributed routes as wellRenato Westphal2017-08-241-58/+18
| | | | | | | | | | | | | | | | | | 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>
* ripd/ripngd: use the new API to send routes to zebraRenato Westphal2017-08-231-33/+18
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: remove leftovers from "router zebra"Renato Westphal2017-08-231-56/+0
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: reduce excessive indentation in a few placesRenato Westphal2017-08-231-93/+88
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-2/+1
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. 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>
* *: reindent pt. 2whitespace / reindent2017-07-171-1/+2
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-384/+374
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-5/+5
|\ | | | | | | | | | | Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: return non-zero for configuration failuresDaniel Walton2017-07-131-5/+5
| | | | | | | | | | | | | | 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.
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-12/+12
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripngd: Fix zclient cleanup on shutdownDonald Sharp2017-06-301-0/+7
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use vty_outlnQuentin Young2017-06-291-18/+15
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | 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>
* *: read and ignore srcdest routes on ZAPIChristian Franke2017-01-301-1/+13
| | | | | | | | | | | | | | Since zebra might be sending srcdest routes down to the various daemons, they need to understand the presence of the field at the very least. Sadly, that's also the best we can do at this point since none of the protocols has support for handling srcdest routes. The only consistent thing to do is to ignore them throughout. If an administrator wants to have the srcdest route as non-srcdest in a protocol, setting a non-srcdest static route (possibly blackhole) is probably the best way to go. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: send ZAPI IPv6 source prefixDavid Lamparter2017-01-301-1/+1
| | | | | | | | | | | | This introduces ZAPI_MESSAGE_SRCPFX, and if set adds a source prefix field to ZAPI IPv6 route messages sent from daemons to zebra. The function calls all have a new prefix_ipv6 * argument specifying the source, or NULL. All daemons currently supply NULL. Zebra support for processing the field was added in the previous patch, however, zebra does not do anything useful with the value yet. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Fix redistribute issueDonald Sharp2017-01-271-5/+5
| | | | | | | | | | 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>
* Merge branch 'master' into fix-proto_redistnumQuentin Young2017-01-071-8/+5
|\
| * Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp2017-01-061-8/+5
| |\
| | * build: rename (2 of ?): route_types macrosDavid Lamparter2016-12-201-16/+16
| | | | | | | | | | | | | | | | | | | | | 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>
* | | all: use ->text when parsing protocol argumentQuentin Young2016-12-161-4/+7
|/ / | | | | | | | | | | and match on full protocol name in proto_redistnum() Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge branch 'cmaster-next' into vtysh-grammarQuentin Young2016-10-181-9/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * ripngd: add support for route tagsChristian Franke2016-10-081-1/+12
| | | | | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
| * bgpd: add L3/L2VPN Virtual Network Control featureLou Berger2016-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Make route flags a 32bit fieldChristian Franke2016-09-231-1/+1
| | | | | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
| * lib: Check prefix length from zebra is sensiblePaul Jakma2016-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * zclient.c: prefix length on router-id and interface address add messages not sanity checked. fix. * */*_zebra.c: Prefix length on zebra route read was not checked, and clients use it to write to storage. An evil zebra could overflow client structures by sending overly long prefixlen. Prompted by discussions with: Donald Sharp <sharpd@cumulusnetworks.com>
| * Revert "Make route flags a 32bit field"Donald Sharp2016-09-231-1/+1
| | | | | | | | This reverts commit 85eda2c98520a9553bdc05c136618f9d04917e9b.
| * Make route flags a 32bit fieldChristian Franke2016-09-231-1/+1
| | | | | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
| * *: remove dead codeRenato Westphal2016-09-231-6/+0
| | | | | | | | | | | | | | | | Since recently zebra uses only the ZEBRA_REDISTRIBUTE_* messages to advertise redistributed routes to its clientes. Now the old ZEBRA_IPV*_ROUTE_* messages are only used for client->zebra communication. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | all: removed all DEFUN command stompsDaniel Walton2016-10-061-26/+0
| | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | ripd, ripngd: cli refactorQuentin Young2016-09-271-37/+16
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Expand #defines in command stringsDaniel Walton2016-09-251-8/+8
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | ripngd: add 'int idx_foo' argv index variablesDaniel Walton2016-09-231-10/+17
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | convert <1-255> to (1-255), ()s to <>s, etcDaniel Walton2016-09-231-2/+2
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | ALIAS removal for bgp, ospf, pim, isis, rip, ripng, lib and zebraDaniel Walton2016-09-231-27/+24
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | ripngd: argv updateDaniel Walton2016-09-231-14/+14
|/ | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-08-181-1/+1
| | | | (cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
* ripngd: allow to enable/disable the ECMP featureFeng Lu2016-06-081-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new command "[no] allow-ecmp" to enable/disable the ECMP feature in RIPng. By default, ECMP is not allowed. Once ECMP is disabled, only one route entry can exist in the list. * ripng_zebra.c: adjust a debugging information, which shows the number of nexthops according to whether ECMP is enabled. * ripngd.c: ripng_ecmp_add() will reject the new route if ECMP is not allowed and some entry already exists. A new configurable command "allow-ecmp" is added to control whether ECMP is allowed. When ECMP is disabled, ripng_ecmp_disable() is called to remove the multiple nexthops. * ripngd.h: Add a new member "ecmp" to "struct ripng", indicating whether ECMP is allowed or not. 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> (cherry picked from commit 72855b16b72e9ad2c7eb0c0bfd8f5985f779608f)
* ripngd: add ECMP supportFeng Lu2016-06-081-30/+61
| | | | | | | | | | | | | | | | | | | | | | | | * Each node in the routing table is changed into a list, holding the multiple equal-cost paths. * If one of the multiple entries gets less-preferred (greater metric or greater distance), it will be directly deleted instead of starting a garbage-collection timer for it. The garbage-collection timer is started only when the last entry in the list gets INFINITY. * Some new functions are used to maintain the ECMP list. And hence ripng_route_process(), ripng_redistribute_add() and ripng_timeout() are significantly simplified. * ripng_zebra_ipv6_add() and ripng_zebra_ipv6_delete() now can share the common code. The common part is moved to ripng_zebra_ipv6_send(). 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>
* Update ripng_zebra.cHongguang Li2016-03-181-1/+7
| | | | Make route redistribution not go through del/add cycle during updates
* Quagga: Support VRF unregister for clientsvivek2016-02-121-1/+1
| | | | | | | | | | | | | Clients (BGP, OSPF etc.) register with Zebra for information about a VRF such as Router ID, interfaces and redistribution. Add API to support unregister also which is required for the non-default VRF. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-9128 Reviewed By: CCR-4098 Testing Done: Manual testing
* quagga: remove babelDaniel Walton2016-02-111-1/+0
| | | | | | | | Ticket: CM-9274 Reviewed By: sharpd@cumulusnetworks.com Testing Done: <DETAILED DESCRIPTION (REPLACE)>
* Quagga: vrf_id not being set correctlyDonald Sharp2015-11-201-0/+1
| | | | | | | | | | | | | | | Several routing protocols use the zapi_ipv[4|6] api to talk to zebra. There are some instances where the api.vrf_id was not being set. Since the practice is to declare the api structure on the stack, the data inside is not being set to 0. As such random vrf_id values were being passed to zebrad causing rage and confusion. Ticket: CM-8287 Reviewed-by: CCR-3841 Testing: Test suites no longer crashing and burning Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: add VRF ID in the API message headerFeng Lu2015-11-041-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API messages are used by zebra to exchange the interfaces, addresses, routes and router-id information with its clients. To distinguish which VRF the information belongs to, a new field "VRF ID" is added in the message header. And hence the message version is increased to 3. * The new field "VRF ID" in the message header: Length (2 bytes) Marker (1 byte) Version (1 byte) VRF ID (2 bytes, newly added) Command (2 bytes) - Client side: - zclient_create_header() adds the VRF ID in the message header. - zclient_read() extracts and validates the VRF ID from the header, and passes the VRF ID to the callback functions registered to the API messages. - All relative functions are appended with a new parameter "vrf_id", including all the callback functions. - "vrf_id" is also added to "struct zapi_ipv4" and "struct zapi_ipv6". Clients need to correctly set the VRF ID when using the API functions zapi_ipv4_route() and zapi_ipv6_route(). - Till now all messages sent from a client have the default VRF ID "0" in the header. - The HELLO message is special, which is used as the heart-beat of a client, and has no relation with VRF. The VRF ID in the HELLO message header will always be 0 and ignored by zebra. - Zebra side: - zserv_create_header() adds the VRF ID in the message header. - zebra_client_read() extracts and validates the VRF ID from the header, and passes the VRF ID to the functions which process the received messages. - All relative functions are appended with a new parameter "vrf_id". * Suppress the messages in a VRF which a client does not care: Some clients may not care about the information in the VRF X, and zebra should not send the messages in the VRF X to those clients. Extra flags are used to indicate which VRF is registered by a client, and a new message ZEBRA_VRF_UNREGISTER is introduced to let a client can unregister a VRF when it does not need any information in that VRF. A client sends any message other than ZEBRA_VRF_UNREGISTER in a VRF will automatically register to that VRF. - lib/vrf: A new utility "VRF bit-map" is provided to manage the flags for VRFs, one bit per VRF ID. - Use vrf_bitmap_init()/vrf_bitmap_free() to initialize/free a bit-map; - Use vrf_bitmap_set()/vrf_bitmap_unset() to set/unset a flag in the given bit-map, corresponding to the given VRF ID; - Use vrf_bitmap_check() to test whether the flag, in the given bit-map and for the given VRF ID, is set. - Client side: - In "struct zclient", the following flags are changed from "u_char" to "vrf_bitmap_t": redist[ZEBRA_ROUTE_MAX] default_information These flags are extended for each VRF, and controlled by the clients themselves (or with the help of zclient_redistribute() and zclient_redistribute_default()). - Zebra side: - In "struct zserv", the following flags are changed from "u_char" to "vrf_bitmap_t": redist[ZEBRA_ROUTE_MAX] redist_default ifinfo ridinfo These flags are extended for each VRF, as the VRF registration flags. They are maintained on receiving a ZEBRA_XXX_ADD or ZEBRA_XXX_DELETE message. When sending an interface/address/route/router-id message in a VRF to a client, if the corresponding VRF registration flag is not set, this message will not be dropped by zebra. - A new function zread_vrf_unregister() is introduced to process the new command ZEBRA_VRF_UNREGISTER. All the VRF registration flags are cleared for the requested VRF. Those clients, who support only the default VRF, will never receive a message in a non-default VRF, thanks to the filter in zebra. * New callback for the event of successful connection to zebra: - zclient_start() is splitted, keeping only the code of connecting to zebra. - Now zclient_init()=>zclient_connect()=>zclient_start() operations are purely dealing with the connection to zbera. - Once zebra is successfully connected, at the end of zclient_start(), a new callback is used to inform the client about connection. - Till now, in the callback of connect-to-zebra event, all clients send messages to zebra to request the router-id/interface/routes information in the default VRF. Of corse in future the client can do anything it wants in this callback. For example, it may send requests for both default VRF and some non-default VRFs. 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: Donald Sharp <sharpd@cumulusnetworks.com> Conflicts: lib/zclient.h lib/zebra.h zebra/zserv.c zebra/zserv.h Conflicts: bgpd/bgp_nexthop.c bgpd/bgp_nht.c bgpd/bgp_zebra.c isisd/isis_zebra.c lib/zclient.c lib/zclient.h lib/zebra.h nhrpd/nhrp_interface.c nhrpd/nhrp_route.c nhrpd/nhrpd.h ospf6d/ospf6_zebra.c ospf6d/ospf6_zebra.h ospfd/ospf_vty.c ospfd/ospf_zebra.c pimd/pim_zebra.c pimd/pim_zlookup.c ripd/rip_zebra.c ripngd/ripng_zebra.c zebra/redistribute.c zebra/rt_netlink.c zebra/zebra_rnh.c zebra/zebra_rnh.h zebra/zserv.c zebra/zserv.h
* lib: zclient.c remove extern struct thread_master *Donald Sharp2015-09-231-2/+2
| | | | | | | | | | | | zclient.c depended upon link time inclusion of a extern struct thread_master *master. This is a violation of the namespace of the calling daemon. If a library needs the pointer pass it in and save it for future use. This code change also makes the zclient code consistent with the other lib functions that need to schedule work on your behalf Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>