summaryrefslogtreecommitdiffstats
path: root/zebra/irdp_interface.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* zebra: convert interface configuration output to NBIgor Ryzhov2024-01-281-1/+0
| | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: convert `struct interface->connected` to DLISTDavid Lamparter2023-11-221-6/+6
| | | | | | | | | | | | | | | | | Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Convert event.h to frrevent.hDonald Sharp2023-03-241-1/+1
| | | | | | | We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-241-2/+2
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Rename thread.[ch] to event.[ch]Donald Sharp2023-03-241-1/+1
| | | | | | | | | | | This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-16/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: use real MTYPEs for various objectsMark Stapp2022-12-051-2/+2
| | | | | | | Don't use MTYPE_TMP for many things in zebra: add specific mem types. Signed-off-by: Mark Stapp <mjs@labn.net>
* zebra: kill zebra_memory.h, use MTYPE_STATICDavid Lamparter2021-03-221-1/+0
| | | | | | | This one also needed a bit of shuffling around, but MTYPE_RE is the only one left used across file boundaries now. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: require semicolon after DEFINE_MTYPE & coDavid Lamparter2021-03-171-1/+1
| | | | | | | | | | | | | | | | | Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: remove more sprintf()Quentin Young2021-02-091-7/+11
| | | | | | | Should be just a couple non-development, non-test occurrences of this function left now. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
* *: un-split strings across linesDavid Lamparter2020-07-141-6/+3
| | | | | | | | | | | | | | | | | Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
* *: replace all random() callsRafael Zalamena2020-04-181-1/+2
| | | | | | | | | | | Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* *: s/TRUE/true/, s/FALSE/false/Quentin Young2019-07-011-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: Move the master thread handler to the zrouter structureDonald Sharp2019-01-311-2/+2
| | | | | | | | The master thread handler is really part of the zrouter structure. So let's move it over to that. Eventually zserv.h will only be used for zapi messages. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Treewide: use ANSI function definitionsRuben Kerkhof2019-01-241-1/+1
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* *: list_delete_and_null() -> list_delete()David Lamparter2018-10-021-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRAQuentin Young2018-09-131-4/+4
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: flog_warn conversionQuentin Young2018-09-061-16/+21
| | | | | | Convert Zebra to user error subsystem. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra, lib: error references for zebraQuentin Young2018-08-141-15/+8
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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-061-8/+8
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-051-2/+1
| | | | | | | | | | | | | | | | | | | Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Fix irdp so it doesn't crash when looked atDonald Sharp2017-09-271-0/+42
| | | | | | | | | irdp is crashing because it assumes that people have configured it in a certain way. Ensure that this 'way' is honored at least enough so that we don't crash. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: irdp: convert into moduleDavid Lamparter2017-08-151-4/+0
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: irdp: manage separate IRDP structDavid Lamparter2017-08-151-63/+54
| | | | | | | This allocates the per-interface IRDP data as needed; so the pointer in zebra_if is now really opaque. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: start detangling rtadv & irdpDavid Lamparter2017-08-151-2/+5
| | | | | | | Replace some cross-dependencies with hooks & move bits to where they belong. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-387/+364
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-4/+4
|\ | | | | | | | | | | Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: return non-zero for configuration failuresDaniel Walton2017-07-131-4/+4
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
* | *: ditch vty_outln(), part 2 of 2David Lamparter2017-07-141-4/+4
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-8/+8
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use vty_outlnQuentin Young2017-06-291-18/+17
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge remote-tracking branch 'origin/stable/3.0'Donald Sharp2017-06-291-20/+13
|\
| * zebra: more dbzingQuentin Young2017-06-161-4/+6
| | | | | | | | | | | | | | Revert to the previous <= restrictions, improve error messages, fix the divide by zero. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * zebra: fix divide-by-zeroQuentin Young2017-06-141-20/+11
| | | | | | | | | | | | x % 0 = FPE Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | *: update thread_add_* callsQuentin Young2017-05-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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-091-4/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* all: Fix all underfull doc stringsQuentin Young2016-11-301-10/+22
| | | | | | | | | Additionally: * Add [ip] to a couple bgp show commands * Quick refactor of a couple ISIS commands * Quick refactor of a couple OSPF6 commands Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* all: Fix underfull doc strings, part 2Quentin Young2016-11-081-0/+2
| | | | | | | Add missing docstrings and separating \n. Also eat some low-hanging refactoring fruit. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge branch 'cmaster-next' into vtysh-grammarQuentin Young2016-10-181-127/+60
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: bgpd/bgp_route.c bgpd/bgp_routemap.c bgpd/bgp_vty.c isisd/isis_redist.c isisd/isis_routemap.c isisd/isis_vty.c isisd/isisd.c lib/command.c lib/distribute.c lib/if.c lib/keychain.c lib/routemap.c lib/routemap.h ospf6d/ospf6_asbr.c ospf6d/ospf6_interface.c ospf6d/ospf6_neighbor.c ospf6d/ospf6_top.c ospf6d/ospf6_zebra.c ospf6d/ospf6d.c ospfd/ospf_routemap.c ospfd/ospf_vty.c ripd/rip_routemap.c ripngd/ripng_routemap.c vtysh/extract.pl.in vtysh/vtysh.c zebra/interface.c zebra/irdp_interface.c zebra/rt_netlink.c zebra/rtadv.c zebra/test_main.c zebra/zebra_routemap.c zebra/zebra_vty.c
| * zebra: use qobj and enable concurrent config editsDavid Lamparter2016-10-071-82/+15
| | | | | | | | | | | | | | | | | | | | This puts all the proper VTY_DECLVAR_CONTEXT calls in place, removing all vty->index uses in the process. With that, vty_config_lockless can be enabled in zebra. [v2: fix ordering screw-up in "interface XXX" command] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | zebra: add 'int idx_foo' argv index variablesDaniel Walton2016-09-231-9/+16
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | convert <1-255> to (1-255), ()s to <>s, etcDaniel Walton2016-09-231-6/+6
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | zebra: argv update for all but zebra_vty.cDaniel Walton2016-09-221-9/+9
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | Revert "zebra: Fixup to use the new parser"Daniel Walton2016-09-221-9/+9
| | | | | | | | This reverts commit 5c94274ff77b7ba53a27ed68eb4b0bcdafba47b2.
* | zebra: Fixup to use the new parserDonald Sharp2016-09-211-9/+9
|/
* *: split & distribute memtypes and stop (re|ab)using lib/ MTYPEsDavid Lamparter2016-09-191-0/+1
| | | | | | | | | | | | | | | | | | | This is a rather large mechanical commit that splits up the memory types defined in lib/memtypes.c and distributes them into *_memory.[ch] files in the individual daemons. The zebra change is slightly annoying because there is no nice place to put the #include "zebra_memory.h" statement. bgpd, ospf6d, isisd and some tests were reusing MTYPEs defined in the library for its own use. This is bad practice and would break when the memtype are made static. Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com> [CF: rebased for cmaster-next] Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* zebra: Refactor struct zebra_tDonald Sharp2016-04-151-4/+0
| | | | | | | | | | | We were including 'extern struct zebra_t zebrad;' all over the place. This made no sense. Refactor into zserv.h where the definition was and remove resulting unnecessary code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>