summaryrefslogtreecommitdiff
path: root/lib/lib_errors.h
AgeCommit message (Collapse)Author
2019-07-03lib: split off c-ares code from nhrpdDavid Lamparter
This is useful in other places too, e.g. for BMP outbound connections. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-06-13lib: Prevent infinite loop in fd handlingDonald Sharp
If we have a case where have created a fd for i/o and we have removed the handling thread but still have the fd in the poll data structure, there existed a case where we would get the handle this fd return from poll but we would immediately do nothing with it because we didn't have a thread to hand the event to. This leads to an infinite loop. Prevent the infinite loop from happening and log the problem. We still need to find the cause of this happening. But let's prevent the system from melting down in the mean time. Fixes: #2796 Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-26lib: add new gRPC-based northbound pluginRenato Westphal
This is an experimental plugin for now. Full documentation will come later. 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>
2018-12-18lib: add NB phase-specific error codesEmanuele Di Pascale
As suggested by Renato, add error codes that are specific to the various phases of a northbound callback. These can be used by the daemons when logging an error. The reasoning is that validation errors typically mean that there is an inconsistency in the configuration, a prepare error means that we are running out of resources, and abort/apply errors are bugs that need to be reported to the devs. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-11-26lib, tests: major rework in the operational-data callbacksRenato Westphal
The northbound infrastructure for operational data was subpar compared to the infrastructure for configuration data. This commit addresses most of the existing problems, making it possible to write operational-data callbacks for more complex YANG models. Summary of the changes: * Add support for nested YANG lists. * Add support for leaf-lists. * Add support for leafs of type "empty". * Introduce the "show yang operational-data XPATH" command, and write an unit test for it. The main purpose of this command is to make it easier to test the operational-data northbound callbacks. * Introduce the nb_oper_data_iterate() function, that can be used to iterate over operational data. Make the CLI and sysrepo use this function. * Since ConfD has a very peculiar API, it can't reuse the nb_oper_data_iterate() like the other northbound clients. In this case, adapt the existing ConfD callbacks to support the new features (and make some performance improvements in the process). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-09lib: Implement an allocator for 32 bit ID numbersMitch Skiba
This commit introduces lib/id_alloc, which has facilities for both an ID number allocator, and less efficient ID holding pools. The pools are meant to be a temporary holding area for ID numbers meant to be re-used, and are implemented as a linked-list stack. The allocator itself is much more efficient with memory. Based on sizeof values on my 64 bit desktop, the allocator requires around 155 KiB per million IDs tracked. IDs are ultimately tracked in a bit-map split into many "pages." The allocator tracks a list of pages that have free bits, and which sections of each page have free IDs, so there isn't any scanning required to find a free ID. (The library utility ffs, or "Find First Set," is generally a single CPU instruction.) At the moment, totally empty pages will not be freed, so the memory utilization of this allocator will remain at the high water mark. The initial intended use case is for BGP's TX Addpath IDs to be pulled from an allocator that tracks which IDs are in use, rather than a free running counter. The allocator reserves ID #0 as a sentinel value for an invalid ID numbers, and BGP will want ID #1 reserved as well. To support this, the allocator allows for IDs to be explicitly reserved, though be aware this is only practical to use with low numbered IDs because the allocator must allocate pages in order. Signed-off-by Mitchell Skiba <mskiba@amazon.com>
2018-10-27lib: introduce new northbound APIRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06lib: Convert vrf.c to use new error-code subsystemDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06lib: Convert vty.c to use new error-code subsystemDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06lib: Convert routemap.c to use new error-code subsystemDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06lib: Convert thread.c to use new error-code subsystemDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06lib: Convert netns_linux.c to new error-code workDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06lib: Convert stream.c to use new error code subsystemDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06lib: Convert to flog_warn in agentx.cDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14*: rename ferr_ref -> log_refQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: fix source file headers & includes for errcodesQuentin Young
* 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>
2018-08-14zebra, lib: error references for zebraQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14lib: Add LIB_ERR_ZMQDonald Sharp
Add new error event for when we detect an issue within the ZMQ subsystem. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14lib: Add LIB_ERR_DEVELOPMENTDonald Sharp
Sometimes a error state is detected when we have added new code to FRR, but not updated all the places that we should have. Consider this a developmental escape that needs to be fixed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14lib: Add LIB_ERR_NS to error subsystemDonald Sharp
Add additional information about NameSpace errors that may happen. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14lib, zebra: Add LIB_ERR_INTERFACEDonald Sharp
Add a error type that allows us to track bad interface states. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14lib: Add LIB_ERR_SNMPDonald Sharp
Add code to indicate a SNMP error of some sort that needs to be handled and addressed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14lib: Add LIB_ERR_VTYDonald Sharp
Add a error code for when the vty subsystem detects an error. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14lib: Add LIB_ERR_SYSTEM_CALL and convert VRF_SOCKET to SOCKETDonald Sharp
Add a new error code LIB_ERR_SYSTEM_CALL to the ferr subsystem. Additionally convert LIB_ERR_VRF_SOCKET to a more generic LIB_ERR_SOCKET. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14lib: Convert to zlog_ferr for zclient.cDonald Sharp
Convert the zclient.c file to use zlog_ferr. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14lib, bgpd: Add code to make lib auto create the ferr infrastructureDonald Sharp
Add code to auto-create the ferr infrastructure as well as add some initial error handling for vrf.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>