summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-11-08Merge pull request #3202 from donaldsharp/evpn_dumpRuss White
Evpn dump
2018-11-01lib, zebra: Encode nexthop vrf in nht updatesDonald Sharp
The nexthop vrf was not being encoded in nht updates. Add it in. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-31bgpd, lib, vtysh, zebra: Convert to using CMD_VNI_RANGEDonald Sharp
For the vni range use a macro to keep track of it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-27lib: fix fetching enum values for derived typesEmanuele Di Pascale
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-10-27lib: retrofit interface commands to the new northbound modelRenato Westphal
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>
2018-10-27yang, lib: add 'frr-interface.yang' and associated stub callbacksRenato Westphal
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>
2018-10-27lib: add a new northbound plugin for SysrepoRenato Westphal
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>
2018-10-27lib: add a new northbound plugin for ConfDRenato Westphal
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>
2018-10-27lib: introduce new northbound APIRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-27Merge pull request #3235 from opensourcerouting/buildfoo-20181024Lou Berger
build: potpourri
2018-10-27Merge pull request #3206 from qlyoung/mac-token-changeDavid Lamparter
lib: change M:A:C to X:X:X:X:X:X
2018-10-26Merge pull request #3237 from donaldsharp/actual_errorDavid Lamparter
lib: If command was successful don't store the command as an error
2018-10-25*: spelchekDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-24lib: If command was successful don't store the command as an errorDonald Sharp
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>
2018-10-24lib: change M:A:C to X:X:X:X:X:XQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-24build: make clean and dist consistentDavid Lamparter
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>
2018-10-23Merge branch 'pull/3197'David Lamparter
...with a nit fix Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-20lib: fix the "no match ipv6 next-hop type" commandRenato Westphal
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>
2018-10-19*: Replace hash_cmp function return value to a boolDonald Sharp
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>
2018-10-19Merge pull request #3163 from donaldsharp/more_vty_errorsDavid Lamparter
lib, vtysh: Allow notification across multiple lines of failure
2018-10-18lib: add libunwind support for backtracesDavid Lamparter
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>
2018-10-14Merge pull request #3024 from ton31337/fix/validate_route-mapRuss White
bgpd: Check if route-map really exists before applying to the peer
2018-10-11lib, zebra: Allow the specification of BUM floodingDonald Sharp
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>
2018-10-11lib, vtysh: Allow notification across multiple lines of failureDonald Sharp
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>
2018-10-11bgpd: Check if route-map really exists before applying to the peerDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2018-10-04Merge pull request #3098 from opensourcerouting/watchfrr-delayQuentin Young
tools/frr + watchfrr spring cleaning (southern hemisphere)
2018-10-04Merge pull request #3128 from donaldsharp/cpp_notice_build_failureDavid Lamparter
lib: Include compiler.h as early as is possible in the build
2018-10-03Merge pull request #3087 from opensourcerouting/bfd-memleakQuentin Young
bfdd: fix memory leak and echo-mode start
2018-10-03lib: refactor thread_executeRafael Zalamena
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>
2018-10-03lib: fix a memory leak in FreeBSDRafael Zalamena
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>
2018-10-03lib: Include compiler.h as early as is possible in the buildDonald Sharp
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>
2018-10-02Merge pull request #3120 from opensourcerouting/remove-list-deleteLou Berger
lib: remove deprecated list_delete()/list_free()
2018-10-02Merge pull request #3116 from opensourcerouting/libfrr-execLou Berger
lib: print version information in libfrr.so
2018-10-02watchfrr, lib: cleanup & delay detachingDavid Lamparter
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>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02lib: remove deprecated list_delete()/list_free()David Lamparter
Deprecation time has passed. Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02Merge pull request #3102 from ton31337/feature/match_blackhole_nexthopsDavid Lamparter
bgpd: Match routes by type under route-maps
2018-10-02lib: print version information in libfrr.soDavid Lamparter
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>
2018-10-02bgpd: Match routes by type under route-mapsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2018-10-01build: add --enable-static-bin optionDavid Lamparter
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>
2018-10-01Merge pull request #3106 from pacovn/Coverity_1446184_Copy-paste_errorDavid Lamparter
lib: RB-tree copy-paste error (Coverity 1446184)
2018-10-01Merge pull request #3034 from donaldsharp/LUADavid Lamparter
Add initial thoughts on having lua act as a replacement for route-maps
2018-09-28lib: RB-tree copy-paste error (Coverity 1446184)F. Aragon
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>
2018-09-26lua: Initial Lua importDonald Sharp
This code sets up the ability to use lua inside of FRR. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-25lib: Allow some usage statistics for route-mapsDonald Sharp
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>
2018-09-24Merge pull request #3081 from donaldsharp/table_table_tableRenato Westphal
bgpd, lib, zebra: Wrapper get/set of table->info pointer
2018-09-24Merge pull request #3064 from NaveenThanikachalam/3049Russ White
lib: Trigger callbacks to re-evaluate route-map clauses when "call" CLI is executed.
2018-09-24Merge pull request #3073 from donaldsharp/pid_cleanupRuss White
Pid cleanup
2018-09-23bgpd, lib, zebra: Wrapper get/set of table->info pointerDonald Sharp
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>
2018-09-23Merge pull request #3071 from donaldsharp/fix_vrf_nameLou Berger
lib: Allow useful display of default vrf name