summaryrefslogtreecommitdiff
path: root/lib/log.h
AgeCommit message (Collapse)Author
2023-03-09lib, bgpd: Add more debugs to GR Capability exchangeDonald Sharp
a) Make it legible what type of message is being passed back and forth instead of having to guess it from the insufficient debugs b) Make it explicit which bgp instance is sending this data c) Cleanup bgp_zebra_update to have a cleaner api Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-21Merge pull request #12366 from manojvn/ospfv2-flood-reductionRuss White
ospfd: Support OSPF Refresh and Flooding Reduction RFC4136.
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>
2023-01-19ospfd: addition of OSPF_LOG.Manoj Naragund
Description: Addition of OSPF_LOG for conditionally logging ospf messages, at different log levels. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2021-11-11*: Rename quagga_timestamp with frr_timestampDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-23*: drop zassert.hDavid Lamparter
It's not actually working properly... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-02-01lib/xref: add xrefs on zlog_* callsDavid Lamparter
This allows extracting a list of all log messages including their ECs and autogenerated unique IDs for them. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14*: remove PRI[udx](8|16|32)David Lamparter
These are completely pointless and break coccinelle string replacements. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-01lib/log: re-add log filteringDavid Lamparter
This is most of the old code bolted on top of the new "backend" infrastructure. It just wraps around zlog_fd() with the string search. Originally-by: Stephen Worley <sworley@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-01lib: rewrite zlog lock-free & TLS-bufferedDavid Lamparter
This is a full rewrite of the "back end" logging code. It now uses a lock-free list to iterate over logging targets, and the targets themselves are as lock-free as possible. (syslog() may have a hidden internal mutex in the C library; the file/fd targets use a single write() call which should ensure atomicity kernel-side.) Note that some functionality is lost in this patch: - Solaris printstack() backtraces are ditched (unlikely to come back) - the `log-filter` machinery is gone (re-added in followup commit) - `terminal monitor` is temporarily stubbed out. The old code had a race condition with VTYs going away. It'll likely come back rewritten and with vtysh support. - The `zebra_ext_log` hook is gone. Instead, it's now much easier to add a "proper" logging target. v2: TLS buffer to get some actual performance Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-24lib: rewrite zlog_hexdump()David Lamparter
The old version was creating a multi-line log message, which we can't properly handle right now. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-06-19lib: Add log filter manipulation codeStephen Worley
Add code for manipulation/creation of log filters and their table. Specifically, add lookup,clear,add,del,dump functionality. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-06-12lib: make "%Ld" work for int64_tDavid Lamparter
... without compiler plugins. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-11Zebra.h header cleanup (#4444)David Lamparter
Zebra.h header cleanup
2019-06-03lib: simplify SEGV handlerDavid Lamparter
printfrr is AS-Safe, let's simplify the SEGV handler quite a bit by relying on that. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-02lib: Move some log.c functions declarations to log.hDonald Sharp
We have some functions that are owned by log.c, so move their declarations from zebra.h to log.h Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-18lib: introduce flog() to simplify the northbound code a little bitRenato Westphal
flog() is a small wrapper around zlog() that can be useful in a few places to reduce code duplication. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-04-18lib: move zlog() prototype back to the public logging APIRenato Westphal
zlog() should be part of the public logging API as it's useful in the cases where the logging priority isn't known at compile time (i.e. it depends on a variable). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-11lib: add extern "C" {} blocks to all libfrr headersRenato Westphal
These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-11libs, daemons: changes to permit c++ compilationMark Stapp
Some misc changes to resolve some c++ compilation errors. The goal is only to permit an external module - a plugin, for example - to see frr headers, not to support or encourage contributions in c++. The changes include: avoiding use of keywords like 'new', 'delete'; cleaning up implicit type-casting from 'void *' in several places. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-02-05lib: add hooks for external logging functionEmanuele Di Pascale
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-09-06lib: PRIu32 in log.hQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06lib: add flog_warnQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-22lib: error codes are uint32_t'sQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename ferr_zlog -> flog_err_sysQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14lib: add error reference systemQuentin Young
* Add zlog_* function to log with a reference code * Add ability to track reference cards for errors to ferr.[ch] * Assign some reference code ranges Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-02lib: plug logging hole during startupDavid Lamparter
zlog_* doesn't work in startup before we've loaded the real logging configuration. Add some code to log to stderr for that window of time. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22Revert "*: reindent pt. 2"David Lamparter
This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17*: reindent pt. 2whitespace / reindent
w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
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-06-21*: simplify log message lookupQuentin Young
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>
2017-05-18lib: detangle protocol name/instance from loggingDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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-15lib: parser: split off & rename graph handlingDavid Lamparter
Put core CLI graph stuff in lib/command_graph.[ch] and consistently prefix all function names with "cmd_". Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08*: fix some user-visible Quagga remnantsDavid Lamparter
(Note: the allow_delete thing is called "zebra" on the commandline because that's the clearest context there, while it is called "FRR" in the CLI because that's considerably less confusing in a vtysh env.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08lib: hide away logging internalsDavid Lamparter
... no need to have struct zlog generally-exposed. A few files get to include log_int.h because they use zlog/vzlog. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08lib: remove remaining struct zlog * argsDavid Lamparter
These don't serve any purpose either. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08lib: simplify protocol/log namingDavid Lamparter
The protocols enum serves no purpose other than adding potential for bugs and making it complicated to add a new protocol... nuke. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08lib: ditch struct zlog * argument on zlog/vzlog()David Lamparter
It's completely useless... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-07Merge pull request #257 from opensourcerouting/nhrpdDonald Sharp
nhrpd
2017-03-07nhrpd: implement next hop resolution protocolTimo Teräs
This provides DMVPN support and integrates to strongSwan. Please read README.nhrpd and README.kernel for more details. [DL: cherry-picked from dafa05e65fe4b3b3ed5525443f554215ba14f42c] [DL: merge partially resolved, this commit will not build.] Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-06lib: add zlog_sanitize functionDavid Lamparter
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-01-06Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp
2017-01-03watchfrr: Rename watchquagga -> watchfrrDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-11-12Merge branch 'cmaster-next' into vtysh-grammarQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: lib/command.c lib/vty.c
2016-11-09watchquagga: add ZLOG_WATCHQUAGGADavid Lamparter
watchquagga logs as "NONE", which will also become visible in vtysh for error messages. Add "WATCHQUAGGA" log target. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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-07lib: Remove unknown protocol.Donald Sharp
What is MASC anyways? Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07lib: Fix ordering issue in protocol namesDonald Sharp
The protocol names and enum must be kept in the same order. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>