summaryrefslogtreecommitdiffstats
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib, zebra: Encode nexthop vrf in nht updatesDonald Sharp2018-11-011-0/+1
| | | | | | | The nexthop vrf was not being encoded in nht updates. Add it in. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: fix fetching enum values for derived typesEmanuele Di Pascale2018-10-271-1/+7
| | | | Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* lib: retrofit interface commands to the new northbound modelRenato Westphal2018-10-274-191/+340
| | | | | | | | | | | | | | The frr-interface YANG module models interfaces using a YANG list keyed by the interface name and the interface VRF. Interfaces can't be keyed only by their name since interface names might not be globally unique when the netns VRF backend is in use. When using the VRF-Lite backend, however, interface names *must* be globally unique. In this case, we need to validate the uniqueness of interface names inside the appropriate northbound callback since this constraint can't be expressed in the YANG language. We must also ensure that only inactive interfaces can be removed, among other things we need to validate in the northbound layer. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* yang, lib: add 'frr-interface.yang' and associated stub callbacksRenato Westphal2018-10-272-1/+62
| | | | | | | | | | | | | Introduce frr-interface.yang, which defines a model for managing FRR interfaces. Update the 'frr_yang_module_info' array of all daemons that will implement this module. Add automatically generated stub callbacks in if.c. These callbacks will be implemented in the following commit. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: add a new northbound plugin for SysrepoRenato Westphal2018-10-274-0/+914
| | | | | | | | | | | | | | | | | | | | | | | This plugin leverages the northbound API to integrate FRR with Sysrepo, a YANG-based configuration and operational state data store. The plugin is linked to the libsysrepo library and communicates with the sysrepod daemon using GPB (Google Protocol Buffers) over AF_UNIX sockets. The integration consists mostly of glue code that calls the appropriate FRR northbound callbacks in response to events triggered by the sysrepod daemon (e.g. request to change the configuration or to fetch operational data). To build the sysrepo plugin, provide the --enable-sysrepo option to the configure script while building FRR (the libsysrepo library needs to be installed in the system). When installed, the sysrepo plugin will be available for all FRR daemons and can be loaded using the -M (or --module) command line option. Example: bgpd -M sysrepo. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: add a new northbound plugin for ConfDRenato Westphal2018-10-274-0/+1221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This plugin leverages the northbound API to integrate FRR with the ConfD management agent. The plugin is linked to the libconfd library and communicates with the confd daemon using local TCP sockets. The integration consists mostly of glue code that calls the appropriate FRR northbound callbacks in response to events triggered by the confd daemon (e.g. request to change the configuration or to fetch operational data). By integrating FRR with the libconfd library, FRR can be managed using all northbound interfaces provided by ConfD, including NETCONF, RESTCONF and their Web API. The ConfD CDB API is used to handle configuration changes and the ConfD Data Provider API is used to provide operational data, process RPCs and send notifications. Support for configuration management using the ConfD Data Provider API is not available at this point. The ConfD optional 'get_object()' and 'get_next_object()' callbacks were implemented for optimal performance when fetching operational data. This plugins requires ConfD 6.5 or later since it uses the new leaf-list API introduced in ConfD 6.5. To install the plugin, the --enable-confd option should be given to the configure script, specifying the location where ConfD is installed. Example: ./configure --enable-confd=/root/confd-6.6 When installed, the confd plugin will be available for all FRR daemons and can be loaded using the -M (or --module) command line option. Example: zebra -M confd. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: introduce new northbound APIRenato Westphal2018-10-2723-18/+7612
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #3235 from opensourcerouting/buildfoo-20181024Lou Berger2018-10-271-0/+1
|\ | | | | build: potpourri
| * build: make clean and dist consistentDavid Lamparter2018-10-241-0/+1
| | | | | | | | | | | | | | We weren't cleaning up some files (a whole lot of python foobar) and had some files in the dist tarball that don't quite belong there. Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #3206 from qlyoung/mac-token-changeDavid Lamparter2018-10-272-4/+4
|\ \ | | | | | | lib: change M:A:C to X:X:X:X:X:X
| * | lib: change M:A:C to X:X:X:X:X:XQuentin Young2018-10-242-4/+4
| |/ | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #3237 from donaldsharp/actual_errorDavid Lamparter2018-10-261-1/+3
|\ \ | | | | | | lib: If command was successful don't store the command as an error
| * | lib: If command was successful don't store the command as an errorDonald Sharp2018-10-251-1/+3
| |/ | | | | | | | | | | | | The CMD_SUCCESS_DAEMON case should be excluded from storing the command line that we think failed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* / *: spelchekDavid Lamparter2018-10-255-6/+6
|/ | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* Merge branch 'pull/3197'David Lamparter2018-10-2311-25/+25
|\ | | | | | | | | | | ...with a nit fix Signed-off-by: David Lamparter <equinox@diac24.net>
| * *: Replace hash_cmp function return value to a boolDonald Sharp2018-10-1911-25/+25
| | | | | | | | | | | | | | | | | | The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | lib: fix the "no match ipv6 next-hop type" commandRenato Westphal2018-10-201-1/+2
|/ | | | | | | | | Trivial NULL pointer dereference bug. Fixes the following crash: bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "no match ipv6 next-hop type" Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #3163 from donaldsharp/more_vty_errorsDavid Lamparter2018-10-194-16/+41
|\ | | | | lib, vtysh: Allow notification across multiple lines of failure
| * lib, vtysh: Allow notification across multiple lines of failureDonald Sharp2018-10-114-16/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reading in config files and we have failures on multiple lines actually note the actual failure lines and return them. This fixes an issue where we stopped counting errors after the first one and we got missleading line numbers that did not correspond to the actual problem. This is fixed: sharpd@donna ~/frr> sudo /usr/lib/frr/pimd --log=stdout -A 127.0.0.1 -f /etc/frr/pimd.conf 2018/10/11 09:41:01 PIM: VRF Created: default(0) 2018/10/11 09:41:01 PIM: pim_vrf_enable: for default 2018/10/11 09:41:01 PIM: zclient_lookup_sched_now: zclient lookup immediate connection scheduled 2018/10/11 09:41:01 PIM: zclient_lookup_new: zclient lookup socket initialized 2018/10/11 09:41:01 PIM: pimd 6.1-dev starting: vty@2611 2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 2: inteface lo 2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 3: ip igmp 2018/10/11 09:41:01 PIM: [EC 100663304] ERROR: No such command on config line 4: ip igmp join 224.1.1.1 13.13.13.2 ^C2018/10/11 09:45:09 PIM: Terminating on signal SIGINT 2018/10/11 09:45:09 PIM: VRF Deletion: default(0) Fixes: #3161 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | lib: add libunwind support for backtracesDavid Lamparter2018-10-182-7/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | libunwind provides an alternate to backtrace() for printing out the call stack of a particular location. It doesn't use the frame pointer, it goes by the DWARF debug info. In most cases the traces have exactly the same information, but there are some situations where libunwind traces are better. (On some platforms, the libc backtrace() also uses the DWARF debug info [e.g.: ARM backtraces are impossible without it] but this is not the case everywhere, especially not on BSD libexecinfo.) Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #3024 from ton31337/fix/validate_route-mapRuss White2018-10-142-0/+15
|\ \ | | | | | | bgpd: Check if route-map really exists before applying to the peer
| * | bgpd: Check if route-map really exists before applying to the peerDonatas Abraitis2018-10-112-0/+15
| |/ | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* / lib, zebra: Allow the specification of BUM floodingDonald Sharp2018-10-123-0/+11
|/ | | | | | | | | | | | | Allow the modification of whether or not we will allow BUM flooding on the vxlan bridge. To do this allow the upper level protocol to specify via the ZEBRA_VXLAN_FLOOD_CONTROL zapi message. If flooding is disabled then BUM traffic will not be forwarded to other VTEP's. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #3098 from opensourcerouting/watchfrr-delayQuentin Young2018-10-042-18/+46
|\ | | | | tools/frr + watchfrr spring cleaning (southern hemisphere)
| * watchfrr, lib: cleanup & delay detachingDavid Lamparter2018-10-022-18/+46
| | | | | | | | | | | | | | | | | | | | | | This cleans up watchfrr to be more "normal" like the other daemons in terms of what it does in main(), i.e. using the full frr_*() call set. Also, this changes the startup behaviour on watchfrr to stay attached on the daemon's parent process until startup is really complete. This should allow removing the "watchfrr.started" hack at some point. Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #3128 from donaldsharp/cpp_notice_build_failureDavid Lamparter2018-10-041-0/+6
|\ \ | | | | | | lib: Include compiler.h as early as is possible in the build
| * | lib: Include compiler.h as early as is possible in the buildDonald Sharp2018-10-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler.h header provides us with some useful macro's that we are using in the system. We do not know exactly where the CPP_NOTICE and CPP_WARN macros are used but they can move around. Place this header early in the build then. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | Merge pull request #3087 from opensourcerouting/bfd-memleakQuentin Young2018-10-041-28/+45
|\ \ \ | |/ / |/| | bfdd: fix memory leak and echo-mode start
| * | lib: refactor thread_executeRafael Zalamena2018-10-031-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't allocate threads in the stack, but use the standardized `thread_get` and `thread_add_unused` to avoid creating corner cases in the thread API. This fixes a thread mutex memory leak in FreeBSD. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
| * | lib: fix a memory leak in FreeBSDRafael Zalamena2018-10-031-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Two important changes: * Centralize the thread teardown procedure; * Save and restore thread mutex context to avoid losing the memory pointer; Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | | Merge pull request #3120 from opensourcerouting/remove-list-deleteLou Berger2018-10-0215-61/+26
|\ \ \ | | | | | | | | lib: remove deprecated list_delete()/list_free()
| * | | *: list_delete_and_null() -> list_delete()David Lamparter2018-10-0215-26/+26
| | | | | | | | | | | | | | | | Signed-off-by: David Lamparter <equinox@diac24.net>
| * | | lib: remove deprecated list_delete()/list_free()David Lamparter2018-10-022-35/+0
| | |/ | |/| | | | | | | | | | | | | Deprecation time has passed. Signed-off-by: David Lamparter <equinox@diac24.net>
* | | Merge pull request #3116 from opensourcerouting/libfrr-execLou Berger2018-10-022-1/+23
|\ \ \ | |/ / |/| | lib: print version information in libfrr.so
| * | lib: print version information in libfrr.soDavid Lamparter2018-10-022-1/+23
| |/ | | | | | | | | | | | | This makes libfrr.so executable to print its version info. This is useful if you need to check your libfrr.so matches your daemons. Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #3102 from ton31337/feature/match_blackhole_nexthopsDavid Lamparter2018-10-022-0/+153
|\ \ | | | | | | bgpd: Match routes by type under route-maps
| * | bgpd: Match routes by type under route-mapsDonatas Abraitis2018-10-022-0/+153
| | | | | | | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | | build: add --enable-static-bin optionDavid Lamparter2018-10-011-2/+13
| |/ |/| | | | | | | | | | | | | | | This option can be used to get statically linked binaries. Note: libfrr.la is removed from modules' library dependency list. This is intentional and explained in a comment in lib/subdir.am. Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #3106 from pacovn/Coverity_1446184_Copy-paste_errorDavid Lamparter2018-10-011-1/+1
|\ \ | | | | | | lib: RB-tree copy-paste error (Coverity 1446184)
| * | lib: RB-tree copy-paste error (Coverity 1446184)F. Aragon2018-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overview: Coverity points a copy-paste error in the Red-Black tree implementation. The RB tree code is based on the OpenBSD implementation, so at first glance, it is a strong point for thinking twice before touching anything. Details: The code is an augmented RB tree implementation [1], which adds to RB trees the possibility of using a callback on every node update for updating per-node associated metainformation. The bug is clear once checking other places where the callback is called. Impact: - FRR: no impact, because the "augmented" capability is not being used. - OpenBSD [2]: it seems there is no impact, at least in the 'src' repository. Additional observations: - If the "augmented" capability is not used, the code could run faster (at every operation on a node the callback is checked for not being NULL). May be branch prediction could be enough for those extra operations being negligible on most processors in use. [1] http://kaba.hilvi.org/pastel-1.3.0/pastel/sys/redblacktree.htm [2] GH mirror: https://github.com/openbsd/src/blob/master/sys/kern/subr_tree.c Signed-off-by: F. Aragon <paco@voltanet.io>
* | | Merge pull request #3034 from donaldsharp/LUADavid Lamparter2018-10-013-0/+211
|\ \ \ | |/ / |/| | Add initial thoughts on having lua act as a replacement for route-maps
| * | lua: Initial Lua importDonald Sharp2018-09-273-0/+211
| |/ | | | | | | | | | | This code sets up the ability to use lua inside of FRR. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* / lib: Allow some usage statistics for route-mapsDonald Sharp2018-09-252-3/+15
|/ | | | | | | | | | | Keep track of how often route-maps are applied and how often each clause of a route-map is applied. This change showed that `show route-map` was outputting odd data so fix that output and add in the applied times too. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #3081 from donaldsharp/table_table_tableRenato Westphal2018-09-255-8/+18
|\ | | | | bgpd, lib, zebra: Wrapper get/set of table->info pointer
| * bgpd, lib, zebra: Wrapper get/set of table->info pointerDonald Sharp2018-09-245-8/+18
| | | | | | | | | | | | | | Wrapper the get/set of the table->info pointer so that people are not directly accessing this data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #3064 from NaveenThanikachalam/3049Russ White2018-09-241-1/+12
|\ \ | | | | | | lib: Trigger callbacks to re-evaluate route-map clauses when "call" CLI is executed.
| * | lib: Trigger callbacks to re-evaluate route-map clauses when "call" CLI is ↵Naveen Thanikachalam2018-09-211-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | executed. When the "call" CLI is executed from with-in a route-map that is already in use, there is a need to get the route-map clients to re-evalute the clauses defined by both the parent route-map, as well as the child route-map. The existing callbacks, add_hook() and delete_hook() can be used by the lib to inform the clients when the "call" is configured and unconfigured. Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
* | | Merge pull request #3073 from donaldsharp/pid_cleanupRuss White2018-09-242-32/+1
|\ \ \ | |_|/ |/| | Pid cleanup
| * | lib: When we can't lock the pid file provide a meaningfull messageDonald Sharp2018-09-221-1/+1
| | | | | | | | | | | | | | | | | | Give a hint to the end user that the daemon may already be running. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | Revert "lib: Ensure FRR detects running of the second instance of a FRR ↵Donald Sharp2018-09-221-31/+0
| | | | | | | | | | | | | | | | | | daemon, doesnot allow it to run." This reverts commit 6e23e5e9e16fb16aafb4ef05ceb3514a02147a21.