summaryrefslogtreecommitdiffstats
path: root/nhrpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib,bgpd,babeld,ripngd,nhrpd,bfdd: clean up SA warningsMark Stapp2019-06-061-2/+2
| | | | | | Clean up several SA warnings. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* lib: hashing functions should take const argumentsQuentin Young2019-05-144-8/+8
| | | | | | | | | | It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young2019-05-033-34/+20
| | | | | | | | | | | | This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: ZEBRA_NUM_OF -> array_sizeDavid Lamparter2019-04-184-6/+6
| | | | | | The latter is widely used, e.g. in the Linux kernel. Signed-off-by: David Lamparter <equinox@diac24.net>
* bfdd, nhrpd, pimd: When deleting an interface clean upDonald Sharp2019-03-291-2/+4
| | | | | | | | | | | When we delete an interface, we need to set the interface ifindex to an internal value so that we don't end up in a state where the re-addition of the same ifindex, due to a rename operation, causes an infinite loop. Fixes:#4007 Fix-Suggested-by: Saravanan K Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: compare pointer types to NULL, not 0Quentin Young2019-02-261-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: Rename backet to bucketTim Bray2019-02-252-2/+2
| | | | | | Presume typo from original author Signed-off-by: Tim Bray <tim@kooky.org>
* build: fix a whole bunch of *FLAGSDavid Lamparter2019-01-301-2/+2
| | | | | | | | | - 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>
* *: 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-1/+5
| | | | | | | | | | 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>
* *: Replace hash_cmp function return value to a boolDonald Sharp2018-10-194-4/+9
| | | | | | | | | 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>
* *: style for EC replacementsQuentin Young2018-09-132-10/+14
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* nhrpd: NHRP_[ERR|WARN] -> EC_NHRPQuentin Young2018-09-134-9/+9
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* nhrpd: missing operand addedF. Aragon2018-09-131-2/+3
| | | | | | Detected using -Wgnu-conditional-omitted-operand Signed-off-by: F. Aragon <paco@voltanet.io>
* Merge pull request #2977 from opensourcerouting/doc-fixDonald Sharp2018-09-091-1/+1
|\ | | | | build: fix not building docs w/o sphinx
| * build: fix not building docs w/o sphinxDavid Lamparter2018-09-091-1/+1
| | | | | | | | | | | | Can't build manpages without sphinx-build, oops... Signed-off-by: David Lamparter <equinox@diac24.net>
* | *: fix config.h/zebra.h include orderDavid Lamparter2018-09-0814-1/+56
|/ | | | | | | | 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>
* *: cleanup .gitignore filesDavid Lamparter2018-09-081-1/+0
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* build: move vtysh & manpage listings to subdir.amDavid Lamparter2018-09-081-0/+2
| | | | | | | 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>
* *: add a vrf update hook to be informed of the vrf namePhilippe Guibert2018-08-281-1/+1
| | | | | | | | The Vrf aliases can be known with a specific hook. That hook will then, from zebra propagate the information to the relevant zapi clients. The registration hook function is the same for all daemons. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.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-142-5/+5
| | | | 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>
* nhrpd: Add NHRP_ERR_XXXX for zlog_err to zlog_ferr conversionDonald Sharp2018-08-146-12/+102
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: ALLOC calls cannot failDonald Sharp2018-08-116-39/+29
| | | | | | | | There is no need to check for failure of a ALLOC call as that any failure to do so will result in a assert happening. So we can safely remove all of this code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #2609 from pacovn/clang_scan_nhrpd_vici_initializationDonald Sharp2018-07-031-1/+1
|\ | | | | nhrpd: uninitialized variable (Clang scan)
| * nhrpd: uninitialized variable (Clang scan)F. Aragon2018-07-021-1/+1
| | | | | | | | | | | | | | Fix over 0a939f4f24fa34fea688482fbf57fb16eaf2a081 (there was a case not covered by previous fix) Signed-off-by: F. Aragon <paco@voltanet.io>
* | Merge pull request #2604 from pacovn/PVS-Studio_odd_operator_usageQuentin Young2018-07-021-1/+1
|\ \ | | | | | | nhrpd: odd operator usage fix (PVS-Studio)
| * | nhrpd: odd operator usage fix (PVS-Studio)F. Aragon2018-07-021-1/+1
| |/ | | | | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* / eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)F. Aragon2018-07-021-1/+1
|/ | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* nhrpd: uninitialized variable (Clang scan)F. Aragon2018-06-291-0/+1
| | | | | | | | | | | | This correction fixes two bugs detected by Clang scan: Bug Group: Logic error Bug Type: Assigned value is garbage or undefined File: nhrpd/vici.c Function: vici_parse_message Lines: 100, 105 Signed-off-by: F. Aragon <paco@voltanet.io>
* nhrpd: array limit check (cppcheck)paco2018-06-181-1/+1
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* *: 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>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-0628-1109/+1527
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* *: Rename ZEBRA_FLAG_INTERNAL -> ZEBRA_FLAG_ALLOW_RECURSIONDonald Sharp2018-02-271-1/+1
| | | | | | | | | | The ZEBRA_FLAG_INTERNAL flag is used to signal to zebra that the route being added, the nexthops for it can be recursively resolved. This name keeps throwing me off when I read it so let's rename to something that allows the developer to understand what is going on. Signed-off-by: Donald Sharp <sharpd@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/+2
| | | | | | | 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>
* *: add missing \n in some help stringsRenato Westphal2017-10-241-2/+2
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: Modify zclient_init to require privs dataDonald Sharp2017-10-241-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* nhrpd: Let struct zebra_privs_t be availableDonald Sharp2017-10-242-1/+3
| | | | signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-102-6/+6
| | | | | | | | | | 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-102-10/+10
| | | | | | | | | | | 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>
* nhrpd: Add hash table namesDonald Sharp2017-09-054-4/+12
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* 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-2/+4
|/ | | | | | | | 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>