summaryrefslogtreecommitdiffstats
path: root/ripd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: remove VTYNL, part 1 of 6David Lamparter2017-07-142-3/+3
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: ditch vty_outln(), part 2 of 2David Lamparter2017-07-141-3/+3
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-136-101/+101
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix excess docstringQuentin Young2017-07-051-50/+8
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ripd: Fix zclient cleanup on shutdownDonald Sharp2017-06-303-0/+10
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: vty_outln (vty, "") --> vty_out (vty, VTYNL)Quentin Young2017-06-292-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: s/VTY_NEWLINE/VTYNL/gQuentin Young2017-06-291-1/+1
| | | | | | Should be able to fit more vty_out onto one line now Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use vty_outlnQuentin Young2017-06-296-173/+137
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: simplify log message lookupQuentin Young2017-06-212-12/+13
| | | | | | | | | | | | | | | | log.c provides functionality for associating a constant (typically a protocol constant) with a string and finding the string given the constant. However this is highly delicate code that is extremely prone to stack overflows and off-by-one's due to requiring the developer to always remember to update the array size constant and to do so correctly which, as shown by example, is never a good idea.b The original goal of this code was to try to implement lookups in O(1) time without a linear search through the message array. Since this code is used 99% of the time for debugs, it's worth the 5-6 additional cmp's worst case if it means we avoid explitable bugs due to oversights... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #537 from donaldsharp/vrf_stuffDavid Lamparter2017-05-171-1/+1
|\ | | | | Vrf stuff
| * *: Consolidate vrf_hooks into vrf_initDonald Sharp2017-05-161-1/+1
| | | | | | | | | | | | | | | | We only needed to add/change the vrf callbacks when we initialize the vrf subsystem. As such it is not necessary to handle the callbacks in any other way than through the init function. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-1514-56/+42
|/ | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Address the error "Dead assignment" of static analysifHung-Weic Chiu2017-05-101-1/+0
| | | | | | | - Refer to https://ci1.netdef.org/browse/FRR-FRR4-44/artifact/shared/static_analysis/index.html - Remove unused variable Signed-off-by: Hung-Weic Chiu <sppsorrg@gmail.com>
* *: update thread_add_* callsQuentin Young2017-05-092-9/+11
| | | | | | | | | | | | Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-094-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ripd: fix argv index numbers in the redistribute commandRenato Westphal2017-04-081-4/+4
| | | | | | Fixes Issue#350 Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* build: fix CFLAGS for snmp modulesDavid Lamparter2017-04-041-0/+1
| | | | | | | | | | | The SNMP modules include <net-snmp/net-snmp-config.h>, which won't be found in off-searchpath directories without SNMP_CFLAGS. Unfortunately in my tests the files were on the search path even without the flags. (SNMP_LIBS is not needed because only libfrrsnmp calls into net-snmp functions.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #294 from opensourcerouting/modulesDonald Sharp2017-04-045-26/+53
|\ | | | | Loadable module support
| * *: snmp: convert into modulesDavid Lamparter2017-03-254-14/+32
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: use hooks for sending SNMP trapsDavid Lamparter2017-03-253-15/+23
| | | | | | | | | | | | | | This means there are no ties into the SNMP code anymore other than the init call at startup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * build: split off libfrrsnmpDavid Lamparter2017-03-251-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ripd: fix snmp compileDavid Lamparter2017-03-241-0/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: apply DEFUN_NOSH for node-switch CLI commandsDavid Lamparter2017-03-281-1/+1
|/ | | | | | | | | | These have copies in vtysh that do the node-switch locally and are listed in extract.pl's ignore list. The ignore list however is redundant since DEFUN_NOSH does the same thing... ldpd is a bit hacky, but Renato is reworking this anyway. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Refactor ifindex2ifname to be VRF awareDonald Sharp2017-03-151-7/+7
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Refactor if_lookup_by_name to be VRF awareDonald Sharp2017-03-152-3/+4
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, ospfd, ripd: Convert if_lookup_address to be vrf awareDonald Sharp2017-03-151-4/+4
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, pimd, zebra: Convert if_lookup_exact_address to VRF onlyDonald Sharp2017-03-151-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: remove remaining struct zlog * argsDavid Lamparter2017-03-081-1/+1
| | | | | | These don't serve any purpose either. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: get rid of zlog(*, LOG_LEVEL, ...)David Lamparter2017-03-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Result of running the following Coccinelle patch + fixups: <<EOF /* long-forms: zlog(NULL, <level>, ...) * => zlog_level(...) */ @@ expression list args; @@ - zlog(NULL, LOG_DEBUG, args) + zlog_debug(args) @@ expression list args; @@ - zlog(NULL, LOG_NOTICE, args) + zlog_notice(args) @@ expression list args; @@ - zlog(NULL, LOG_INFO, args) + zlog_info(args) @@ expression list args; @@ - zlog(NULL, LOG_WARNING, args) + zlog_warn(args) @@ expression list args; @@ - zlog(NULL, LOG_ERR, args) + zlog_err(args) /* long-forms: zlog(base->log, <level>, ...) * => zlog_level(...) */ @@ expression base; expression list args; @@ - zlog(base->log, LOG_DEBUG, args) + zlog_debug(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_NOTICE, args) + zlog_notice(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_INFO, args) + zlog_info(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_WARNING, args) + zlog_warn(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_ERR, args) + zlog_err(args) EOF Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: add frr_run()David Lamparter2017-03-081-12/+1
| | | | | | | Contains the fetch-and-run-thread logic, and vty startup (which is the last thing happening before entering the main loop). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: add frr_config_fork()David Lamparter2017-03-081-57/+5
| | | | | | | | | Centralise read_config/daemonize/dryrun/pidfile/vty_serv into libfrr. This also makes multi-instance pid/config handling available as part of the library. It's only wired up in ospfd, but the code is in lib/. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: centralize more into frr_init()David Lamparter2017-03-071-3/+0
| | | | | | Move CLI/VTY/Memory accounting init into frr_* Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: add frr_init() infrastructureDavid Lamparter2017-03-072-103/+25
| | | | | | | | | Start centralising startup & option parsing into the library. FRR_DAEMON_INFO is a bit weird, but it will become useful later (e.g. for killing the ZLOG_* enum, and having the daemon name available) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp2017-02-072-3/+3
|\
| * ripd: Fix compile warningDonald Sharp2017-02-031-2/+2
| | | | | | | | | | | | | | This issue was found compiling with ./buildtest.sh on fedora 25 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * *: Convert libzebra -> libfrrDonald Sharp2017-02-031-1/+1
| | | | | | | | | | | | | | The library libzebra that is installed with FRR will conflict with Quagga. So let's rename it to libfrr. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge branch 'frr/pull/152' ("Lib fixes")David Lamparter2017-02-071-14/+16
|\ \ | | | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * | ripd: Prevent rip null dereferenceDonald Sharp2017-02-021-14/+16
| | | | | | | | | | | | | | | | | | | | | When rip is NULL, we dereference it anyways. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp2017-02-021-2/+12
|\ \ \ | |/ / |/| / | |/
| * *: fix warning fallout from set_socket_pathDavid Lamparter2017-02-011-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ripd: Add vty_socket cli option to override the compiled-in location for the ↵Martin Winter2017-01-251-2/+12
| | | | | | | | | | | | VTY Socket Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
* | *: Fix redistribute issueDonald Sharp2017-01-271-8/+8
| | | | | | | | | | | | | | | | | | | | Somewhere in the past we switched from using the auto-generated redistribute statements to a non-generated version. This caused us to loose new protocols to redistribute as they are added. Put it back. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge branch 'master' into fix-proto_redistnumQuentin Young2017-01-072-14/+14
|\ \
| * | Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp2017-01-062-14/+14
| |\|
| | * build: rename (2 of ?): route_types macrosDavid Lamparter2016-12-201-16/+16
| | | | | | | | | | | | | | | | | | | | | All of the autogenerated macros in lib/route_types.pl are now called FRR_* instead of QUAGGA_*. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| | * build: rename (1 of ?): configure.ac + preprocDavid Lamparter2016-12-201-6/+6
| | | | | | | | | | | | | | | | | | | | | This replaces Quagga -> FRR in most configure.ac settings as well as a handful of preprocessor macros in the source code. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | | all: use ->text when parsing protocol argumentQuentin Young2016-12-161-55/+40
|/ / | | | | | | | | | | and match on full protocol name in proto_redistnum() Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | *: coccinelle-replace vty->indexDavid Lamparter2016-12-092-42/+21
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | ripd: add qobj registrationsDavid Lamparter2016-12-092-0/+10
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | ripd: fix `ip rip receive...` commandQuentin Young2016-12-061-1/+1
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>