summaryrefslogtreecommitdiff
path: root/zebra/irdp_interface.c
AgeCommit message (Collapse)Author
2024-01-28zebra: convert interface configuration output to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-11-22*: convert `struct interface->connected` to DLISTDavid Lamparter
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>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
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>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-12-05zebra: use real MTYPEs for various objectsMark Stapp
Don't use MTYPE_TMP for many things in zebra: add specific mem types. Signed-off-by: Mark Stapp <mjs@labn.net>
2021-03-22zebra: kill zebra_memory.h, use MTYPE_STATICDavid Lamparter
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>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
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>
2021-02-09*: remove more sprintf()Quentin Young
Should be just a couple non-development, non-test occurrences of this function left now. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2020-07-14*: un-split strings across linesDavid Lamparter
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>
2020-04-17*: replace all random() callsRafael Zalamena
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>
2019-07-01*: s/TRUE/true/, s/FALSE/false/Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-01-31zebra: Move the master thread handler to the zrouter structureDonald Sharp
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>
2019-01-24Treewide: use ANSI function definitionsRuben Kerkhof
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRAQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06zebra: flog_warn conversionQuentin Young
Convert Zebra to user error subsystem. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14zebra, lib: error references for zebraQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
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>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-05*: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp
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>
2017-09-26zebra: Fix irdp so it doesn't crash when looked atDonald Sharp
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>
2017-08-15zebra: irdp: convert into moduleDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-15zebra: irdp: manage separate IRDP structDavid Lamparter
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>
2017-08-15zebra: start detangling rtadv & irdpDavid Lamparter
Replace some cross-dependencies with hooks & move bits to where they belong. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter
Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14*: ditch vty_outln(), part 2 of 2David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13vtysh: return non-zero for configuration failuresDaniel Walton
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.
2017-07-13*: ditch vty_outln(), part 1 of 2David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-29*: use vty_outlnQuentin Young
Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29Merge remote-tracking branch 'origin/stable/3.0'Donald Sharp
2017-06-16zebra: more dbzingQuentin Young
Revert to the previous <= restrictions, improve error messages, fix the divide by zero. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-14zebra: fix divide-by-zeroQuentin Young
x % 0 = FPE Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
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>
2017-05-09*: update thread_add_* callsQuentin Young
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>
2017-05-09*: remove THREAD_ON macros, add nullity checkQuentin Young
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>
2016-11-29all: Fix all underfull doc stringsQuentin Young
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>
2016-11-08all: Fix underfull doc strings, part 2Quentin Young
Add missing docstrings and separating \n. Also eat some low-hanging refactoring fruit. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-17Merge branch 'cmaster-next' into vtysh-grammarQuentin Young
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
2016-10-07zebra: use qobj and enable concurrent config editsDavid Lamparter
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>
2016-09-23zebra: add 'int idx_foo' argv index variablesDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23convert <1-255> to (1-255), ()s to <>s, etcDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-22zebra: argv update for all but zebra_vty.cDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-22Revert "zebra: Fixup to use the new parser"Daniel Walton
This reverts commit 5c94274ff77b7ba53a27ed68eb4b0bcdafba47b2.
2016-09-20zebra: Fixup to use the new parserDonald Sharp
2016-09-19*: split & distribute memtypes and stop (re|ab)using lib/ MTYPEsDavid Lamparter
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>
2016-04-14zebra: Refactor struct zebra_tDonald Sharp
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>