summaryrefslogtreecommitdiffstats
path: root/babeld (follow)
Commit message (Collapse)AuthorAgeFilesLines
* build: fix a whole bunch of *FLAGSDavid Lamparter2019-01-301-1/+1
| | | | | | | | | - some target_CFLAGS that needed to include AM_CFLAGS didn't do so - libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all - consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@ - 2 dependencies were missing for clippy Signed-off-by: David Lamparter <equinox@diac24.net>
* Treewide: use ANSI function definitionsRuben Kerkhof2019-01-249-11/+11
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* lib, rip, ripng, babel, eigrp: add ctx pointer to distribute apiPhilippe Guibert2018-12-284-15/+34
| | | | | | | | | | | | | | | | | | | | | | a distribute_ctx context pointer is returned after initialisation to the calling daemon. this context pointer will be further used to do discussion with distribute service. Today, there is no specific problem with old api, since the pointer is the same in all the memory process. but the pointer will be different if we have multiple instances. Right now, this is not the case, but if that happens, that work will be used for that. distribute-list initialisation is split in two. the vty initialisation is done at global level, while the context initialisation is done for each routing daemon instance. babel daemon is being equipped with a routing returning the main babel instance. also, a delete routine is available when the daemon routing instance is suppressed. a list of contexts is used inside distribute_list. This will permit distribute_list utility to handle in the same daemon to handle more than one context. This will be very useful in the vrf context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: Replace zclient_new with zclient_new_notifyDonald Sharp2018-11-121-1/+1
| | | | | | | It's been a year since we added the new optional parameters to instantiation. Let's switch over to the new name. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* yang, lib: add 'frr-interface.yang' and associated stub callbacksRenato Westphal2018-10-271-0/+1
| | | | | | | | | | | | | 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>
* *: add empty array of YANG modulesRenato Westphal2018-10-271-0/+7
| | | | | | | | | | FRR_DAEMON_INFO should now contain an array of 'frr_yang_module_info' structures describing the YANG modules implemented by the daemon. This array will be used by frr_init() function to load all YANG modules and initialize the northbound callbacks during the daemon initialization. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: spelchekDavid Lamparter2018-10-252-2/+2
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-133-11/+11
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* babeld: BABEL_[ERR|WARN] -> EC_BABELQuentin Young2018-09-139-64/+64
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: fix config.h/zebra.h include orderDavid Lamparter2018-09-087-0/+28
| | | | | | | | config.h (or, transitively, zebra.h) must be the first include file listed for autoconf things like _GNU_SOURCE and _POSIX_C_SOURCE to work correctly. Signed-off-by: David Lamparter <equinox@diac24.net>
* build: move vtysh & manpage listings to subdir.amDavid Lamparter2018-09-081-0/+5
| | | | | | | Since we're now building through one large Makefile, we can easily put things with their daemons and crossreference nicely. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: rename ferr_zlog -> flog_err_sysQuentin Young2018-08-143-11/+11
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename ferr_ref -> log_refQuentin Young2018-08-142-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-147-67/+67
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: correct typos in error reference cardsQuentin Young2018-08-141-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove \n from error code textsQuentin Young2018-08-141-1/+1
| | | | | | Should be handled by pager Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* babeld: fix erroneous lib initQuentin Young2018-08-141-3/+0
| | | | | | | Babel was screwing up lib initialization causing double inits of many things. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: stop double initialization of ferrQuentin Young2018-08-141-2/+0
| | | | | | | | * Stop double init of ferr * Fixup bugs in zebra ferr * Add missing init in ospfd Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: fix source file headers & includes for errcodesQuentin Young2018-08-142-21/+24
| | | | | | | | | | * Use the correct license header * Stop headers from including themselves * Use uniform relative include conventions * Ensure that sources include what they use * Turn off clang-format around struct array blocks Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* babeld: Convert all zlog_err to zlog_ferr and add appropriate infoDonald Sharp2018-08-149-63/+117
| | | | | | | Convert babeld to use zlog_ferr and add appropriate BABEL_ERR_XXX information. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* babeld: Add BABEL_ERR_XXX error messages.Donald Sharp2018-08-146-26/+120
| | | | | | | Add some BABEL_ERR_XXX error messages and convert over to using zlog_ferr instead of zlog_err. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* babeld: avoid reading the configuration file twiceRenato Westphal2018-08-131-3/+0
| | | | | | | | The frr_config_fork() function called by all FRR daemons during initialization already takes care of reading the startup configuration file. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* babeld: Use enum instead of #defines for kernel route type informationDonald Sharp2018-08-112-15/+14
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #2486 from pacovn/cppcheck_fmt_validationDonald Sharp2018-06-182-2/+2
|\ | | | | babeld, lib, ospfd, tests: fmt fixes (cppcheck)
| * babeld, lib, ospfd, tests: fmt fixes (cppcheck)paco2018-06-182-2/+2
| | | | | | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* | babeld, eigrpd, ospfd: unsigned negative checkpaco2018-06-182-2/+2
|/ | | | | | After Cppcheck 1.72 feedback Signed-off-by: F. Aragon <paco@voltanet.io>
* babeld: fix cli option to override config file (-f)Martin Winter2018-05-011-3/+2
| | | | Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
* babeld: be more explicit about route resize resultQuentin Young2018-04-131-0/+1
| | | | | | | | Resizing the route array can fail. Although the error condition is already correctly handled, if we're more explicit about the variables we expect to be initialized then clang-analyze is happier. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: 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-3/+2
| | | | | | | 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>
* babeld: if_eui64 never uses ifnameDonald Sharp2017-12-053-4/+4
| | | | | | Remove this variable. 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>
* babeld: Make the zebra_privs_t available for useDonald Sharp2017-10-242-1/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1298 from opensourcerouting/iface-rb-treeDonald Sharp2017-10-164-53/+42
|\ | | | | Use rb-trees to store interfaces instead of linked-lists
| * *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-103-14/+3
| | | | | | | | | | | | | | | | | | | | This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * *: introduce new rb-tree to optimize interface lookup by ifindexRenato Westphal2017-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance tests showed that, when running on a system with a large number of interfaces, some daemons would spend a considerable amount of time in the if_lookup_by_index() function. Introduce a new rb-tree to solve this problem. With this change, we need to use the if_set_index() function whenever we want to change the ifindex of an interface. This is necessary to ensure that the 'ifaces_by_index' rb-tree is updated accordingly. The return value of all insert/remove operations in the interface rb-trees is checked to ensure that an error is logged if a corruption is detected. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * *: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal2017-10-104-44/+44
| | | | | | | | | | | | | | | | | | | | | | This is an important optimization for users running FRR on systems with a large number of interfaces (e.g. thousands of tunnels). Red-black trees scale much better than sorted linked-lists and also store the elements in an ordered way (contrary to hash tables). This is a big patch but the interesting bits are all in lib/if.[ch]. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | babeld: Do not copy beyond end of dataDonald Sharp2017-10-102-2/+2
|/ | | | | | | | | | | | The function really_send_update takes a 'const unsigned char *id'. and is called with myid(a 8 byte array) and route->src->id(an 8 byte array), but we copy these pointers into babel_ifp->buffered_id which is a 16 byte array. Adjust the size of buffered_id to be 8 bytes and fix the copy to only copy the 8 bytes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* scan-build: fix warningVincent JARDIN2017-10-021-1/+0
| | | | Do not change the implementation, just fix scan-build/clang warning.
* scan-build: cleanup some warningsVincent JARDIN2017-10-021-4/+6
| | | | | | | Current cleanup is for unset values or variables that are not used anymore. Regarding ospfd/ospf_vty.c: argv_find() we'll never get it NULL, so get coststr = argv[idx]->arg;
* *: make all daemons call frr_fini() on exitRenato Westphal2017-09-121-0/+1
| | | | | | This allow us to find real leaks more easily with tools like valgrind. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #1078 from dwalton76/ospfd-network-cmd-warningRenato Westphal2017-08-311-1/+1
|\ | | | | *: return CMD_WARNING if command was already configured
| * *: return CMD_WARNING if command was already configuredDaniel Walton2017-08-311-1/+1
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> If the user configures some command that is already in the config we should return CMD_WARNING instead of CMD_WARNING_CONFIG_FAILED
* | Merge pull request #1056 from opensourcerouting/oldbits-0Donald Sharp2017-08-291-2/+2
|\ \ | | | | | | "pathspace" options, vtysh-suid-cleanups, "vty_frame()"
| * | *: remove empty "interface XYZ" config blocksDavid Lamparter2017-08-291-2/+2
| |/ | | | | | | | | | | | | | | Using the previously-added vty_frame() support, this gets rid of all the pointless empty "interface XYZ" blocks that get added for any interface that shows up in the system (e.g. dummys, tunnels, etc.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* / *: remove ZEBRA_FLAG_{BLACKHOLE,REJECT} from APIDavid Lamparter2017-08-281-1/+1
|/ | | | | | | | FLAG_BLACKHOLE is used for different things in different places. remove it from the zclient API, instead indicate blackholes as proper nexthops inside the message. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix compiler warningsDavid Lamparter2017-08-262-3/+3
| | | | | | | | Specifically, gcc 4.2.1 on OpenBSD 6.0 warns about these; they're bogus (gcc 4.2, being rather old, isn't quite as "intelligent" as newer versions; the newer ones apply more logic and less warnings.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use zapi_route to send/receive redistributed routes as wellRenato Westphal2017-08-243-161/+49
| | | | | | | | | | | | | | | | | | 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>