summaryrefslogtreecommitdiffstats
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib: update Solaris multicast API (BZ#725)Christian Franke2016-09-231-0/+34
| | | | | | | | | | | | | | | | | | On OpenIndiana/Solaris the build fails with "unsupported multicast API". It's only in the IPv4 part where setsockopt IP_MULTICAST_IF needs a local address and not the index (IPv6 wants the index). The following code walks the list of interfaces until it finds the matching index and uses the interface's local address for the setsockopt call. I don't know if it works on Solaris < 10 (I guess yes, but I don't have any machine to verify it). [NB: this breaks unnumbered setups that use the same IPv4 address on multiple interfaces. -- equinox@opensourcerouting.org] Reported-by: Brian Utterback <brian.utterback@oracle.com> Signed-off-by: Christian Franke <chris@opensourcerouting.org> Patchwork #762
* lib: fix ICC warning in route-map codeDavid Lamparter2016-09-231-1/+1
| | | | | | | | | | ICC thinks we're storing a pointer and might be losing bits at the top: error #810: conversion from "void *" to "route_map_event_t={enum <unnamed>}" may lose significant bits Build is warning-free on ICC 14.0.3 (for Linux x86_64) with this. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Revert "Make route flags a 32bit field"Donald Sharp2016-09-232-5/+5
| | | | This reverts commit 85eda2c98520a9553bdc05c136618f9d04917e9b.
* Revert "zebra: support FIB override routes"Donald Sharp2016-09-231-1/+0
| | | | This reverts commit 7569ae8bb7390224e16ee416cc0745d427a29818.
* zebra: support FIB override routesTimo Teräs2016-09-231-0/+1
| | | | | | | | | | | | | | | | | | 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>
* Make route flags a 32bit fieldChristian Franke2016-09-232-5/+5
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* zebra: check at startup if the kernel supports MPLSRenato Westphal2016-09-231-2/+2
| | | | | | | | Replace all HAVE_MPLS #ifdef's by a run-time check if MPLS is supported by the kernel or not. This way we don't need to create multiple packages for each OS distribution. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: remove dead codeRenato Westphal2016-09-232-20/+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>
* zebra: fix bug in nexthop label allocationßingen2016-09-231-1/+2
| | | | Label array in nexthop_label struct was not being allocated.
* mpls: add support to the OpenBSD kernelRenato Westphal2016-09-231-0/+6
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* mpls: add support for LDP LSPsRenato Westphal2016-09-235-6/+26
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ldpd: adapt the code for QuaggaRenato Westphal2016-09-2312-29/+158
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ldpd: copy original sources from OpenBSD (14/09/2016)Renato Westphal2016-09-235-0/+2004
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* MPLS: Install labeled static routesvivek2016-09-231-0/+3
| | | | | | | | | | | | 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
* Quagga: Install label forwarding entries for statically configured LSPsvivek2016-09-232-1/+33
| | | | | | | | | | | | | Install the statically configured LSPs into the FIB (kernel). This is done using the new attributes and definitions for MPLS in the kernel - RTA_VIA, RTA_NEWDST and AF_MPLS. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-4804 Reviewed By: CCR-3088 Testing Done: Manual in SE-1
* Quagga: Static LSP configurationvivek2016-09-231-0/+2
| | | | | | | | | | | | | | | | | 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
* Quagga: Definitions for static LSPsvivek2016-09-231-0/+9
| | | | | | | | | Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-4804, ... Reviewed By: CCR-3084 Testing Done: Not relevant
* Quagga: Basic definitions for MPLSvivek2016-09-231-0/+172
| | | | | | | | | Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-4804, ... Reviewed By: CCR-3083 Testing Done: Not relevant
* lib: Add #define str for JavaScript help stringDonald Sharp2016-09-211-0/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: deregister memtypes on exit/unloadDavid Lamparter2016-09-191-6/+25
| | | | | | | | | | This is useful for DSO modules in order to get support for unloading them dynamically. It also runs on exit, which doesn't matter much. At some future point, the code could be extended to check that allocation counts are 0 on unloading a module. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: clean/restore memory debugging functionsDavid Lamparter2016-09-194-89/+37
| | | | | | | | | | | | This adapts the dump-at-exit handler and removes the old leftover code. (Note the text in log_memtype_stderr was actually incorrect as the only caller in bgpd cleans up configuration before calling it, i.e. any remaining allocations are missing-cleanup bugs.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: split & distribute memtypes and stop (re|ab)using lib/ MTYPEsDavid Lamparter2016-09-1940-311/+131
| | | | | | | | | | | | | | | | | | | 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>
* lib: migrate to new memory-type handlingDavid Lamparter2016-09-197-722/+302
| | | | | | | | | Move over to the new allocation counting added in the previous commit. (This commit is mostly mechanical.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
* lib: add new extensible memory-type handlingDavid Lamparter2016-09-196-4/+317
| | | | | | | | | | | | 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>
* lib: move memory.[ch] out of the wayDavid Lamparter2016-09-194-99/+101
| | | | | | | | The following commit will recreate memory.[ch]. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd, lib, vtysh: Allow extract.pl to fully workDonald Sharp2016-09-172-19/+19
| | | | | | | | | The regular expression for finding DEFUN/ALIAS in extract.pl looks for "DEFUN (" or "ALIAS (" if the *.c file does not have this then it will just silently ignore the cli. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, bgpd: Remove 'struct fifo' from lib/zebra.hDonald Sharp2016-09-173-40/+64
| | | | | | | | The 'struct fifo' and it's accompanying #defines do not belong in lib/zebra.h. Move them into their own header. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit b0d02889624eaafa0984873dcd78c086418bdf13)
* lib: Remove ZEBRA_INTERFACE_RENAMEDonald Sharp2016-09-172-2/+0
| | | | | | Api in name only. No code, so let's remove. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, ospfd: Remove ospf specific #define from zebra.hDonald Sharp2016-09-171-20/+0
| | | | | | zebra.h should not know or care about ospf specific code Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, zebra: Remove ZEBRA_IPV[4|6]_IMPORT_NEXTHOPDonald Sharp2016-09-152-4/+0
| | | | | | | Zebra api that was never used. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 33361d3992c8bff66247b76e5adaf4b0de8217df)
* lib, zebra: Remove unused zserv/zclient callsDonald Sharp2016-09-152-4/+0
| | | | | | | | 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)
* lib: Make zebra messages types a enumDonald Sharp2016-09-151-51/+52
| | | | | | | | | The #define nature of zebra message types makes it stupidly difficult to add /remove message types. Switch to enum Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 0d63e3c7df981f5b50f27789672f30987911a8cd)
* lib: Fix tab completions memleak, memory stats corruptionQuentin Young2016-09-091-4/+10
| | | | | Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrf: add a runtime check before playing with netnsNicolas Dichtel2016-09-091-37/+57
| | | | | | | | | | | This patch adds a runtime check to determine if netns are available. Some systems like OpenWRT have the system call setns() but don't have the kernel option CONFIG_NET_NS enabled. Reported-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Tested-by: Christian Franke <chris@opensourcerouting.org> (cherry picked from commit 04a3aabf58d95d01c4c8168eeff43cf9d9892eee)
* lib, vtysh: support multiple VRFs by using linux netnsFeng Lu2016-09-094-18/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | We realize VRFs with linux netns by default. The main job is to associate a VRF with a netns. Currently this is done by the configuration: [no] vrf N netns <netns-name> This command is also available in vtysh and goes to only zebra, because presently only zebra supports multiple VRF. A file descriptor is added to "struct vrf". This is for the associated netns file. Once the command "vrf N netns NAME" is executed, the specified file is opened and the file descriptor is stored in the VRF N. In this way the association is formed. In vrf_socket(), we first switch to the specified VRF by using the stored file descriptor, and then can allocate a socket which is working in the associated netns. 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> (cherry picked from commit 55cfa2f190620f7c711944637659bc208970324d)
* lib: Create ns.cDonald Sharp2016-09-094-2/+650
| | | | | | | | Create the ns.c files from the original vrf.c code to allow us to create the 'logical-router' command to work within namespaces. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* quagga: remove refix directory from git statusDonald Sharp2016-09-091-0/+1
| | | | | | | | | During one of our build processes we are getting a refix directory in some places. Remove these from files that git considers Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 844cbf5d6cdfc6961e99e1c9ed35b826f3aa7562)
* Merge remote-tracking branch 'origin/cmaster' into cmaster-nextDonald Sharp2016-09-092-0/+37
|\
| * lib, bgpd: Log next hopsvivek2016-09-082-0/+37
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-12390 Reviewed By: CCR-5156 Testing Done: Manual
* | lib: add AF_ETHERNET/AFI_ETHERLou Berger2016-09-034-3/+162
| |
* | lib: dump memory stats on coreLou Berger2016-09-031-0/+2
| |
* | lib: fix memory leak in zprivs_caps_initLou Berger2016-09-031-0/+7
| |
* | Update Traffic Engineering Support for OSPFDOlivier Dugeon2016-09-0312-33/+356
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: I am squashing several commits together because they do not independently compile and we need this ability to do any type of sane testing on the patches. Since this series builds together I am doing this. -DBS This new structure is the basis to get new link parameters for Traffic Engineering from Zebra/interface layer to OSPFD and ISISD for the support of Traffic Engineering * lib/if.[c,h]: link parameters struture and get/set functions * lib/command.[c,h]: creation of a new link-node * lib/zclient.[c,h]: modification to the ZBUS message to convey the link parameters structure * lib/zebra.h: New ZBUS message Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Add support for IEEE 754 format * lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to safely convert between big-endian IEEE-754 single and double binary format, as used in IETF RFCs, and C99. Implementation depends on host using __STDC_IEC_559__, which should be everything we care about. Should correctly error out otherwise. * lib/network.[c,h]: Add ntohf and htonf converter * lib/memtypes.c: Add new memeory type for Traffic Engineering support Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Add link parameters support to Zebra * zebra/interface.c: - Add new link-params CLI commands - Add new functions to set/get link parameters for interface * zebra/redistribute.[c,h]: Add new function to propagate link parameters to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering. * zebra/redistribute_null.c: Add new function zebra_interface_parameters_update() * zebra/zserv.[c,h]: Add new functions to send link parameters Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Add support of new link-params CLI to vtysh In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue to use the ordered version for adding line i.e. config_add_line_uniq() to print Interface CLI commands as it completely break the new LINK_PARAMS_NODE. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Update Traffic Engineering support for OSPFD These patches update original code to RFC3630 (OSPF-TE) and add support of RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support of RFC6827 (ASON - GMPLS). * ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering * ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392 * ospfd/ospf_packet.c: Update checking of OSPF_OPTION * ospfd/ospf_vty.[c,h]: Update ospf_str2area_id * ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get Link Parameters information from the interface to populate Traffic Engineering metrics * ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN) * ospfd/ospf_te.[c,h]: Major modifications to update the code to new link parameters structure and new RFCs Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> tmp
* | lib, zebra: unify link layer type and hardware address handlingTimo Teräs2016-09-033-16/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the BSD specific usage of struct sockaddr_dl hardware address. This unifies to use explict hw_addr member for the address, and zebra specific enumeration for the link layer type. Additionally the zapi is updated to never send platform specific structures over the wire, but the ll_type along with hw_addr_len and hw_addr are now sent for all platforms. Based on initial work by Paul Jakma. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Author: Timo Teräs <timo.teras@iki.fi> # # rebase in progress; onto 9c2f85d # You are currently editing a commit while rebasing branch 'renato' on '9c2f85d'. # # Changes to be committed: # modified: isisd/isis_circuit.c # modified: lib/if.c # modified: lib/if.h # modified: lib/zclient.c # modified: zebra/interface.c # modified: zebra/interface.h # modified: zebra/kernel_socket.c # modified: zebra/rt_netlink.c # modified: zebra/rtadv.c # modified: zebra/zserv.c # # Untracked files: # "\033\033OA\033OB\033" # 0001-bgpd-fix-build-on-Solaris.patch # ldpd/ # redhat/ldpd.init # redhat/ldpd.service # tags #
* | lib/memory: fix indirect static link with zlibBaruch Siach2016-09-022-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | quagga SNMP support depends on netsnmp, that optionally depends on OpenSSL, which in turn requires zlib. zlib exports the 'zcalloc' symbol, which collides with a function of the same name in memory.c. This is not a problem when linking dynamically, since quagga does not use zlib directly. But static linking fails with the error: CCLD ospfd .../output/host/usr/mips64el-buildroot-linux-uclibc/sysroot/usr/lib/libz.a(zutil.o): In function `zcalloc': zutil.c:(.text+0x48): multiple definition of `zcalloc' .../output/build/quagga-1.0.20160315/lib/.libs/libzebra.a(memory.o):memory.c:(.text+0x1a0): first defined here Rename 'zcalloc' to 'zzcalloc' to avoid symbol collision. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
* | bgpd, lib, ospfd, pimd, zebra: Use nexthop_types_tDonald Sharp2016-09-022-17/+10
| | | | | | | | | | | | | | | | | | Use the 'enum nexthop_types_t' instead of the zebra.h #defines. And remove code from zebra.h that does not belong there. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | lib: Remove unused ZEBRA_NEXTHOP_IPV4_ONLINK typeDonald Sharp2016-09-021-1/+0
| | | | | | | | | | | | | | Remove the unused ZEBRA_NEXTHOP_IPV4_ONLINK type from the system. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | build/solaris: fix one error and a few warningsRenato Westphal2016-08-271-2/+2
| | | | | | | | Signed-off-by: Renato Westphal <renato@openbsd.org>
* | quagga route-map on-match and continue statements accept 65536Daniel Walton2016-08-221-2/+2
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-12581
* | zebra: implement per-route mtu handlingTimo Teräs2016-08-212-0/+13
| | | | | | | | | | | | | | | | | | 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)