summaryrefslogtreecommitdiff
path: root/lib/frr_zmq.c
AgeCommit message (Collapse)Author
2024-05-07lib: stick `XREF_SETUP` into libfrrzmqDavid Lamparter
Didn't catch this one when adding the warning/error (with -Werror) for missing this. Neither the CI nor I build with ZeroMQ enabled :(. 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 `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24lib: convert xref_threadsched to xref_eventschedDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_cancelXXX to event_cancelXXXDonald Sharp
Modify the code base so that thread_cancel becomes event_cancel 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 `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not 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-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-14Merge pull request #9751 from ewlumpkin/comment_spelling_fixesIgor Ryzhov
lib: fix spelling nits in more lib files' comments
2021-10-05lib: fix spelling nits in more lib filesewlumpkin
Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2021-08-19lib: avoid double-free in zmq wrapper callbacksMark Stapp
There were paths where the zmq wrapper lib could call user callbacks that would free the internal context struct, but the context was then used in the lib code. Use a boolean to avoid freeing the context within an application callback. Restore logic that frees the context within the 'cancel' api. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
2021-08-19lib: clear caller's pointer when freeing context structMark Stapp
The zeromq lib wrapper uses an internal context struct to help interact with the libfrr event mechanism. When freeing that context struct, ensure the caller's pointer is also cleared. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
2021-07-28lib: prevent crash in make check in some situationsDonald Sharp
When running `make check` against a build that zeromq enabled the test_zmq unit test was crashing. The commit: e08165def1c62beee0e87385e37ea5f12ca0f9b9 Introduced this crash. Removing the part of the commit that was causing the crash in the test. This is mainly to get `make check` working again for those people using zeromq in their builds. Fixes: #9176 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-06lib: logic and macro cleanup in frr_zmq shimMark Stapp
Fix a couple of logic/macro issues in the frr_zmq shim module. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-06lib: use public task-scheduling apisMark Stapp
The frr_zmq shim was trying to use some internal scheduling macros, and that was causing trouble. Just use the public apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
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-01lib/xref: use to transport thread_* file/line/funcDavid Lamparter
Just a better way of doing what was previously the "debugargdef" macro. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-10-23* : update signature of thread_cancel apiMark Stapp
Change thread_cancel to take a ** to an event, NULL-check before dereferencing, and NULL the caller's pointer. Update many callers to use the new signature. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-04*: Use true/false instead of 1/0 when assigning variable for bool typeDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-02-25*: do not check XMALLOC / XCALLOC for null retQuentin Young
They never return NULL Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13*: style for EC replacementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin 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 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-06-19eigrpd, lib, tests, vtysh: security (cppcheck)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-04-23frrzmq: properly init args to zmq_getsockopt()Mark Stapp
zmq read events get lost if zmq_getsockopt() silently fails in frrzmq_check_events(). Signed-off-by: Mark Stapp <mjs@voltanet.io>
2017-11-23lib: Address ZMQ lib TODOsßingen
Add write callback. Add error callback. Add frrzmq_check_events() function to check for edge triggered things that may have happened after a zmq_send() call or so. Update ZMQ tests. Signed-off-by: ßingen <bingen@voltanet.io>
2017-08-28lib: ZeroMQ read handler, v2David Lamparter
This uses zmq_getsockopt(ZMQ_FD) to create a libfrr read event, which then wraps zmq_poll and calls an user-specified ZeroMQ read handler. It's wrapped in a separate library in order to make ZeroMQ support an installation-time option instead of build-time. Extended to support per-message and per-fragment callbacks as discussed with Bingen in PR #566. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>