diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2023-03-24 13:48:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-24 13:48:53 -0500 |
| commit | 06f54ff416e63149f5b2bd770204472f1ea31ee5 (patch) | |
| tree | 661878796771e1b37f5388d8c0057b7e4c1e7c33 /lib/bfd.c | |
| parent | d54d0ead76ade4c8abaf223d1775d8eff3564f1e (diff) | |
| parent | 02e701e49e90e7b0f2d9332b54210507f965669f (diff) | |
Merge pull request #12953 from donaldsharp/struct_event
Struct event
Diffstat (limited to 'lib/bfd.c')
| -rw-r--r-- | lib/bfd.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -10,7 +10,7 @@ #include "command.h" #include "memory.h" #include "prefix.h" -#include "thread.h" +#include "frrevent.h" #include "stream.h" #include "vrf.h" #include "zclient.h" @@ -75,7 +75,7 @@ struct bfd_session_params { * Next event. * * This variable controls what action to execute when the command batch - * finishes. Normally we'd use `thread_add_event` value, however since + * finishes. Normally we'd use `event_add_event` value, however since * that function is going to be called multiple times and the value * might be different we'll use this variable to keep track of it. */ @@ -87,7 +87,7 @@ struct bfd_session_params { * configuration load or northbound batch), so we'll use this to * install/uninstall the BFD session parameters only once. */ - struct thread *installev; + struct event *installev; /** BFD session installation state. */ bool installed; @@ -111,7 +111,7 @@ struct bfd_sessions_global { struct bfd_source_list source_list; /** Pointer to FRR's event manager. */ - struct thread_master *tm; + struct event_loop *tm; /** Pointer to zebra client data structure. */ struct zclient *zc; @@ -485,9 +485,9 @@ static bool _bfd_sess_valid(const struct bfd_session_params *bsp) return true; } -static void _bfd_sess_send(struct thread *t) +static void _bfd_sess_send(struct event *t) { - struct bfd_session_params *bsp = THREAD_ARG(t); + struct bfd_session_params *bsp = EVENT_ARG(t); int rv; /* Validate configuration before trying to send bogus data. */ @@ -533,7 +533,7 @@ static void _bfd_sess_send(struct thread *t) static void _bfd_sess_remove(struct bfd_session_params *bsp) { /* Cancel any pending installation request. */ - THREAD_OFF(bsp->installev); + EVENT_OFF(bsp->installev); /* Not installed, nothing to do. */ if (!bsp->installed) @@ -541,7 +541,7 @@ static void _bfd_sess_remove(struct bfd_session_params *bsp) /* Send request to remove any session. */ bsp->lastev = BSE_UNINSTALL; - thread_execute(bsglobal.tm, _bfd_sess_send, bsp, 0); + event_execute(bsglobal.tm, _bfd_sess_send, bsp, 0); } void bfd_sess_free(struct bfd_session_params **bsp) @@ -733,13 +733,13 @@ void bfd_sess_set_auto_source(struct bfd_session_params *bsp, bool enable) void bfd_sess_install(struct bfd_session_params *bsp) { bsp->lastev = BSE_INSTALL; - thread_add_event(bsglobal.tm, _bfd_sess_send, bsp, 0, &bsp->installev); + event_add_event(bsglobal.tm, _bfd_sess_send, bsp, 0, &bsp->installev); } void bfd_sess_uninstall(struct bfd_session_params *bsp) { bsp->lastev = BSE_UNINSTALL; - thread_add_event(bsglobal.tm, _bfd_sess_send, bsp, 0, &bsp->installev); + event_add_event(bsglobal.tm, _bfd_sess_send, bsp, 0, &bsp->installev); } enum bfd_session_state bfd_sess_status(const struct bfd_session_params *bsp) @@ -890,11 +890,11 @@ int zclient_bfd_session_replay(ZAPI_CALLBACK_ARGS) bsp->installed = false; /* Cancel any pending installation request. */ - THREAD_OFF(bsp->installev); + EVENT_OFF(bsp->installev); /* Ask for installation. */ bsp->lastev = BSE_INSTALL; - thread_execute(bsglobal.tm, _bfd_sess_send, bsp, 0); + event_execute(bsglobal.tm, _bfd_sess_send, bsp, 0); } return 0; @@ -1039,7 +1039,7 @@ static int bfd_protocol_integration_finish(void) return 0; } -void bfd_protocol_integration_init(struct zclient *zc, struct thread_master *tm) +void bfd_protocol_integration_init(struct zclient *zc, struct event_loop *tm) { /* Initialize data structure. */ TAILQ_INIT(&bsglobal.bsplist); |
