]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: Convert thread_add_XXX functions to event_add_XXX
authorDonald Sharp <sharpd@nvidia.com>
Fri, 20 May 2022 18:19:08 +0000 (14:19 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 24 Mar 2023 12:32:17 +0000 (08:32 -0400)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
201 files changed:
babeld/babeld.c
bfdd/bfd.c
bfdd/bfd_packet.c
bfdd/bfdd.c
bfdd/control.c
bfdd/dplane.c
bfdd/event.c
bgpd/bgp_bmp.c
bgpd/bgp_conditional_adv.c
bgpd/bgp_damp.c
bgpd/bgp_dump.c
bgpd/bgp_evpn_mh.c
bgpd/bgp_fsm.c
bgpd/bgp_fsm.h
bgpd/bgp_io.c
bgpd/bgp_network.c
bgpd/bgp_nht.c
bgpd/bgp_packet.c
bgpd/bgp_route.c
bgpd/bgp_routemap.c
bgpd/bgp_rpki.c
bgpd/bgp_updgrp.c
bgpd/bgp_updgrp_adv.c
bgpd/bgp_vty.c
bgpd/bgp_zebra.c
bgpd/bgpd.c
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_monitor.c
bgpd/rfapi/rfapi_rib.c
bgpd/rfapi/vnc_export_bgp.c
doc/developer/process-architecture.rst
eigrpd/eigrp_filter.c
eigrpd/eigrp_hello.c
eigrpd/eigrp_interface.c
eigrpd/eigrp_macros.h
eigrpd/eigrp_neighbor.c
eigrpd/eigrp_packet.c
eigrpd/eigrp_update.c
eigrpd/eigrpd.c
isisd/fabricd.c
isisd/isis_adjacency.c
isisd/isis_circuit.c
isisd/isis_dr.c
isisd/isis_dynhn.c
isisd/isis_events.c
isisd/isis_ldp_sync.c
isisd/isis_lfa.c
isisd/isis_lsp.c
isisd/isis_main.c
isisd/isis_pdu.c
isisd/isis_spf.c
isisd/isis_sr.c
isisd/isis_tx_queue.c
isisd/isisd.c
ldpd/accept.c
ldpd/adjacency.c
ldpd/control.c
ldpd/interface.c
ldpd/lde.c
ldpd/lde_lib.c
ldpd/ldpd.c
ldpd/ldpe.c
ldpd/neighbor.c
ldpd/packet.c
lib/agentx.c
lib/bfd.c
lib/event.c
lib/event.h
lib/frr_pthread.c
lib/frr_zmq.c
lib/frr_zmq.h
lib/libfrr.c
lib/mgmt_be_client.c
lib/mgmt_fe_client.c
lib/northbound_cli.c
lib/northbound_confd.c
lib/northbound_grpc.cpp
lib/northbound_sysrepo.c
lib/pullwr.c
lib/resolver.c
lib/sigevent.c
lib/spf_backoff.c
lib/systemd.c
lib/vty.c
lib/wheel.c
lib/workqueue.c
lib/zclient.c
lib/zlog_5424.c
mgmtd/mgmt_be_adapter.c
mgmtd/mgmt_be_server.c
mgmtd/mgmt_fe_adapter.c
mgmtd/mgmt_fe_server.c
mgmtd/mgmt_txn.c
nhrpd/netlink_arp.c
nhrpd/nhrp_cache.c
nhrpd/nhrp_event.c
nhrpd/nhrp_multicast.c
nhrpd/nhrp_nhs.c
nhrpd/nhrp_packet.c
nhrpd/nhrp_peer.c
nhrpd/nhrp_shortcut.c
nhrpd/vici.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_bfd.c
ospf6d/ospf6_flood.c
ospf6d/ospf6_gr.c
ospf6d/ospf6_gr_helper.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_intra.h
ospf6d/ospf6_lsa.c
ospf6d/ospf6_message.c
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_network.h
ospf6d/ospf6_nssa.c
ospf6d/ospf6_spf.c
ospf6d/ospf6_top.c
ospfclient/ospfclient.c
ospfd/ospf_abr.c
ospfd/ospf_apiserver.c
ospfd/ospf_asbr.c
ospfd/ospf_ase.c
ospfd/ospf_gr.c
ospfd/ospf_gr_helper.c
ospfd/ospf_ism.h
ospfd/ospf_ldp_sync.c
ospfd/ospf_lsa.c
ospfd/ospf_nsm.h
ospfd/ospf_opaque.c
ospfd/ospf_packet.c
ospfd/ospf_spf.c
ospfd/ospf_sr.c
ospfd/ospf_zebra.c
ospfd/ospfd.c
ospfd/ospfd.h
pathd/path_pcep_controller.c
pathd/path_ted.c
pathd/pathd.c
pimd/pim6_mld.c
pimd/pim_assert.c
pimd/pim_bsm.c
pimd/pim_ifchannel.c
pimd/pim_igmp.c
pimd/pim_igmpv3.c
pimd/pim_mlag.c
pimd/pim_mroute.c
pimd/pim_msdp.c
pimd/pim_msdp.h
pimd/pim_msdp_socket.c
pimd/pim_neighbor.c
pimd/pim_pim.c
pimd/pim_ssmpingd.c
pimd/pim_upstream.c
pimd/pim_vxlan.c
pimd/pim_zebra.c
pimd/pim_zlookup.c
pimd/pim_zpthread.c
ripd/rip_interface.c
ripd/rip_peer.c
ripd/ripd.c
ripd/ripd.h
ripngd/ripng_interface.c
ripngd/ripng_peer.c
ripngd/ripngd.c
ripngd/ripngd.h
sharpd/sharp_logpump.c
tests/helpers/c/main.c
tests/lib/test_grpc.cpp
tests/lib/test_heavy_thread.c
tests/lib/test_timer_correctness.c
tests/lib/test_timer_performance.c
tests/lib/test_zmq.c
tools/frr-llvm-cg.c
vrrpd/vrrp.c
vtysh/vtysh.c
vtysh/vtysh_main.c
watchfrr/watchfrr.c
zebra/dplane_fpm_nl.c
zebra/interface.c
zebra/irdp_interface.c
zebra/irdp_main.c
zebra/irdp_packet.c
zebra/kernel_netlink.c
zebra/kernel_socket.c
zebra/main.c
zebra/rtadv.c
zebra/zebra_dplane.c
zebra/zebra_evpn_mac.c
zebra/zebra_evpn_mh.c
zebra/zebra_evpn_neigh.c
zebra/zebra_fpm.c
zebra/zebra_gr.c
zebra/zebra_mlag.c
zebra/zebra_mlag_private.c
zebra/zebra_netns_notify.c
zebra/zebra_nhg.c
zebra/zebra_opaque.c
zebra/zebra_ptm.c
zebra/zebra_pw.c
zebra/zebra_rib.c
zebra/zebra_routemap.c
zebra/zserv.c

index 1cd913c766893c7b27627a9c811680b11ff118f1..7bcf8b9a7861622a0265b599194247c4b298c505 100644 (file)
@@ -148,9 +148,11 @@ babel_create_routing_process (void)
     }
 
     /* Threads. */
-    thread_add_read(master, babel_read_protocol, NULL, protocol_socket, &babel_routing_process->t_read);
+    event_add_read(master, babel_read_protocol, NULL, protocol_socket,
+                  &babel_routing_process->t_read);
     /* wait a little: zebra will announce interfaces, addresses, routes... */
-    thread_add_timer_msec(master, babel_init_routing_process, NULL, 200L, &babel_routing_process->t_update);
+    event_add_timer_msec(master, babel_init_routing_process, NULL, 200L,
+                        &babel_routing_process->t_update);
 
     /* Distribute list install. */
     babel_routing_process->distribute_ctx = distribute_list_ctx_create (vrf_lookup_by_id(VRF_DEFAULT));
@@ -193,7 +195,8 @@ static void babel_read_protocol(struct event *thread)
     }
 
     /* re-add thread */
-    thread_add_read(master, &babel_read_protocol, NULL, protocol_socket, &babel_routing_process->t_read);
+    event_add_read(master, &babel_read_protocol, NULL, protocol_socket,
+                  &babel_routing_process->t_read);
 }
 
 /* Zebra will give some information, especially about interfaces. This function
@@ -483,7 +486,8 @@ babel_set_timer(struct timeval *timeout)
 {
     long msecs = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
     thread_cancel(&(babel_routing_process->t_update));
-    thread_add_timer_msec(master, babel_main_loop, NULL, msecs, &babel_routing_process->t_update);
+    event_add_timer_msec(master, babel_main_loop, NULL, msecs,
+                        &babel_routing_process->t_update);
 }
 
 void
index 0ca2ca1f024b4d73bff2f62d3da7da73e4fdd1a8..184dfbc8f92e96574457efd74eeebf6119411491 100644 (file)
@@ -1957,23 +1957,23 @@ static int bfd_vrf_enable(struct vrf *vrf)
                bvrf->bg_echov6 = bp_echov6_socket(vrf);
 
        if (!bvrf->bg_ev[0] && bvrf->bg_shop != -1)
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_shop,
-                               &bvrf->bg_ev[0]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_shop,
+                              &bvrf->bg_ev[0]);
        if (!bvrf->bg_ev[1] && bvrf->bg_mhop != -1)
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_mhop,
-                               &bvrf->bg_ev[1]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_mhop,
+                              &bvrf->bg_ev[1]);
        if (!bvrf->bg_ev[2] && bvrf->bg_shop6 != -1)
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_shop6,
-                               &bvrf->bg_ev[2]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_shop6,
+                              &bvrf->bg_ev[2]);
        if (!bvrf->bg_ev[3] && bvrf->bg_mhop6 != -1)
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_mhop6,
-                               &bvrf->bg_ev[3]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_mhop6,
+                              &bvrf->bg_ev[3]);
        if (!bvrf->bg_ev[4] && bvrf->bg_echo != -1)
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_echo,
-                               &bvrf->bg_ev[4]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_echo,
+                              &bvrf->bg_ev[4]);
        if (!bvrf->bg_ev[5] && bvrf->bg_echov6 != -1)
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_echov6,
-                               &bvrf->bg_ev[5]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_echov6,
+                              &bvrf->bg_ev[5]);
 
        if (vrf->vrf_id != VRF_DEFAULT) {
                bfdd_zclient_register(vrf->vrf_id);
index 05ed2702d0bade028f513829eae13e352a5eef79..2e7bd835fb09ea60fe668e01c80fca3096d4829f 100644 (file)
@@ -702,28 +702,28 @@ static void bfd_sd_reschedule(struct bfd_vrf_global *bvrf, int sd)
 {
        if (sd == bvrf->bg_shop) {
                THREAD_OFF(bvrf->bg_ev[0]);
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_shop,
-                               &bvrf->bg_ev[0]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_shop,
+                              &bvrf->bg_ev[0]);
        } else if (sd == bvrf->bg_mhop) {
                THREAD_OFF(bvrf->bg_ev[1]);
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_mhop,
-                               &bvrf->bg_ev[1]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_mhop,
+                              &bvrf->bg_ev[1]);
        } else if (sd == bvrf->bg_shop6) {
                THREAD_OFF(bvrf->bg_ev[2]);
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_shop6,
-                               &bvrf->bg_ev[2]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_shop6,
+                              &bvrf->bg_ev[2]);
        } else if (sd == bvrf->bg_mhop6) {
                THREAD_OFF(bvrf->bg_ev[3]);
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_mhop6,
-                               &bvrf->bg_ev[3]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_mhop6,
+                              &bvrf->bg_ev[3]);
        } else if (sd == bvrf->bg_echo) {
                THREAD_OFF(bvrf->bg_ev[4]);
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_echo,
-                               &bvrf->bg_ev[4]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_echo,
+                              &bvrf->bg_ev[4]);
        } else if (sd == bvrf->bg_echov6) {
                THREAD_OFF(bvrf->bg_ev[5]);
-               thread_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_echov6,
-                               &bvrf->bg_ev[5]);
+               event_add_read(master, bfd_recv_cb, bvrf, bvrf->bg_echov6,
+                              &bvrf->bg_ev[5]);
        }
 }
 
index a3751e4d330daf05a3979d008416b654aadba61c..77d66ae1043d16aabfcdc36e681b313478c02586 100644 (file)
@@ -375,8 +375,8 @@ int main(int argc, char *argv[])
        /* Initialize zebra connection. */
        bfdd_zclient_init(&bglobal.bfdd_privs);
 
-       thread_add_read(master, control_accept, NULL, bglobal.bg_csock,
-                       &bglobal.bg_csockev);
+       event_add_read(master, control_accept, NULL, bglobal.bg_csock,
+                      &bglobal.bg_csockev);
 
        /* Install commands. */
        bfdd_vty_init();
index db9778a8eb0bf0704c1210e36c157dc92e374848..95e0ef3d6022779beeedb54b0c242f809953cc5a 100644 (file)
@@ -154,7 +154,7 @@ void control_accept(struct event *t)
 
        control_new(csock);
 
-       thread_add_read(master, control_accept, NULL, sd, &bglobal.bg_csockev);
+       event_add_read(master, control_accept, NULL, sd, &bglobal.bg_csockev);
 }
 
 
@@ -171,7 +171,7 @@ struct bfd_control_socket *control_new(int sd)
        bcs->bcs_notify = 0;
 
        bcs->bcs_sd = sd;
-       thread_add_read(master, control_read, bcs, sd, &bcs->bcs_ev);
+       event_add_read(master, control_read, bcs, sd, &bcs->bcs_ev);
 
        TAILQ_INIT(&bcs->bcs_bcqueue);
        TAILQ_INIT(&bcs->bcs_bnplist);
@@ -286,8 +286,8 @@ static int control_queue_dequeue(struct bfd_control_socket *bcs)
        bcs->bcs_bout = &bcq->bcq_bcb;
 
        bcs->bcs_outev = NULL;
-       thread_add_write(master, control_write, bcs, bcs->bcs_sd,
-                        &bcs->bcs_outev);
+       event_add_write(master, control_write, bcs, bcs->bcs_sd,
+                       &bcs->bcs_outev);
 
        return 1;
 
@@ -315,8 +315,8 @@ static int control_queue_enqueue(struct bfd_control_socket *bcs,
                bcs->bcs_bout = bcb;
 
                /* New messages, active write events. */
-               thread_add_write(master, control_write, bcs, bcs->bcs_sd,
-                                &bcs->bcs_outev);
+               event_add_write(master, control_write, bcs, bcs->bcs_sd,
+                               &bcs->bcs_outev);
        }
 
        return 0;
@@ -511,7 +511,7 @@ skip_header:
 
 schedule_next_read:
        bcs->bcs_ev = NULL;
-       thread_add_read(master, control_read, bcs, sd, &bcs->bcs_ev);
+       event_add_read(master, control_read, bcs, sd, &bcs->bcs_ev);
 }
 
 static void control_write(struct event *t)
@@ -529,8 +529,8 @@ static void control_write(struct event *t)
        if (bwrite < 0) {
                if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
                        bcs->bcs_outev = NULL;
-                       thread_add_write(master, control_write, bcs,
-                                        bcs->bcs_sd, &bcs->bcs_outev);
+                       event_add_write(master, control_write, bcs, bcs->bcs_sd,
+                                       &bcs->bcs_outev);
                        return;
                }
 
@@ -543,8 +543,8 @@ static void control_write(struct event *t)
        bcb->bcb_left -= bwrite;
        if (bcb->bcb_left > 0) {
                bcs->bcs_outev = NULL;
-               thread_add_write(master, control_write, bcs, bcs->bcs_sd,
-                                &bcs->bcs_outev);
+               event_add_write(master, control_write, bcs, bcs->bcs_sd,
+                               &bcs->bcs_outev);
                return;
        }
 
index b2c52f543f52fe4b23eb8c934c952e7174c4190c..7bdebfa1f4212eeb6fc5debeaec14ff6c62a6a98 100644 (file)
@@ -429,8 +429,8 @@ static int bfd_dplane_enqueue(struct bfd_dplane_ctx *bdc, const void *buf,
 
        /* Schedule if it is not yet. */
        if (bdc->outbufev == NULL)
-               thread_add_write(master, bfd_dplane_write, bdc, bdc->sock,
-                                &bdc->outbufev);
+               event_add_write(master, bfd_dplane_write, bdc, bdc->sock,
+                               &bdc->outbufev);
 
        return 0;
 }
@@ -609,7 +609,7 @@ static void bfd_dplane_read(struct event *t)
                return;
 
        stream_pulldown(bdc->inbuf);
-       thread_add_read(master, bfd_dplane_read, bdc, bdc->sock, &bdc->inbufev);
+       event_add_read(master, bfd_dplane_read, bdc, bdc->sock, &bdc->inbufev);
 }
 
 static void _bfd_session_register_dplane(struct hash_bucket *hb, void *arg)
@@ -641,7 +641,7 @@ static struct bfd_dplane_ctx *bfd_dplane_ctx_new(int sock)
        if (sock == -1)
                return bdc;
 
-       thread_add_read(master, bfd_dplane_read, bdc, sock, &bdc->inbufev);
+       event_add_read(master, bfd_dplane_read, bdc, sock, &bdc->inbufev);
 
        /* Register all unattached sessions. */
        bfd_key_iterate(_bfd_session_register_dplane, bdc);
@@ -682,8 +682,8 @@ static void bfd_dplane_ctx_free(struct bfd_dplane_ctx *bdc)
                socket_close(&bdc->sock);
                THREAD_OFF(bdc->inbufev);
                THREAD_OFF(bdc->outbufev);
-               thread_add_timer(master, bfd_dplane_client_connect, bdc, 3,
-                                &bdc->connectev);
+               event_add_timer(master, bfd_dplane_client_connect, bdc, 3,
+                               &bdc->connectev);
                return;
        }
 
@@ -840,8 +840,8 @@ static void bfd_dplane_accept(struct event *t)
                zlog_debug("%s: new data plane client connected", __func__);
 
 reschedule_and_return:
-       thread_add_read(master, bfd_dplane_accept, bg, bg->bg_dplane_sock,
-                       &bglobal.bg_dplane_sockev);
+       event_add_read(master, bfd_dplane_accept, bg, bg->bg_dplane_sock,
+                      &bglobal.bg_dplane_sockev);
 }
 
 /*
@@ -856,7 +856,7 @@ static void _bfd_dplane_client_bootstrap(struct bfd_dplane_ctx *bdc)
        stream_reset(bdc->outbuf);
 
        /* Ask for read notifications. */
-       thread_add_read(master, bfd_dplane_read, bdc, bdc->sock, &bdc->inbufev);
+       event_add_read(master, bfd_dplane_read, bdc, bdc->sock, &bdc->inbufev);
 
        /* Remove all sessions then register again to send them all. */
        bfd_key_iterate(_bfd_session_unregister_dplane, bdc);
@@ -938,8 +938,8 @@ static void bfd_dplane_client_connect(struct event *t)
 
                /* If we are not connected yet, ask for write notifications. */
                bdc->connecting = true;
-               thread_add_write(master, bfd_dplane_write, bdc, bdc->sock,
-                                &bdc->outbufev);
+               event_add_write(master, bfd_dplane_write, bdc, bdc->sock,
+                               &bdc->outbufev);
        } else {
                if (bglobal.debug_dplane)
                        zlog_debug("%s: server connection: %d", __func__, sock);
@@ -952,8 +952,8 @@ reschedule_connect:
        THREAD_OFF(bdc->inbufev);
        THREAD_OFF(bdc->outbufev);
        socket_close(&sock);
-       thread_add_timer(master, bfd_dplane_client_connect, bdc, 3,
-                        &bdc->connectev);
+       event_add_timer(master, bfd_dplane_client_connect, bdc, 3,
+                       &bdc->connectev);
 }
 
 static void bfd_dplane_client_init(const struct sockaddr *sa, socklen_t salen)
@@ -974,8 +974,8 @@ static void bfd_dplane_client_init(const struct sockaddr *sa, socklen_t salen)
 
        bdc->client = true;
 
-       thread_add_timer(master, bfd_dplane_client_connect, bdc, 0,
-                        &bdc->connectev);
+       event_add_timer(master, bfd_dplane_client_connect, bdc, 0,
+                       &bdc->connectev);
 
        /* Insert into data plane lists. */
        TAILQ_INSERT_TAIL(&bglobal.bg_dplaneq, bdc, entry);
@@ -1067,8 +1067,8 @@ void bfd_dplane_init(const struct sockaddr *sa, socklen_t salen, bool client)
        }
 
        bglobal.bg_dplane_sock = sock;
-       thread_add_read(master, bfd_dplane_accept, &bglobal, sock,
-                       &bglobal.bg_dplane_sockev);
+       event_add_read(master, bfd_dplane_accept, &bglobal, sock,
+                      &bglobal.bg_dplane_sockev);
 }
 
 int bfd_dplane_add_session(struct bfd_session *bs)
index 5a9ae39c3e4e494340e0598a139f1d01e6502b37..c6326ef91f562313489e15f293814b43cb486ae9 100644 (file)
@@ -36,8 +36,8 @@ void bfd_recvtimer_update(struct bfd_session *bs)
 
        tv_normalize(&tv);
 
-       thread_add_timer_tv(master, bfd_recvtimer_cb, bs, &tv,
-                           &bs->recvtimer_ev);
+       event_add_timer_tv(master, bfd_recvtimer_cb, bs, &tv,
+                          &bs->recvtimer_ev);
 }
 
 void bfd_echo_recvtimer_update(struct bfd_session *bs)
@@ -54,8 +54,8 @@ void bfd_echo_recvtimer_update(struct bfd_session *bs)
 
        tv_normalize(&tv);
 
-       thread_add_timer_tv(master, bfd_echo_recvtimer_cb, bs, &tv,
-                           &bs->echo_recvtimer_ev);
+       event_add_timer_tv(master, bfd_echo_recvtimer_cb, bs, &tv,
+                          &bs->echo_recvtimer_ev);
 }
 
 void bfd_xmttimer_update(struct bfd_session *bs, uint64_t jitter)
@@ -72,7 +72,7 @@ void bfd_xmttimer_update(struct bfd_session *bs, uint64_t jitter)
 
        tv_normalize(&tv);
 
-       thread_add_timer_tv(master, bfd_xmt_cb, bs, &tv, &bs->xmttimer_ev);
+       event_add_timer_tv(master, bfd_xmt_cb, bs, &tv, &bs->xmttimer_ev);
 }
 
 void bfd_echo_xmttimer_update(struct bfd_session *bs, uint64_t jitter)
@@ -89,8 +89,8 @@ void bfd_echo_xmttimer_update(struct bfd_session *bs, uint64_t jitter)
 
        tv_normalize(&tv);
 
-       thread_add_timer_tv(master, bfd_echo_xmt_cb, bs, &tv,
-                           &bs->echo_xmttimer_ev);
+       event_add_timer_tv(master, bfd_echo_xmt_cb, bs, &tv,
+                          &bs->echo_xmttimer_ev);
 }
 
 void bfd_recvtimer_delete(struct bfd_session *bs)
index 1cce0d7df69932f64488e056ba788898a8a11361..474ec0622c8e21ba8a50c1276d7b0cc36bcee4cf 100644 (file)
@@ -1344,8 +1344,8 @@ static void bmp_stats(struct event *thread)
        struct timeval tv;
 
        if (bt->stat_msec)
-               thread_add_timer_msec(bm->master, bmp_stats, bt, bt->stat_msec,
-                               &bt->t_stats);
+               event_add_timer_msec(bm->master, bmp_stats, bt, bt->stat_msec,
+                                    &bt->t_stats);
 
        gettimeofday(&tv, NULL);
 
@@ -1409,7 +1409,7 @@ static void bmp_read(struct event *t)
                return;
        }
 
-       thread_add_read(bm->master, bmp_read, bmp, bmp->socket, &bmp->t_read);
+       event_add_read(bm->master, bmp_read, bmp, bmp->socket, &bmp->t_read);
 }
 
 static struct bmp *bmp_open(struct bmp_targets *bt, int bmp_sock)
@@ -1485,7 +1485,7 @@ static struct bmp *bmp_open(struct bmp_targets *bt, int bmp_sock)
        bmp->state = BMP_PeerUp;
        bmp->pullwr = pullwr_new(bm->master, bmp_sock, bmp, bmp_wrfill,
                        bmp_wrerr);
-       thread_add_read(bm->master, bmp_read, bmp, bmp_sock, &bmp->t_read);
+       event_add_read(bm->master, bmp_read, bmp, bmp_sock, &bmp->t_read);
        bmp_send_initiation(bmp);
 
        return bmp;
@@ -1499,7 +1499,7 @@ static void bmp_accept(struct event *thread)
        int bmp_sock;
 
        /* We continue hearing BMP socket. */
-       thread_add_read(bm->master, bmp_accept, bl, bl->sock, &bl->t_accept);
+       event_add_read(bm->master, bmp_accept, bl, bl->sock, &bl->t_accept);
 
        memset(&su, 0, sizeof(union sockunion));
 
@@ -1721,7 +1721,7 @@ static void bmp_listener_start(struct bmp_listener *bl)
                goto out_sock;
 
        bl->sock = sock;
-       thread_add_read(bm->master, bmp_accept, bl, sock, &bl->t_accept);
+       event_add_read(bm->master, bmp_accept, bl, sock, &bl->t_accept);
        return;
 out_sock:
        close(sock);
@@ -1980,12 +1980,12 @@ static void bmp_active_setup(struct bmp_active *ba)
                ba->curretry = ba->maxretry;
 
        if (ba->socket == -1)
-               thread_add_timer_msec(bm->master, bmp_active_thread, ba,
-                                     ba->curretry, &ba->t_timer);
+               event_add_timer_msec(bm->master, bmp_active_thread, ba,
+                                    ba->curretry, &ba->t_timer);
        else {
-               thread_add_read(bm->master, bmp_active_thread, ba, ba->socket,
-                               &ba->t_read);
-               thread_add_write(bm->master, bmp_active_thread, ba, ba->socket,
+               event_add_read(bm->master, bmp_active_thread, ba, ba->socket,
+                              &ba->t_read);
+               event_add_write(bm->master, bmp_active_thread, ba, ba->socket,
                                &ba->t_write);
        }
 }
@@ -2199,8 +2199,8 @@ DEFPY(bmp_stats_cfg,
                bt->stat_msec = BMP_STAT_DEFAULT_TIMER;
 
        if (bt->stat_msec)
-               thread_add_timer_msec(bm->master, bmp_stats, bt, bt->stat_msec,
-                                     &bt->t_stats);
+               event_add_timer_msec(bm->master, bmp_stats, bt, bt->stat_msec,
+                                    &bt->t_stats);
        return CMD_SUCCESS;
 }
 
index 9818538454b34ef409bd085ffed00d1b9edb4560..32ff4bf2e496d8b19fc068582f58ef424cece2e4 100644 (file)
@@ -168,8 +168,8 @@ static void bgp_conditional_adv_timer(struct event *t)
        bgp = THREAD_ARG(t);
        assert(bgp);
 
-       thread_add_timer(bm->master, bgp_conditional_adv_timer, bgp,
-                        bgp->condition_check_period, &bgp->t_condition_check);
+       event_add_timer(bm->master, bgp_conditional_adv_timer, bgp,
+                       bgp->condition_check_period, &bgp->t_condition_check);
 
        /* loop through each peer and check if we have peers with
         * advmap_table_change attribute set, to make sure we send
@@ -329,8 +329,8 @@ void bgp_conditional_adv_enable(struct peer *peer, afi_t afi, safi_t safi)
 
        /* Register for conditional routes polling timer */
        if (!thread_is_scheduled(bgp->t_condition_check))
-               thread_add_timer(bm->master, bgp_conditional_adv_timer, bgp, 0,
-                                &bgp->t_condition_check);
+               event_add_timer(bm->master, bgp_conditional_adv_timer, bgp, 0,
+                               &bgp->t_condition_check);
 }
 
 void bgp_conditional_adv_disable(struct peer *peer, afi_t afi, safi_t safi)
index e8dca2a75fb398f5b281f7fcef9b16ece608a88d..b33480b63eef3448a9c59fa1e57a8e49e9cfa69b 100644 (file)
@@ -107,8 +107,8 @@ static void bgp_reuse_timer(struct event *t)
        struct bgp_damp_config *bdc = THREAD_ARG(t);
 
        bdc->t_reuse = NULL;
-       thread_add_timer(bm->master, bgp_reuse_timer, bdc, DELTA_REUSE,
-                        &bdc->t_reuse);
+       event_add_timer(bm->master, bgp_reuse_timer, bdc, DELTA_REUSE,
+                       &bdc->t_reuse);
 
        t_now = monotime(NULL);
 
@@ -395,8 +395,8 @@ int bgp_damp_enable(struct bgp *bgp, afi_t afi, safi_t safi, time_t half,
        bgp_damp_parameter_set(half, reuse, suppress, max, bdc);
 
        /* Register reuse timer.  */
-       thread_add_timer(bm->master, bgp_reuse_timer, bdc, DELTA_REUSE,
-                        &bdc->t_reuse);
+       event_add_timer(bm->master, bgp_reuse_timer, bdc, DELTA_REUSE,
+                       &bdc->t_reuse);
 
        return 0;
 }
index 25e921cff263981dc4c036ca5718622cdcef823f..0087de95a81b08d390f29382619914be7b1d7038 100644 (file)
@@ -154,13 +154,13 @@ static int bgp_dump_interval_add(struct bgp_dump *bgp_dump, int interval)
                        interval = interval
                                   - secs_into_day % interval; /* always > 0 */
                }
-               thread_add_timer(bm->master, bgp_dump_interval_func, bgp_dump,
-                                interval, &bgp_dump->t_interval);
+               event_add_timer(bm->master, bgp_dump_interval_func, bgp_dump,
+                               interval, &bgp_dump->t_interval);
        } else {
                /* One-off dump: execute immediately, don't affect any scheduled
                 * dumps */
-               thread_add_event(bm->master, bgp_dump_interval_func, bgp_dump,
-                                0, &bgp_dump->t_interval);
+               event_add_event(bm->master, bgp_dump_interval_func, bgp_dump, 0,
+                               &bgp_dump->t_interval);
        }
 
        return 0;
index bdee8a2fbd450ab406bf79b932cb9e5733442249..c0daae45d0bb9b475fee3d94f7a718e662be9de9 100644 (file)
@@ -4174,9 +4174,9 @@ static void bgp_evpn_es_cons_checks_timer_start(void)
        if (BGP_DEBUG(evpn_mh, EVPN_MH_ES))
                zlog_debug("periodic consistency checking started");
 
-       thread_add_timer(bm->master, bgp_evpn_run_consistency_checks, NULL,
-                        BGP_EVPN_CONS_CHECK_INTERVAL,
-                        &bgp_mh_info->t_cons_check);
+       event_add_timer(bm->master, bgp_evpn_run_consistency_checks, NULL,
+                       BGP_EVPN_CONS_CHECK_INTERVAL,
+                       &bgp_mh_info->t_cons_check);
 }
 
 /* queue up the es for background consistency checks */
@@ -4380,7 +4380,7 @@ static void bgp_evpn_run_consistency_checks(struct event *t)
        }
 
        /* restart the timer */
-       thread_add_timer(bm->master, bgp_evpn_run_consistency_checks, NULL,
+       event_add_timer(bm->master, bgp_evpn_run_consistency_checks, NULL,
                        BGP_EVPN_CONS_CHECK_INTERVAL,
                        &bgp_mh_info->t_cons_check);
 }
index 79f0444e842f5e791d54b6bf1aa9b0d411d19c8c..001a8da1cc4f89affac8917afdc57d506e7cf238 100644 (file)
@@ -343,8 +343,8 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
 
        bgp_reads_on(peer);
        bgp_writes_on(peer);
-       thread_add_event(bm->master, bgp_process_packet, peer, 0,
-                        &peer->t_process_packet);
+       event_add_event(bm->master, bgp_process_packet, peer, 0,
+                       &peer->t_process_packet);
 
        return (peer);
 }
@@ -583,8 +583,8 @@ void bgp_routeadv_timer(struct event *thread)
 
        peer->synctime = monotime(NULL);
 
-       thread_add_timer_msec(bm->master, bgp_generate_updgrp_packets, peer, 0,
-                             &peer->t_generate_updgrp_packets);
+       event_add_timer_msec(bm->master, bgp_generate_updgrp_packets, peer, 0,
+                            &peer->t_generate_updgrp_packets);
 
        /* MRAI timer will be started again when FIFO is built, no need to
         * do it here.
@@ -820,10 +820,9 @@ static void bgp_graceful_restart_timer_expire(struct event *thread)
                        bgp_set_llgr_stale(peer, afi, safi);
                        bgp_clear_stale_route(peer, afi, safi);
 
-                       thread_add_timer(bm->master,
-                                        bgp_llgr_stale_timer_expire, paf,
-                                        peer->llgr[afi][safi].stale_time,
-                                        &peer->t_llgr_stale[afi][safi]);
+                       event_add_timer(bm->master, bgp_llgr_stale_timer_expire,
+                                       paf, peer->llgr[afi][safi].stale_time,
+                                       &peer->t_llgr_stale[afi][safi]);
 
                        for (ALL_LIST_ELEMENTS(peer->bgp->peer, node, nnode,
                                               tmp_peer))
@@ -1147,8 +1146,8 @@ static void bgp_maxmed_onstartup_begin(struct bgp *bgp)
        zlog_info("Begin maxmed onstartup mode - timer %d seconds",
                  bgp->v_maxmed_onstartup);
 
-       thread_add_timer(bm->master, bgp_maxmed_onstartup_timer, bgp,
-                        bgp->v_maxmed_onstartup, &bgp->t_maxmed_onstartup);
+       event_add_timer(bm->master, bgp_maxmed_onstartup_timer, bgp,
+                       bgp->v_maxmed_onstartup, &bgp->t_maxmed_onstartup);
 
        if (!bgp->v_maxmed_admin) {
                bgp->maxmed_active = 1;
@@ -1206,12 +1205,12 @@ static void bgp_update_delay_begin(struct bgp *bgp)
                peer->update_delay_over = 0;
 
        /* Start the update-delay timer */
-       thread_add_timer(bm->master, bgp_update_delay_timer, bgp,
-                        bgp->v_update_delay, &bgp->t_update_delay);
+       event_add_timer(bm->master, bgp_update_delay_timer, bgp,
+                       bgp->v_update_delay, &bgp->t_update_delay);
 
        if (bgp->v_establish_wait != bgp->v_update_delay)
-               thread_add_timer(bm->master, bgp_establish_wait_timer, bgp,
-                                bgp->v_establish_wait, &bgp->t_establish_wait);
+               event_add_timer(bm->master, bgp_establish_wait_timer, bgp,
+                               bgp->v_establish_wait, &bgp->t_establish_wait);
 
        frr_timestamp(3, bgp->update_delay_begin_time,
                      sizeof(bgp->update_delay_begin_time));
@@ -1941,10 +1940,10 @@ enum bgp_fsm_state_progress bgp_start(struct peer *peer)
                 * bgp_connect_check() as the handler for each and cancel the
                 * unused event in that function.
                 */
-               thread_add_read(bm->master, bgp_connect_check, peer, peer->fd,
-                               &peer->t_connect_check_r);
-               thread_add_write(bm->master, bgp_connect_check, peer, peer->fd,
-                                &peer->t_connect_check_w);
+               event_add_read(bm->master, bgp_connect_check, peer, peer->fd,
+                              &peer->t_connect_check_r);
+               event_add_write(bm->master, bgp_connect_check, peer, peer->fd,
+                               &peer->t_connect_check_w);
                break;
        }
        return BGP_FSM_SUCCESS;
@@ -2046,9 +2045,9 @@ static int bgp_start_deferral_timer(struct bgp *bgp, afi_t afi, safi_t safi,
                thread_info->safi = safi;
                thread_info->bgp = bgp;
 
-               thread_add_timer(bm->master, bgp_graceful_deferral_timer_expire,
-                                thread_info, bgp->select_defer_time,
-                                &gr_info->t_select_deferral);
+               event_add_timer(bm->master, bgp_graceful_deferral_timer_expire,
+                               thread_info, bgp->select_defer_time,
+                               &gr_info->t_select_deferral);
        }
        gr_info->eor_required++;
        /* Send message to RIB indicating route update pending */
index 432072edebf1394d7e075cc81e46ac217b584a93..9af02436cf5e1659bc6b9dcd19b3cad5d7693720 100644 (file)
 #define BGP_TIMER_ON(T, F, V)                                                  \
        do {                                                                   \
                if ((peer->status != Deleted))                                 \
-                       thread_add_timer(bm->master, (F), peer, (V), &(T));    \
+                       event_add_timer(bm->master, (F), peer, (V), &(T));     \
        } while (0)
 
 #define BGP_EVENT_ADD(P, E)                                                    \
        do {                                                                   \
                if ((P)->status != Deleted)                                    \
-                       thread_add_event(bm->master, bgp_event, (P), (E),      \
-                                        NULL);                                \
+                       event_add_event(bm->master, bgp_event, (P), (E),       \
+                                       NULL);                                 \
        } while (0)
 
 #define BGP_EVENT_FLUSH(P)                                                     \
                thread_cancel_event_ready(bm->master, (P));                    \
        } while (0)
 
-#define BGP_UPDATE_GROUP_TIMER_ON(T, F)                                               \
-       do {                                                                   \
-               if (BGP_SUPPRESS_FIB_ENABLED(peer->bgp) &&                     \
-                   PEER_ROUTE_ADV_DELAY(peer))                                \
-                       thread_add_timer_msec(bm->master, (F), peer,           \
-                               (BGP_DEFAULT_UPDATE_ADVERTISEMENT_TIME * 1000),\
-                               (T));                                          \
-               else                                                           \
-                       thread_add_timer_msec(bm->master, (F), peer,           \
-                                             0, (T));                         \
-       } while (0)                                                            \
+#define BGP_UPDATE_GROUP_TIMER_ON(T, F)                                        \
+       do {                                                                   \
+               if (BGP_SUPPRESS_FIB_ENABLED(peer->bgp) &&                     \
+                   PEER_ROUTE_ADV_DELAY(peer))                                \
+                       event_add_timer_msec(                                  \
+                               bm->master, (F), peer,                         \
+                               (BGP_DEFAULT_UPDATE_ADVERTISEMENT_TIME *       \
+                                1000),                                        \
+                               (T));                                          \
+               else                                                           \
+                       event_add_timer_msec(bm->master, (F), peer, 0, (T));   \
+       } while (0)
 
 #define BGP_MSEC_JITTER 10
 
index 6b8ae844812c6d03446901e73ce0a524bb36563a..6af01be315cd1983f50b5ca3d85194e158b1fda6 100644 (file)
@@ -55,8 +55,8 @@ void bgp_writes_on(struct peer *peer)
        assert(!peer->t_connect_check_w);
        assert(peer->fd);
 
-       thread_add_write(fpt->master, bgp_process_writes, peer, peer->fd,
-                        &peer->t_write);
+       event_add_write(fpt->master, bgp_process_writes, peer, peer->fd,
+                       &peer->t_write);
        SET_FLAG(peer->thread_flags, PEER_THREAD_WRITES_ON);
 }
 
@@ -85,8 +85,8 @@ void bgp_reads_on(struct peer *peer)
        assert(!peer->t_connect_check_w);
        assert(peer->fd);
 
-       thread_add_read(fpt->master, bgp_process_reads, peer, peer->fd,
-                       &peer->t_read);
+       event_add_read(fpt->master, bgp_process_reads, peer, peer->fd,
+                      &peer->t_read);
 
        SET_FLAG(peer->thread_flags, PEER_THREAD_READS_ON);
 }
@@ -142,8 +142,8 @@ static void bgp_process_writes(struct event *thread)
         * sent in the update message
         */
        if (reschedule) {
-               thread_add_write(fpt->master, bgp_process_writes, peer,
-                                peer->fd, &peer->t_write);
+               event_add_write(fpt->master, bgp_process_writes, peer, peer->fd,
+                               &peer->t_write);
        } else if (!fatal) {
                BGP_UPDATE_GROUP_TIMER_ON(&peer->t_generate_updgrp_packets,
                                          bgp_generate_updgrp_packets);
@@ -247,8 +247,8 @@ static void bgp_process_reads(struct event *thread)
                /* Handle the error in the main pthread, include the
                 * specific state change from 'bgp_read'.
                 */
-               thread_add_event(bm->master, bgp_packet_process_error,
-                                peer, code, &peer->t_process_packet_error);
+               event_add_event(bm->master, bgp_packet_process_error, peer,
+                               code, &peer->t_process_packet_error);
                goto done;
        }
 
@@ -292,11 +292,11 @@ done:
        if (!ibuf_full)
                assert(ringbuf_space(peer->ibuf_work) >= peer->max_packet_size);
 
-       thread_add_read(fpt->master, bgp_process_reads, peer, peer->fd,
-                       &peer->t_read);
+       event_add_read(fpt->master, bgp_process_reads, peer, peer->fd,
+                      &peer->t_read);
        if (added_pkt)
-               thread_add_event(bm->master, bgp_process_packet, peer, 0,
-                                &peer->t_process_packet);
+               event_add_event(bm->master, bgp_process_packet, peer, 0,
+                               &peer->t_process_packet);
 }
 
 /*
index c10f33a2d978cb344352aff11500bc235ea6d2c7..91c791499a48ea0120f89c58fb312250b1d3d6e8 100644 (file)
@@ -362,8 +362,8 @@ static void bgp_accept(struct event *thread)
                return;
        }
 
-       thread_add_read(bm->master, bgp_accept, listener, accept_sock,
-                       &listener->thread);
+       event_add_read(bm->master, bgp_accept, listener, accept_sock,
+                      &listener->thread);
 
        /* Accept client connection. */
        bgp_sock = sockunion_accept(accept_sock, &su);
@@ -861,8 +861,8 @@ static int bgp_listener(int sock, struct sockaddr *sa, socklen_t salen,
                listener->bgp = bgp;
 
        memcpy(&listener->su, sa, salen);
-       thread_add_read(bm->master, bgp_accept, listener, sock,
-                       &listener->thread);
+       event_add_read(bm->master, bgp_accept, listener, sock,
+                      &listener->thread);
        listnode_add(bm->listen_sockets, listener);
 
        return 0;
index 391332f4c2f11912a9381d91d891b23f504c085b..9eef27f7608402916837ec251aef7988a91529e7 100644 (file)
@@ -811,8 +811,8 @@ void bgp_nht_interface_events(struct peer *peer)
                return;
 
        if (bnc->ifindex)
-               thread_add_event(bm->master, bgp_nht_ifp_initial, bnc->bgp,
-                                bnc->ifindex, NULL);
+               event_add_event(bm->master, bgp_nht_ifp_initial, bnc->bgp,
+                               bnc->ifindex, NULL);
 }
 
 void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
index e124095913e959b1a483ab9ebfec2c6ec8180489..b8bf383047e3b8791053da4a910323fbe1f46f29 100644 (file)
@@ -2595,10 +2595,10 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size)
                }
 
                if (peer_established(peer))
-                       thread_add_timer(bm->master,
-                                        bgp_refresh_stalepath_timer_expire,
-                                        paf, peer->bgp->stalepath_time,
-                                        &peer->t_refresh_stalepath);
+                       event_add_timer(bm->master,
+                                       bgp_refresh_stalepath_timer_expire, paf,
+                                       peer->bgp->stalepath_time,
+                                       &peer->t_refresh_stalepath);
 
                if (bgp_debug_neighbor_events(peer))
                        zlog_debug(
@@ -3021,9 +3021,9 @@ void bgp_process_packet(struct event *thread)
                frr_with_mutex (&peer->io_mtx) {
                        // more work to do, come back later
                        if (peer->ibuf->count > 0)
-                               thread_add_event(
-                                       bm->master, bgp_process_packet, peer, 0,
-                                       &peer->t_process_packet);
+                               event_add_event(bm->master, bgp_process_packet,
+                                               peer, 0,
+                                               &peer->t_process_packet);
                }
        }
 }
index 3dcddf49ea98871aff755e73105e39a9900a01c8..5a94da2f47dcdef14d8e0f00dd6095b09664436a 100644 (file)
@@ -3281,7 +3281,7 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
 
                if (!bgp->t_rmap_def_originate_eval) {
                        bgp_lock(bgp);
-                       thread_add_timer(
+                       event_add_timer(
                                bm->master,
                                update_group_refresh_default_originate_route_map,
                                bgp, RMAP_DEFAULT_ORIGINATE_EVAL_TIMER,
@@ -3433,7 +3433,7 @@ void bgp_best_path_select_defer(struct bgp *bgp, afi_t afi, safi_t safi)
        /* If there are more routes to be processed, start the
         * selection timer
         */
-       thread_add_timer(bm->master, bgp_route_select_timer_expire, thread_info,
+       event_add_timer(bm->master, bgp_route_select_timer_expire, thread_info,
                        BGP_ROUTE_SELECT_DELAY,
                        &bgp->gr_info[afi][safi].t_route_select);
 }
@@ -5109,11 +5109,11 @@ void bgp_announce_route(struct peer *peer, afi_t afi, safi_t safi, bool force)
         * multiple peers and the announcement doesn't happen in the
         * vty context.
         */
-       thread_add_timer_msec(bm->master, bgp_announce_route_timer_expired, paf,
-                             (subgrp->peer_count == 1)
-                                     ? BGP_ANNOUNCE_ROUTE_SHORT_DELAY_MS
-                                     : BGP_ANNOUNCE_ROUTE_DELAY_MS,
-                             &paf->t_announce_route);
+       event_add_timer_msec(bm->master, bgp_announce_route_timer_expired, paf,
+                            (subgrp->peer_count == 1)
+                                    ? BGP_ANNOUNCE_ROUTE_SHORT_DELAY_MS
+                                    : BGP_ANNOUNCE_ROUTE_DELAY_MS,
+                            &paf->t_announce_route);
 }
 
 /*
@@ -5263,8 +5263,8 @@ static void bgp_soft_reconfig_table_task(struct event *thread)
         */
        if (dest || table->soft_reconfig_init) {
                table->soft_reconfig_init = false;
-               thread_add_event(bm->master, bgp_soft_reconfig_table_task,
-                                table, 0, &table->soft_reconfig_thread);
+               event_add_event(bm->master, bgp_soft_reconfig_table_task, table,
+                               0, &table->soft_reconfig_thread);
                return;
        }
        /* we're done, clean up the background iteration context info and
@@ -5365,9 +5365,9 @@ bool bgp_soft_reconfig_in(struct peer *peer, afi_t afi, safi_t safi)
                bgp_soft_reconfig_table_flag(table, true);
 
                if (!table->soft_reconfig_thread)
-                       thread_add_event(bm->master,
-                                        bgp_soft_reconfig_table_task, table, 0,
-                                        &table->soft_reconfig_thread);
+                       event_add_event(bm->master,
+                                       bgp_soft_reconfig_table_task, table, 0,
+                                       &table->soft_reconfig_thread);
                /* Cancel bgp_announce_route_timer_expired threads.
                 * bgp_announce_route_timer_expired threads have been scheduled
                 * to announce routes as soon as the soft_reconfigure process
index db4d1707315336758cef304a670eb9783064278d..4fcee75ae09cfa7b195870cfae16533c158b20a8 100644 (file)
@@ -4361,9 +4361,8 @@ static void bgp_route_map_mark_update(const char *rmap_name)
 
        /* rmap_update_timer of 0 means don't do route updates */
        if (bm->rmap_update_timer) {
-               thread_add_timer(bm->master, bgp_route_map_update_timer,
-                                NULL, bm->rmap_update_timer,
-                                &bm->t_rmap_update);
+               event_add_timer(bm->master, bgp_route_map_update_timer, NULL,
+                               bm->rmap_update_timer, &bm->t_rmap_update);
 
                /* Signal the groups that a route-map update event has
                 * started */
index efaa3c3636ea9f64131e1975425ac612ad3f3c75..0d46fccf3bb3910de2c2c6d268c901d2590d4362 100644 (file)
@@ -409,8 +409,8 @@ static void bgpd_sync_callback(struct event *thread)
        struct prefix prefix;
        struct pfx_record rec;
 
-       thread_add_read(bm->master, bgpd_sync_callback, NULL,
-                       rpki_sync_socket_bgpd, NULL);
+       event_add_read(bm->master, bgpd_sync_callback, NULL,
+                      rpki_sync_socket_bgpd, NULL);
 
        if (atomic_load_explicit(&rtr_update_overflow, memory_order_seq_cst)) {
                while (read(rpki_sync_socket_bgpd, &rec,
@@ -448,8 +448,8 @@ static void bgpd_sync_callback(struct event *thread)
                        rrp->prefix = prefix;
                        rrp->afi = afi;
                        rrp->safi = safi;
-                       thread_add_event(bm->master, rpki_revalidate_prefix,
-                                        rrp, 0, &bgp->t_revalidate[afi][safi]);
+                       event_add_event(bm->master, rpki_revalidate_prefix, rrp,
+                                       0, &bgp->t_revalidate[afi][safi]);
                }
        }
 }
@@ -529,7 +529,7 @@ static void revalidate_all_routes(void)
                                rvp->afi = afi;
                                rvp->safi = safi;
 
-                               thread_add_event(
+                               event_add_event(
                                        bm->master, bgp_rpki_revalidate_peer,
                                        rvp, 0,
                                        &peer->t_revalidate_all[afi][safi]);
@@ -580,8 +580,8 @@ static void rpki_init_sync_socket(void)
        }
 
 
-       thread_add_read(bm->master, bgpd_sync_callback, NULL,
-                       rpki_sync_socket_bgpd, NULL);
+       event_add_read(bm->master, bgpd_sync_callback, NULL,
+                      rpki_sync_socket_bgpd, NULL);
 
        return;
 
@@ -635,9 +635,9 @@ static void sync_expired(struct event *thread)
 {
        if (!rtr_mgr_conf_in_sync(rtr_config)) {
                RPKI_DEBUG("rtr_mgr is not synced, retrying.");
-               thread_add_timer(bm->master, sync_expired, NULL,
-                                BGP_RPKI_CACHE_SERVER_SYNC_RETRY_TIMEOUT,
-                                &t_rpki_sync);
+               event_add_timer(bm->master, sync_expired, NULL,
+                               BGP_RPKI_CACHE_SERVER_SYNC_RETRY_TIMEOUT,
+                               &t_rpki_sync);
                return;
        }
 
@@ -680,7 +680,7 @@ static int start(void)
                return ERROR;
        }
 
-       thread_add_timer(bm->master, sync_expired, NULL, 0, &t_rpki_sync);
+       event_add_timer(bm->master, sync_expired, NULL, 0, &t_rpki_sync);
 
        XFREE(MTYPE_BGP_RPKI_CACHE_GROUP, groups);
 
index e01df10d3e59327f11d2b8f0b41196bd088e934b..b661303cef09d09250bc8776bd69bfeaff0bf616 100644 (file)
@@ -1449,8 +1449,8 @@ bool update_subgroup_trigger_merge_check(struct update_subgroup *subgrp,
                return false;
 
        subgrp->t_merge_check = NULL;
-       thread_add_timer_msec(bm->master, update_subgroup_merge_check_thread_cb,
-                             subgrp, 0, &subgrp->t_merge_check);
+       event_add_timer_msec(bm->master, update_subgroup_merge_check_thread_cb,
+                            subgrp, 0, &subgrp->t_merge_check);
 
        SUBGRP_INCR_STAT(subgrp, merge_checks_triggered);
 
@@ -2215,7 +2215,7 @@ void subgroup_trigger_write(struct update_subgroup *subgrp)
         */
        SUBGRP_FOREACH_PEER (subgrp, paf)
                if (peer_established(paf->peer))
-                       thread_add_timer_msec(
+                       event_add_timer_msec(
                                bm->master, bgp_generate_updgrp_packets,
                                paf->peer, 0,
                                &paf->peer->t_generate_updgrp_packets);
index f6321a368f27b5c24d961b567d856d2fe75ee396..b45e9cf828f6d22b89c15102ca8fc1f4fd316f5e 100644 (file)
@@ -1021,9 +1021,9 @@ void subgroup_announce_all(struct update_subgroup *subgrp)
         * We should wait for the coalesce timer. Arm the timer if not done.
         */
        if (!subgrp->t_coalesce) {
-               thread_add_timer_msec(bm->master, subgroup_coalesce_timer,
-                                     subgrp, subgrp->v_coalesce,
-                                     &subgrp->t_coalesce);
+               event_add_timer_msec(bm->master, subgroup_coalesce_timer,
+                                    subgrp, subgrp->v_coalesce,
+                                    &subgrp->t_coalesce);
        }
 }
 
index 42334884962c17f65d19c7220d49716cfc785a55..95f2b82e934f67257a2f0fca5d07e3f10340cfd6 100644 (file)
@@ -18784,8 +18784,8 @@ static void bgp_config_start(void)
 {
 #define BGP_PRE_CONFIG_MAX_WAIT_SECONDS 600
        THREAD_OFF(t_bgp_cfg);
-       thread_add_timer(bm->master, bgp_config_finish, NULL,
-                        BGP_PRE_CONFIG_MAX_WAIT_SECONDS, &t_bgp_cfg);
+       event_add_timer(bm->master, bgp_config_finish, NULL,
+                       BGP_PRE_CONFIG_MAX_WAIT_SECONDS, &t_bgp_cfg);
 }
 
 /* When we receive a hook the configuration is read,
@@ -18812,8 +18812,8 @@ static void bgp_config_end(void)
        /* Start a new timer to make sure we don't send EoR
         * before route-maps are processed.
         */
-       thread_add_timer(bm->master, bgp_config_finish, NULL,
-                        bgp_post_config_delay, &t_bgp_cfg);
+       event_add_timer(bm->master, bgp_config_finish, NULL,
+                       bgp_post_config_delay, &t_bgp_cfg);
 }
 
 static int config_write_interface_one(struct vty *vty, struct vrf *vrf)
index 11761ff58e40c8fc2a4f8cba042805fc322d8dfe..ea98d616871fa55f4ba2566db0e570ed35e1c30c 100644 (file)
@@ -1082,8 +1082,8 @@ static void bgp_zebra_tm_connect(struct event *t)
                        }
                }
        }
-       thread_add_timer(bm->master, bgp_zebra_tm_connect, zclient, delay,
-                        &bgp_tm_thread_connect);
+       event_add_timer(bm->master, bgp_zebra_tm_connect, zclient, delay,
+                       &bgp_tm_thread_connect);
 }
 
 bool bgp_zebra_tm_chunk_obtained(void)
@@ -1113,8 +1113,8 @@ void bgp_zebra_init_tm_connect(struct bgp *bgp)
        bgp_tm_min = bgp_tm_max = 0;
        bgp_tm_chunk_size = BGP_FLOWSPEC_TABLE_CHUNK;
        bgp_tm_bgp = bgp;
-       thread_add_timer(bm->master, bgp_zebra_tm_connect, zclient, delay,
-                        &bgp_tm_thread_connect);
+       event_add_timer(bm->master, bgp_zebra_tm_connect, zclient, delay,
+                       &bgp_tm_thread_connect);
 }
 
 int bgp_zebra_get_table_range(uint32_t chunk_size,
index 6a71d9dfe2c359c7b8e04d30c9bf1b7589eed986..eb91eaf084d7428da10a79bbb18aa0202d0e8066 100644 (file)
@@ -3355,8 +3355,8 @@ static struct bgp *bgp_create(as_t *as, const char *name,
        if (name)
                bgp->name = XSTRDUP(MTYPE_BGP, name);
 
-       thread_add_timer(bm->master, bgp_startup_timer_expire, bgp,
-                        bgp->restart_time, &bgp->t_startup);
+       event_add_timer(bm->master, bgp_startup_timer_expire, bgp,
+                       bgp->restart_time, &bgp->t_startup);
 
        /* printable name we can use in debug messages */
        if (inst_type == BGP_INSTANCE_TYPE_DEFAULT) {
index 92b580ee1276927eea36df81b9630c1996a18c10..5c02cd8af1c93cc915ab49a6b740b740aa93fe0b 100644 (file)
@@ -2789,8 +2789,8 @@ rfapiBiStartWithdrawTimer(struct rfapi_import_table *import_table,
        if (lifetime > UINT32_MAX / 1001) {
                /* sub-optimal case, but will probably never happen */
                bpi->extra->vnc.import.timer = NULL;
-               thread_add_timer(bm->master, timer_service_func, wcb, lifetime,
-                                &bpi->extra->vnc.import.timer);
+               event_add_timer(bm->master, timer_service_func, wcb, lifetime,
+                               &bpi->extra->vnc.import.timer);
        } else {
                static uint32_t jitter;
                uint32_t lifetime_msec;
@@ -2805,9 +2805,9 @@ rfapiBiStartWithdrawTimer(struct rfapi_import_table *import_table,
                lifetime_msec = (lifetime * 1000) + jitter;
 
                bpi->extra->vnc.import.timer = NULL;
-               thread_add_timer_msec(bm->master, timer_service_func, wcb,
-                                     lifetime_msec,
-                                     &bpi->extra->vnc.import.timer);
+               event_add_timer_msec(bm->master, timer_service_func, wcb,
+                                    lifetime_msec,
+                                    &bpi->extra->vnc.import.timer);
        }
 
        /* re-sort route list (BGP_PATH_REMOVED routes are last) */
index c69161841c8d3c0983d98605c00252cba0f7029f..2bcfa5779c506de2a1367716908e20fc23116efe 100644 (file)
@@ -764,8 +764,8 @@ static void rfapiMonitorTimerRestart(struct rfapi_monitor_vpn *m)
                        m->rfd->response_lifetime);
        }
 
-       thread_add_timer(bm->master, rfapiMonitorTimerExpire, m,
-                        m->rfd->response_lifetime, &m->timer);
+       event_add_timer(bm->master, rfapiMonitorTimerExpire, m,
+                       m->rfd->response_lifetime, &m->timer);
 }
 
 /*
@@ -1072,8 +1072,8 @@ static void rfapiMonitorEthTimerRestart(struct rfapi_monitor_eth *m)
                        m->rfd->response_lifetime);
        }
 
-       thread_add_timer(bm->master, rfapiMonitorEthTimerExpire, m,
-                        m->rfd->response_lifetime, &m->timer);
+       event_add_timer(bm->master, rfapiMonitorEthTimerExpire, m,
+                       m->rfd->response_lifetime, &m->timer);
 }
 
 static int mon_eth_cmp(const void *a, const void *b)
index 7000fbf90c4cd3d8384fad46e637126609286429..3febea96bb209ed2b6d179f2b4cdaaccb38e3bf0 100644 (file)
@@ -345,8 +345,8 @@ static void rfapiRibStartTimer(struct rfapi_descriptor *rfd,
        vnc_zlog_debug_verbose("%s: rfd %p pfx %pRN life %u", __func__, rfd, rn,
                               ri->lifetime);
 
-       thread_add_timer(bm->master, rfapiRibExpireTimer, tcb, ri->lifetime,
-                        &ri->timer);
+       event_add_timer(bm->master, rfapiRibExpireTimer, tcb, ri->lifetime,
+                       &ri->timer);
 }
 
 extern void rfapi_rib_key_init(struct prefix *prefix, /* may be NULL */
index ef943fa4072240c95fd59fe0e5cbd222dac25f0b..e15c61e6da110389c9dff2b1048781a338b6c3ea 100644 (file)
@@ -1765,8 +1765,8 @@ void vnc_direct_bgp_rh_del_route(struct bgp *bgp, afi_t afi,
 
        if (!eti->timer && eti->lifetime <= INT32_MAX) {
                eti->timer = NULL;
-               thread_add_timer(bm->master, vncExportWithdrawTimer, eti,
-                                eti->lifetime, &eti->timer);
+               event_add_timer(bm->master, vncExportWithdrawTimer, eti,
+                               eti->lifetime, &eti->timer);
                vnc_zlog_debug_verbose(
                        "%s: set expiration timer for %u seconds", __func__,
                        eti->lifetime);
index 0773f47b09f2305a3c2113c10b083bc8bd19cf8a..25decffb07fc21fe257c54bdee82f82081c99de2 100644 (file)
@@ -95,7 +95,7 @@ irrelevant for the time being) for the specific type. For example, to add a
 
 ::
 
-   thread_add_read(struct thread_master *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref);
+   event_add_read(struct thread_master *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref);
 
 The ``struct event`` is then created and added to the appropriate internal
 datastructure within the ``threadmaster``. Note that the ``READ`` and
@@ -137,14 +137,14 @@ Mapping the general names used in the figure to specific FRR functions:
 - ``fetch`` is ``thread_fetch()``
 - ``exec()`` is ``thread_call``
 - ``cancel()`` is ``thread_cancel()``
-- ``schedule()`` is any of the various task-specific ``thread_add_*`` functions
+- ``schedule()`` is any of the various task-specific ``event_add_*`` functions
 
 Adding tasks is done with various task-specific function-like macros. These
 macros wrap underlying functions in :file:`thread.c` to provide additional
 information added at compile time, such as the line number the task was
 scheduled from, that can be accessed at runtime for debugging, logging and
 informational purposes. Each task type has its own specific scheduling function
-that follow the naming convention ``thread_add_<type>``; see :file:`event.h`
+that follow the naming convention ``event_add_<type>``; see :file:`event.h`
 for details.
 
 There are some gotchas to keep in mind:
index a4d59db6b7cf0b1dc4a7d7a8f7fef374c85d8ca1..f39530877a9eb840ae18a18e23c982a5800a71da 100644 (file)
@@ -114,8 +114,8 @@ void eigrp_distribute_update(struct distribute_ctx *ctx,
                thread_cancel(&(e->t_distribute));
 
                /* schedule Graceful restart for whole process in 10sec */
-               thread_add_timer(master, eigrp_distribute_timer_process, e,
-                                (10), &e->t_distribute);
+               event_add_timer(master, eigrp_distribute_timer_process, e, (10),
+                               &e->t_distribute);
 
                return;
        }
@@ -188,8 +188,8 @@ void eigrp_distribute_update(struct distribute_ctx *ctx,
        /* Cancel GR scheduled */
        thread_cancel(&(ei->t_distribute));
        /* schedule Graceful restart for interface in 10sec */
-       thread_add_timer(master, eigrp_distribute_timer_interface, ei, 10,
-                        &ei->t_distribute);
+       event_add_timer(master, eigrp_distribute_timer_interface, ei, 10,
+                       &ei->t_distribute);
 }
 
 /*
index c6d3b879d9d5cd3a068a73306a6e95969f74d3f2..02807dd31db63b098db143d806343c563fbe0d62 100644 (file)
@@ -80,8 +80,8 @@ void eigrp_hello_timer(struct event *thread)
        eigrp_hello_send(ei, EIGRP_HELLO_NORMAL, NULL);
 
        /* Hello timer set. */
-       thread_add_timer(master, eigrp_hello_timer, ei, ei->params.v_hello,
-                        &ei->t_hello);
+       event_add_timer(master, eigrp_hello_timer, ei, ei->params.v_hello,
+                       &ei->t_hello);
 }
 
 /**
@@ -726,8 +726,8 @@ void eigrp_hello_send_ack(struct eigrp_neighbor *nbr)
                        listnode_add(nbr->ei->eigrp->oi_write_q, nbr->ei);
                        nbr->ei->on_write_q = 1;
                }
-               thread_add_write(master, eigrp_write, nbr->ei->eigrp,
-                                nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write);
+               event_add_write(master, eigrp_write, nbr->ei->eigrp,
+                               nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write);
        }
 }
 
@@ -774,9 +774,9 @@ void eigrp_hello_send(struct eigrp_interface *ei, uint8_t flags,
                                thread_execute(master, eigrp_write, ei->eigrp,
                                               ei->eigrp->fd);
                        } else {
-                               thread_add_write(master, eigrp_write, ei->eigrp,
-                                                ei->eigrp->fd,
-                                                &ei->eigrp->t_write);
+                               event_add_write(master, eigrp_write, ei->eigrp,
+                                               ei->eigrp->fd,
+                                               &ei->eigrp->t_write);
                        }
                }
        }
index eeb2bd4d09c0b24377a36a71806170b93f77dd51..cd268fa9b995638b3fa1c4581ea32bc0e25a43b1 100644 (file)
@@ -251,7 +251,7 @@ int eigrp_if_up(struct eigrp_interface *ei)
        /* Set multicast memberships appropriately for new state. */
        eigrp_if_set_multicast(ei);
 
-       thread_add_event(master, eigrp_hello_timer, ei, (1), &ei->t_hello);
+       event_add_event(master, eigrp_hello_timer, ei, (1), &ei->t_hello);
 
        /*Prepare metrics*/
        metric.bandwidth = eigrp_bandwidth_to_scaled(ei->params.bandwidth);
index b7cd22fee1df8b5033b6c6f3f03f668c72139520..75f1d7e133b4177d892dd0a8ae577c8a58120b1e 100644 (file)
@@ -27,6 +27,6 @@
 
 /* FSM macros*/
 #define EIGRP_FSM_EVENT_SCHEDULE(I, E)                                         \
-       thread_add_event(master, eigrp_fsm_event, (I), (E))
+       event_add_event(master, eigrp_fsm_event, (I), (E))
 
 #endif /* _ZEBRA_EIGRP_MACROS_H_ */
index 582428ed1fc873964bac0e997229285a07ea9ce6..e40c4a50bd033fd1a9e3143df5f15d6a501a0457 100644 (file)
@@ -261,15 +261,15 @@ void eigrp_nbr_state_update(struct eigrp_neighbor *nbr)
        case EIGRP_NEIGHBOR_PENDING: {
                /*Reset Hold Down Timer for neighbor*/
                THREAD_OFF(nbr->t_holddown);
-               thread_add_timer(master, holddown_timer_expired, nbr,
-                                nbr->v_holddown, &nbr->t_holddown);
+               event_add_timer(master, holddown_timer_expired, nbr,
+                               nbr->v_holddown, &nbr->t_holddown);
                break;
        }
        case EIGRP_NEIGHBOR_UP: {
                /*Reset Hold Down Timer for neighbor*/
                THREAD_OFF(nbr->t_holddown);
-               thread_add_timer(master, holddown_timer_expired, nbr,
-                                nbr->v_holddown, &nbr->t_holddown);
+               event_add_timer(master, holddown_timer_expired, nbr,
+                               nbr->v_holddown, &nbr->t_holddown);
                break;
        }
        }
index 24603fa743a75f9128ef40bb569b4e4687f6ad3c..51b68fb34b056f5b7274f837380069a8ce10ae74 100644 (file)
@@ -453,8 +453,8 @@ out:
 
        /* If packets still remain in queue, call write thread. */
        if (!list_isempty(eigrp->oi_write_q)) {
-               thread_add_write(master, eigrp_write, eigrp, eigrp->fd,
-                                &eigrp->t_write);
+               event_add_write(master, eigrp_write, eigrp, eigrp->fd,
+                               &eigrp->t_write);
        }
 }
 
@@ -477,7 +477,7 @@ void eigrp_read(struct event *thread)
        eigrp = THREAD_ARG(thread);
 
        /* prepare for next packet. */
-       thread_add_read(master, eigrp_read, eigrp, eigrp->fd, &eigrp->t_read);
+       event_add_read(master, eigrp_read, eigrp, eigrp->fd, &eigrp->t_read);
 
        stream_reset(eigrp->ibuf);
        if (!(ibuf = eigrp_recv_packet(eigrp, eigrp->fd, &ifp, eigrp->ibuf))) {
@@ -828,9 +828,9 @@ void eigrp_send_packet_reliably(struct eigrp_neighbor *nbr)
                eigrp_fifo_push(nbr->ei->obuf, duplicate);
 
                /*Start retransmission timer*/
-               thread_add_timer(master, eigrp_unack_packet_retrans, nbr,
-                                EIGRP_PACKET_RETRANS_TIME,
-                                &ep->t_retrans_timer);
+               event_add_timer(master, eigrp_unack_packet_retrans, nbr,
+                               EIGRP_PACKET_RETRANS_TIME,
+                               &ep->t_retrans_timer);
 
                /*Increment sequence number counter*/
                nbr->ei->eigrp->sequence_number++;
@@ -840,8 +840,8 @@ void eigrp_send_packet_reliably(struct eigrp_neighbor *nbr)
                        listnode_add(nbr->ei->eigrp->oi_write_q, nbr->ei);
                        nbr->ei->on_write_q = 1;
                }
-               thread_add_write(master, eigrp_write, nbr->ei->eigrp,
-                                nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write);
+               event_add_write(master, eigrp_write, nbr->ei->eigrp,
+                               nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write);
        }
 }
 
@@ -992,17 +992,17 @@ void eigrp_unack_packet_retrans(struct event *thread)
                }
 
                /*Start retransmission timer*/
-               thread_add_timer(master, eigrp_unack_packet_retrans, nbr,
-                                EIGRP_PACKET_RETRANS_TIME,
-                                &ep->t_retrans_timer);
+               event_add_timer(master, eigrp_unack_packet_retrans, nbr,
+                               EIGRP_PACKET_RETRANS_TIME,
+                               &ep->t_retrans_timer);
 
                /* Hook thread to write packet. */
                if (nbr->ei->on_write_q == 0) {
                        listnode_add(nbr->ei->eigrp->oi_write_q, nbr->ei);
                        nbr->ei->on_write_q = 1;
                }
-               thread_add_write(master, eigrp_write, nbr->ei->eigrp,
-                                nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write);
+               event_add_write(master, eigrp_write, nbr->ei->eigrp,
+                               nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write);
        }
 }
 
@@ -1027,17 +1027,17 @@ void eigrp_unack_multicast_packet_retrans(struct event *thread)
                }
 
                /*Start retransmission timer*/
-               thread_add_timer(master, eigrp_unack_multicast_packet_retrans,
-                                nbr, EIGRP_PACKET_RETRANS_TIME,
-                                &ep->t_retrans_timer);
+               event_add_timer(master, eigrp_unack_multicast_packet_retrans,
+                               nbr, EIGRP_PACKET_RETRANS_TIME,
+                               &ep->t_retrans_timer);
 
                /* Hook thread to write packet. */
                if (nbr->ei->on_write_q == 0) {
                        listnode_add(nbr->ei->eigrp->oi_write_q, nbr->ei);
                        nbr->ei->on_write_q = 1;
                }
-               thread_add_write(master, eigrp_write, nbr->ei->eigrp,
-                                nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write);
+               event_add_write(master, eigrp_write, nbr->ei->eigrp,
+                               nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write);
        }
 }
 
index ccc0c9a4b244afc4f9fff52c5ed5cba1a26c4588..5fa469531730d6bc984cfdb85ae387a114d97c8b 100644 (file)
@@ -906,8 +906,8 @@ void eigrp_update_send_GR_thread(struct event *thread)
        /* if there is packet waiting in queue,
         * schedule this thread again with small delay */
        if (nbr->retrans_queue->count > 0) {
-               thread_add_timer_msec(master, eigrp_update_send_GR_thread, nbr,
-                                     10, &nbr->t_nbr_send_gr);
+               event_add_timer_msec(master, eigrp_update_send_GR_thread, nbr,
+                                    10, &nbr->t_nbr_send_gr);
                return;
        }
 
index 9db0531b59a71161d4cec3b5c8bd8c28d1e798a3..f94bcea7365ef1c26c4efcec45f1a8f1268fa911 100644 (file)
@@ -157,7 +157,7 @@ static struct eigrp *eigrp_new(uint16_t as, vrf_id_t vrf_id)
 
        eigrp->ibuf = stream_new(EIGRP_PACKET_MAX_LEN + 1);
 
-       thread_add_read(master, eigrp_read, eigrp, eigrp->fd, &eigrp->t_read);
+       event_add_read(master, eigrp_read, eigrp, eigrp->fd, &eigrp->t_read);
        eigrp->oi_write_q = list_new();
 
        eigrp->topology_table = route_table_init();
index 40cc158812050da9009c5f598e766286246d1c26..52fd8df00668cc16a5f60074e5e80b96ae8e9d87 100644 (file)
@@ -267,8 +267,8 @@ void fabricd_initial_sync_hello(struct isis_circuit *circuit)
        if (f->initial_sync_timeout)
                return;
 
-       thread_add_timer(master, fabricd_initial_sync_timeout, f,
-                        timeout, &f->initial_sync_timeout);
+       event_add_timer(master, fabricd_initial_sync_timeout, f, timeout,
+                       &f->initial_sync_timeout);
        f->initial_sync_start = monotime(NULL);
 
        if (IS_DEBUG_ADJ_PACKETS)
@@ -408,10 +408,9 @@ static void fabricd_tier_calculation_cb(struct event *thread)
        zlog_info("OpenFabric: Got tier %hhu from algorithm. Arming timer.",
                  tier);
        f->tier_pending = tier;
-       thread_add_timer(master, fabricd_tier_set_timer, f,
-                        f->area->lsp_gen_interval[ISIS_LEVEL2 - 1],
-                        &f->tier_set_timer);
-
+       event_add_timer(master, fabricd_tier_set_timer, f,
+                       f->area->lsp_gen_interval[ISIS_LEVEL2 - 1],
+                       &f->tier_set_timer);
 }
 
 static void fabricd_bump_tier_calculation_timer(struct fabricd *f)
@@ -427,9 +426,9 @@ static void fabricd_bump_tier_calculation_timer(struct fabricd *f)
         * the calculation */
        THREAD_OFF(f->tier_calculation_timer);
 
-       thread_add_timer(master, fabricd_tier_calculation_cb, f,
-                        2 * f->area->lsp_gen_interval[ISIS_LEVEL2 - 1],
-                        &f->tier_calculation_timer);
+       event_add_timer(master, fabricd_tier_calculation_cb, f,
+                       2 * f->area->lsp_gen_interval[ISIS_LEVEL2 - 1],
+                       &f->tier_calculation_timer);
 }
 
 static void fabricd_set_tier(struct fabricd *f, uint8_t tier)
@@ -711,9 +710,9 @@ void fabricd_trigger_csnp(struct isis_area *area, bool circuit_scoped)
                        continue;
 
                THREAD_OFF(circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
-               thread_add_timer_msec(master, send_l2_csnp, circuit,
-                                     isis_jitter(f->csnp_delay, CSNP_JITTER),
-                                     &circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
+               event_add_timer_msec(master, send_l2_csnp, circuit,
+                                    isis_jitter(f->csnp_delay, CSNP_JITTER),
+                                    &circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
        }
 }
 
index 3eb4e0e8f81b97759483df1ff1080a050b547362..4443f346db50a06bc3f83ed95d4b62ea1a712832 100644 (file)
@@ -396,13 +396,13 @@ void isis_adj_state_change(struct isis_adjacency **padj,
                                adj->flaps++;
 
                                if (level == IS_LEVEL_1) {
-                                       thread_add_timer(master, send_l1_csnp,
-                                                        circuit, 0,
-                                                        &circuit->t_send_csnp[0]);
+                                       event_add_timer(
+                                               master, send_l1_csnp, circuit,
+                                               0, &circuit->t_send_csnp[0]);
                                } else {
-                                       thread_add_timer(master, send_l2_csnp,
-                                                        circuit, 0,
-                                                        &circuit->t_send_csnp[1]);
+                                       event_add_timer(
+                                               master, send_l2_csnp, circuit,
+                                               0, &circuit->t_send_csnp[1]);
                                }
                        } else if (old_state == ISIS_ADJ_UP) {
                                circuit->upadjcount[level - 1]--;
index 8593aee8be567da1e7bc161efb810fe6226b8603..f5c58dddbfba4a69d654024022fd33382057361b 100644 (file)
@@ -627,12 +627,12 @@ void isis_circuit_stream(struct isis_circuit *circuit, struct stream **stream)
 void isis_circuit_prepare(struct isis_circuit *circuit)
 {
 #if ISIS_METHOD != ISIS_METHOD_DLPI
-       thread_add_read(master, isis_receive, circuit, circuit->fd,
-                       &circuit->t_read);
+       event_add_read(master, isis_receive, circuit, circuit->fd,
+                      &circuit->t_read);
 #else
-       thread_add_timer_msec(master, isis_receive, circuit,
-                             listcount(circuit->area->circuit_list) * 100,
-                             &circuit->t_read);
+       event_add_timer_msec(master, isis_receive, circuit,
+                            listcount(circuit->area->circuit_list) * 100,
+                            &circuit->t_read);
 #endif
 }
 
@@ -722,10 +722,10 @@ int isis_circuit_up(struct isis_circuit *circuit)
                        send_hello_sched(circuit, level, TRIGGERED_IIH_DELAY);
                        circuit->u.bc.lan_neighs[level - 1] = list_new();
 
-                       thread_add_timer(master, isis_run_dr,
-                                        &circuit->level_arg[level - 1],
-                                        2 * circuit->hello_interval[level - 1],
-                                        &circuit->u.bc.t_run_dr[level - 1]);
+                       event_add_timer(master, isis_run_dr,
+                                       &circuit->level_arg[level - 1],
+                                       2 * circuit->hello_interval[level - 1],
+                                       &circuit->u.bc.t_run_dr[level - 1]);
                }
 
                /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
@@ -740,13 +740,13 @@ int isis_circuit_up(struct isis_circuit *circuit)
 
        /* initializing PSNP timers */
        if (circuit->is_type & IS_LEVEL_1)
-               thread_add_timer(
+               event_add_timer(
                        master, send_l1_psnp, circuit,
                        isis_jitter(circuit->psnp_interval[0], PSNP_JITTER),
                        &circuit->t_send_psnp[0]);
 
        if (circuit->is_type & IS_LEVEL_2)
-               thread_add_timer(
+               event_add_timer(
                        master, send_l2_psnp, circuit,
                        isis_jitter(circuit->psnp_interval[1], PSNP_JITTER),
                        &circuit->t_send_psnp[1]);
index 8949318cc4bbc059bfcbd4524f3418a0e30d7f17..9a10a61b2908bf1b297453b9562ea14d96e9d560 100644 (file)
@@ -223,29 +223,27 @@ int isis_dr_resign(struct isis_circuit *circuit, int level)
        if (level == 1) {
                memset(circuit->u.bc.l1_desig_is, 0, ISIS_SYS_ID_LEN + 1);
 
-               thread_add_timer(master, send_l1_psnp, circuit,
-                                isis_jitter(circuit->psnp_interval[level - 1],
-                                            PSNP_JITTER),
-                                &circuit->t_send_psnp[0]);
+               event_add_timer(master, send_l1_psnp, circuit,
+                               isis_jitter(circuit->psnp_interval[level - 1],
+                                           PSNP_JITTER),
+                               &circuit->t_send_psnp[0]);
        } else {
                memset(circuit->u.bc.l2_desig_is, 0, ISIS_SYS_ID_LEN + 1);
 
-               thread_add_timer(master, send_l2_psnp, circuit,
-                                isis_jitter(circuit->psnp_interval[level - 1],
-                                            PSNP_JITTER),
-                                &circuit->t_send_psnp[1]);
+               event_add_timer(master, send_l2_psnp, circuit,
+                               isis_jitter(circuit->psnp_interval[level - 1],
+                                           PSNP_JITTER),
+                               &circuit->t_send_psnp[1]);
        }
 
        THREAD_OFF(circuit->t_send_csnp[level - 1]);
 
-       thread_add_timer(master, isis_run_dr,
-                        &circuit->level_arg[level - 1],
-                        2 * circuit->hello_interval[level - 1],
-                        &circuit->u.bc.t_run_dr[level - 1]);
+       event_add_timer(master, isis_run_dr, &circuit->level_arg[level - 1],
+                       2 * circuit->hello_interval[level - 1],
+                       &circuit->u.bc.t_run_dr[level - 1]);
 
 
-       thread_add_event(master, isis_event_dis_status_change, circuit, 0,
-                        NULL);
+       event_add_event(master, isis_event_dis_status_change, circuit, 0, NULL);
 
        return ISIS_OK;
 }
@@ -276,10 +274,10 @@ int isis_dr_commence(struct isis_circuit *circuit, int level)
                assert(circuit->circuit_id); /* must be non-zero */
                lsp_generate_pseudo(circuit, 1);
 
-               thread_add_timer(master, send_l1_csnp, circuit,
-                                isis_jitter(circuit->csnp_interval[level - 1],
-                                            CSNP_JITTER),
-                                &circuit->t_send_csnp[0]);
+               event_add_timer(master, send_l1_csnp, circuit,
+                               isis_jitter(circuit->csnp_interval[level - 1],
+                                           CSNP_JITTER),
+                               &circuit->t_send_csnp[0]);
 
        } else {
                memcpy(old_dr, circuit->u.bc.l2_desig_is, ISIS_SYS_ID_LEN + 1);
@@ -296,18 +294,16 @@ int isis_dr_commence(struct isis_circuit *circuit, int level)
                assert(circuit->circuit_id); /* must be non-zero */
                lsp_generate_pseudo(circuit, 2);
 
-               thread_add_timer(master, send_l2_csnp, circuit,
-                                isis_jitter(circuit->csnp_interval[level - 1],
-                                            CSNP_JITTER),
-                                &circuit->t_send_csnp[1]);
+               event_add_timer(master, send_l2_csnp, circuit,
+                               isis_jitter(circuit->csnp_interval[level - 1],
+                                           CSNP_JITTER),
+                               &circuit->t_send_csnp[1]);
        }
 
-       thread_add_timer(master, isis_run_dr,
-                        &circuit->level_arg[level - 1],
-                        2 * circuit->hello_interval[level - 1],
-                        &circuit->u.bc.t_run_dr[level - 1]);
-       thread_add_event(master, isis_event_dis_status_change, circuit, 0,
-                        NULL);
+       event_add_timer(master, isis_run_dr, &circuit->level_arg[level - 1],
+                       2 * circuit->hello_interval[level - 1],
+                       &circuit->u.bc.t_run_dr[level - 1]);
+       event_add_event(master, isis_event_dis_status_change, circuit, 0, NULL);
 
        return ISIS_OK;
 }
index 78197561bde4611547a20262774ddc5e1a1c47f3..e171419310f29053131b2575720dbbf054205d77 100644 (file)
@@ -35,8 +35,8 @@ void dyn_cache_init(struct isis *isis)
 {
        isis->dyn_cache = list_new();
        if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
-               thread_add_timer(master, dyn_cache_cleanup, isis, 120,
-                                &isis->t_dync_clean);
+               event_add_timer(master, dyn_cache_cleanup, isis, 120,
+                               &isis->t_dync_clean);
 }
 
 void dyn_cache_finish(struct isis *isis)
@@ -72,7 +72,7 @@ static void dyn_cache_cleanup(struct event *thread)
                XFREE(MTYPE_ISIS_DYNHN, dyn);
        }
 
-       thread_add_timer(master, dyn_cache_cleanup, isis, 120,
+       event_add_timer(master, dyn_cache_cleanup, isis, 120,
                        &isis->t_dync_clean);
 }
 
index 9baf58650d55b2b1a4ff7d69c0f46ef76c8356fa..4610bb2c93becb93d06f9d584381b9e5761e3b83 100644 (file)
@@ -63,23 +63,23 @@ static void circuit_commence_level(struct isis_circuit *circuit, int level)
 
        if (!circuit->is_passive) {
                if (level == 1) {
-                       thread_add_timer(master, send_l1_psnp, circuit,
-                                        isis_jitter(circuit->psnp_interval[0],
-                                                    PSNP_JITTER),
-                                        &circuit->t_send_psnp[0]);
+                       event_add_timer(master, send_l1_psnp, circuit,
+                                       isis_jitter(circuit->psnp_interval[0],
+                                                   PSNP_JITTER),
+                                       &circuit->t_send_psnp[0]);
                } else {
-                       thread_add_timer(master, send_l2_psnp, circuit,
-                                        isis_jitter(circuit->psnp_interval[1],
-                                                    PSNP_JITTER),
-                                        &circuit->t_send_psnp[1]);
+                       event_add_timer(master, send_l2_psnp, circuit,
+                                       isis_jitter(circuit->psnp_interval[1],
+                                                   PSNP_JITTER),
+                                       &circuit->t_send_psnp[1]);
                }
        }
 
        if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
-               thread_add_timer(master, isis_run_dr,
-                                &circuit->level_arg[level - 1],
-                                2 * circuit->hello_interval[level - 1],
-                                &circuit->u.bc.t_run_dr[level - 1]);
+               event_add_timer(master, isis_run_dr,
+                               &circuit->level_arg[level - 1],
+                               2 * circuit->hello_interval[level - 1],
+                               &circuit->u.bc.t_run_dr[level - 1]);
 
                send_hello_sched(circuit, level, TRIGGERED_IIH_DELAY);
                circuit->u.bc.lan_neighs[level - 1] = list_new();
index 7ba04a1c178a9c9905211f8d11eccaf1709cee91..65ca7ac3cc35f0517686cf042f844309909725f5 100644 (file)
@@ -373,9 +373,8 @@ void isis_ldp_sync_holddown_timer_add(struct isis_circuit *circuit)
        ils_debug("%s: start holddown timer for %s time %d", __func__,
                  circuit->interface->name, ldp_sync_info->holddown);
 
-       thread_add_timer(master, isis_ldp_sync_holddown_timer,
-                        circuit, ldp_sync_info->holddown,
-                        &ldp_sync_info->t_holddown);
+       event_add_timer(master, isis_ldp_sync_holddown_timer, circuit,
+                       ldp_sync_info->holddown, &ldp_sync_info->t_holddown);
 }
 
 /*
index 4d2d545683d16cefb6878f4f842633c2d4429894..323a25c260febc0a02363dcb0f08d17471ea6804 100644 (file)
@@ -1507,8 +1507,8 @@ int isis_rlfa_activate(struct isis_spftree *spftree, struct rlfa *rlfa,
        spftree->lfa.protection_counters.rlfa[vertex->N.ip.priority] += 1;
 
        THREAD_OFF(area->t_rlfa_rib_update);
-       thread_add_timer(master, isis_area_verify_routes_cb, area, 2,
-                        &area->t_rlfa_rib_update);
+       event_add_timer(master, isis_area_verify_routes_cb, area, 2,
+                       &area->t_rlfa_rib_update);
 
        return 0;
 }
@@ -1526,8 +1526,8 @@ void isis_rlfa_deactivate(struct isis_spftree *spftree, struct rlfa *rlfa)
        spftree->lfa.protection_counters.rlfa[vertex->N.ip.priority] -= 1;
 
        THREAD_OFF(area->t_rlfa_rib_update);
-       thread_add_timer(master, isis_area_verify_routes_cb, area, 2,
-                        &area->t_rlfa_rib_update);
+       event_add_timer(master, isis_area_verify_routes_cb, area, 2,
+                       &area->t_rlfa_rib_update);
 }
 
 void isis_rlfa_list_init(struct isis_spftree *spftree)
index 1498bbc0eae6276efcf5230f02009d43f6e06f1f..62912addcb4c7a5535fa73761c81db9105c0ff4d 100644 (file)
@@ -1384,9 +1384,9 @@ int lsp_generate(struct isis_area *area, int level)
                overload_time = isis_restart_read_overload_time(area);
                if (overload_time > 0) {
                        isis_area_overload_bit_set(area, true);
-                       thread_add_timer(master, set_overload_on_start_timer,
-                                        area, overload_time,
-                                        &area->t_overload_on_startup_timer);
+                       event_add_timer(master, set_overload_on_start_timer,
+                                       area, overload_time,
+                                       &area->t_overload_on_startup_timer);
                }
                device_startup = false;
        }
@@ -1420,9 +1420,8 @@ int lsp_generate(struct isis_area *area, int level)
 
        THREAD_OFF(area->t_lsp_refresh[level - 1]);
        area->lsp_regenerate_pending[level - 1] = 0;
-       thread_add_timer(master, lsp_refresh,
-                        &area->lsp_refresh_arg[level - 1], refresh_time,
-                        &area->t_lsp_refresh[level - 1]);
+       event_add_timer(master, lsp_refresh, &area->lsp_refresh_arg[level - 1],
+                       refresh_time, &area->t_lsp_refresh[level - 1]);
 
        if (IS_DEBUG_UPDATE_PACKETS) {
                zlog_debug("ISIS-Upd (%s): Building L%d LSP %s, len %hu, seq 0x%08x, cksum 0x%04hx, lifetime %hus refresh %hus",
@@ -1501,9 +1500,8 @@ static int lsp_regenerate(struct isis_area *area, int level)
        lsp_seqno_update(lsp);
 
        refresh_time = lsp_refresh_time(lsp, rem_lifetime);
-       thread_add_timer(master, lsp_refresh,
-                        &area->lsp_refresh_arg[level - 1], refresh_time,
-                        &area->t_lsp_refresh[level - 1]);
+       event_add_timer(master, lsp_refresh, &area->lsp_refresh_arg[level - 1],
+                       refresh_time, &area->t_lsp_refresh[level - 1]);
        area->lsp_regenerate_pending[level - 1] = 0;
 
        if (IS_DEBUG_UPDATE_PACKETS) {
@@ -1668,10 +1666,9 @@ int _lsp_regenerate_schedule(struct isis_area *area, int level,
                }
 
                area->lsp_regenerate_pending[lvl - 1] = 1;
-               thread_add_timer_msec(master, lsp_refresh,
-                                     &area->lsp_refresh_arg[lvl - 1],
-                                     timeout,
-                                     &area->t_lsp_refresh[lvl - 1]);
+               event_add_timer_msec(master, lsp_refresh,
+                                    &area->lsp_refresh_arg[lvl - 1], timeout,
+                                    &area->t_lsp_refresh[lvl - 1]);
        }
 
        if (all_pseudo) {
@@ -1825,13 +1822,13 @@ int lsp_generate_pseudo(struct isis_circuit *circuit, int level)
        THREAD_OFF(circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
        circuit->lsp_regenerate_pending[level - 1] = 0;
        if (level == IS_LEVEL_1)
-               thread_add_timer(
-                       master, lsp_l1_refresh_pseudo, circuit, refresh_time,
-                       &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
+               event_add_timer(master, lsp_l1_refresh_pseudo, circuit,
+                               refresh_time,
+                               &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
        else if (level == IS_LEVEL_2)
-               thread_add_timer(
-                       master, lsp_l2_refresh_pseudo, circuit, refresh_time,
-                       &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
+               event_add_timer(master, lsp_l2_refresh_pseudo, circuit,
+                               refresh_time,
+                               &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
 
        if (IS_DEBUG_UPDATE_PACKETS) {
                zlog_debug(
@@ -1880,13 +1877,13 @@ static int lsp_regenerate_pseudo(struct isis_circuit *circuit, int level)
 
        refresh_time = lsp_refresh_time(lsp, rem_lifetime);
        if (level == IS_LEVEL_1)
-               thread_add_timer(
-                       master, lsp_l1_refresh_pseudo, circuit, refresh_time,
-                       &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
+               event_add_timer(master, lsp_l1_refresh_pseudo, circuit,
+                               refresh_time,
+                               &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
        else if (level == IS_LEVEL_2)
-               thread_add_timer(
-                       master, lsp_l2_refresh_pseudo, circuit, refresh_time,
-                       &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
+               event_add_timer(master, lsp_l2_refresh_pseudo, circuit,
+                               refresh_time,
+                               &circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
 
        if (IS_DEBUG_UPDATE_PACKETS) {
                zlog_debug(
@@ -2032,11 +2029,11 @@ int lsp_regenerate_schedule_pseudo(struct isis_circuit *circuit, int level)
                circuit->lsp_regenerate_pending[lvl - 1] = 1;
 
                if (lvl == IS_LEVEL_1) {
-                       thread_add_timer_msec(
+                       event_add_timer_msec(
                                master, lsp_l1_refresh_pseudo, circuit, timeout,
                                &circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
                } else if (lvl == IS_LEVEL_2) {
-                       thread_add_timer_msec(
+                       event_add_timer_msec(
                                master, lsp_l2_refresh_pseudo, circuit, timeout,
                                &circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
                }
@@ -2060,7 +2057,7 @@ void lsp_tick(struct event *thread)
        area = THREAD_ARG(thread);
        assert(area);
        area->t_tick = NULL;
-       thread_add_timer(master, lsp_tick, area, 1, &area->t_tick);
+       event_add_timer(master, lsp_tick, area, 1, &area->t_tick);
 
        struct isis_circuit *fabricd_init_c = fabricd_initial_sync_circuit(area);
 
index ad5ec9f89e5e0669111a1156a9ac8a72ed8c1969..363543f5dc7bbf38011b459cdf0e47f9089ece09 100644 (file)
@@ -186,8 +186,8 @@ static void isis_config_start(void)
        /* Max wait time for config to load before generating lsp */
 #define ISIS_PRE_CONFIG_MAX_WAIT_SECONDS 600
        THREAD_OFF(t_isis_cfg);
-       thread_add_timer(im->master, isis_config_finish, NULL,
-                        ISIS_PRE_CONFIG_MAX_WAIT_SECONDS, &t_isis_cfg);
+       event_add_timer(im->master, isis_config_finish, NULL,
+                       ISIS_PRE_CONFIG_MAX_WAIT_SECONDS, &t_isis_cfg);
 }
 
 static void isis_config_end(void)
index 9965b2273208979c82aa61c4d2ecc14d575d1e19..3e8cb3f72a343752b98f90991bb0dde45417ef72 100644 (file)
@@ -193,8 +193,8 @@ static int process_p2p_hello(struct iih_info *iih)
 
        /* lets take care of the expiry */
        THREAD_OFF(adj->t_expire);
-       thread_add_timer(master, isis_adj_expire, adj, (long)adj->hold_time,
-                        &adj->t_expire);
+       event_add_timer(master, isis_adj_expire, adj, (long)adj->hold_time,
+                       &adj->t_expire);
 
        /* While fabricds initial sync is in progress, ignore hellos from other
         * interfaces than the one we are performing the initial sync on. */
@@ -466,8 +466,8 @@ static int process_lan_hello(struct iih_info *iih)
                                       : iih->circuit->u.bc.l2_desig_is;
 
                if (memcmp(dis, iih->dis, ISIS_SYS_ID_LEN + 1)) {
-                       thread_add_event(master, isis_event_dis_status_change,
-                                        iih->circuit, 0, NULL);
+                       event_add_event(master, isis_event_dis_status_change,
+                                       iih->circuit, 0, NULL);
                        memcpy(dis, iih->dis, ISIS_SYS_ID_LEN + 1);
                }
        }
@@ -485,8 +485,8 @@ static int process_lan_hello(struct iih_info *iih)
 
        /* lets take care of the expiry */
        THREAD_OFF(adj->t_expire);
-       thread_add_timer(master, isis_adj_expire, adj, (long)adj->hold_time,
-                        &adj->t_expire);
+       event_add_timer(master, isis_adj_expire, adj, (long)adj->hold_time,
+                       &adj->t_expire);
 
        /*
         * If the snpa for this circuit is found from LAN Neighbours TLV
@@ -2059,10 +2059,9 @@ static void _send_hello_sched(struct isis_circuit *circuit,
                THREAD_OFF(*threadp);
        }
 
-       thread_add_timer_msec(master, send_hello_cb,
-                             &circuit->level_arg[level - 1],
-                             isis_jitter(delay, IIH_JITTER),
-                             threadp);
+       event_add_timer_msec(master, send_hello_cb,
+                            &circuit->level_arg[level - 1],
+                            isis_jitter(delay, IIH_JITTER), threadp);
 }
 
 void send_hello_sched(struct isis_circuit *circuit, int level, long delay)
@@ -2254,9 +2253,9 @@ void send_l1_csnp(struct event *thread)
                send_csnp(circuit, 1);
        }
        /* set next timer thread */
-       thread_add_timer(master, send_l1_csnp, circuit,
-                        isis_jitter(circuit->csnp_interval[0], CSNP_JITTER),
-                        &circuit->t_send_csnp[0]);
+       event_add_timer(master, send_l1_csnp, circuit,
+                       isis_jitter(circuit->csnp_interval[0], CSNP_JITTER),
+                       &circuit->t_send_csnp[0]);
 }
 
 void send_l2_csnp(struct event *thread)
@@ -2274,9 +2273,9 @@ void send_l2_csnp(struct event *thread)
                send_csnp(circuit, 2);
        }
        /* set next timer thread */
-       thread_add_timer(master, send_l2_csnp, circuit,
-                        isis_jitter(circuit->csnp_interval[1], CSNP_JITTER),
-                        &circuit->t_send_csnp[1]);
+       event_add_timer(master, send_l2_csnp, circuit,
+                       isis_jitter(circuit->csnp_interval[1], CSNP_JITTER),
+                       &circuit->t_send_csnp[1]);
 }
 
 /*
@@ -2405,9 +2404,9 @@ void send_l1_psnp(struct event *thread)
 
        send_psnp(1, circuit);
        /* set next timer thread */
-       thread_add_timer(master, send_l1_psnp, circuit,
-                        isis_jitter(circuit->psnp_interval[0], PSNP_JITTER),
-                        &circuit->t_send_psnp[0]);
+       event_add_timer(master, send_l1_psnp, circuit,
+                       isis_jitter(circuit->psnp_interval[0], PSNP_JITTER),
+                       &circuit->t_send_psnp[0]);
 }
 
 /*
@@ -2426,9 +2425,9 @@ void send_l2_psnp(struct event *thread)
        send_psnp(2, circuit);
 
        /* set next timer thread */
-       thread_add_timer(master, send_l2_psnp, circuit,
-                        isis_jitter(circuit->psnp_interval[1], PSNP_JITTER),
-                        &circuit->t_send_psnp[1]);
+       event_add_timer(master, send_l2_psnp, circuit,
+                       isis_jitter(circuit->psnp_interval[1], PSNP_JITTER),
+                       &circuit->t_send_psnp[1]);
 }
 
 /*
index feb2d235b8dabffa287593f62dc976e560f9f07b..aabf79024d88df0676e40a08b2088ed7f59cd0ec 100644 (file)
@@ -1961,9 +1961,9 @@ int _isis_spf_schedule(struct isis_area *area, int level,
                if (area->spf_timer[level - 1])
                        return ISIS_OK;
 
-               thread_add_timer_msec(master, isis_run_spf_cb,
-                                     isis_run_spf_arg(area, level), delay,
-                                     &area->spf_timer[level - 1]);
+               event_add_timer_msec(master, isis_run_spf_cb,
+                                    isis_run_spf_arg(area, level), delay,
+                                    &area->spf_timer[level - 1]);
                return ISIS_OK;
        }
 
@@ -1990,8 +1990,8 @@ int _isis_spf_schedule(struct isis_area *area, int level,
                timer = area->min_spf_interval[level - 1] - diff;
        }
 
-       thread_add_timer(master, isis_run_spf_cb, isis_run_spf_arg(area, level),
-                        timer, &area->spf_timer[level - 1]);
+       event_add_timer(master, isis_run_spf_cb, isis_run_spf_arg(area, level),
+                       timer, &area->spf_timer[level - 1]);
 
        if (IS_DEBUG_SPF_EVENTS)
                zlog_debug("ISIS-SPF (%s) L%d SPF scheduled %ld sec from now",
index 59209d3aca5d554afc38b041d50b2e5d5b3c6ba6..791d221cf9dad167576ac012a30a9171c9c44866 100644 (file)
@@ -1108,8 +1108,8 @@ int isis_sr_start(struct isis_area *area)
        if (!isis_zebra_label_manager_ready())
                if (isis_zebra_label_manager_connect() < 0) {
                        /* Re-attempt to connect to Label Manager in 1 sec. */
-                       thread_add_timer(master, sr_start_label_manager, area,
-                                        1, &srdb->t_start_lm);
+                       event_add_timer(master, sr_start_label_manager, area, 1,
+                                       &srdb->t_start_lm);
                        return -1;
                }
 
index 42e1d68e03c829fa194603e4e91e05d6a1111e13..e0c5e164f6d4af7bd39c393e1d0b5c7073c730b1 100644 (file)
@@ -105,7 +105,7 @@ static void tx_queue_send_event(struct event *thread)
        struct isis_tx_queue_entry *e = THREAD_ARG(thread);
        struct isis_tx_queue *queue = e->queue;
 
-       thread_add_timer(master, tx_queue_send_event, e, 5, &e->retry);
+       event_add_timer(master, tx_queue_send_event, e, 5, &e->retry);
 
        if (e->is_retry)
                queue->circuit->area->lsp_rxmt_count++;
@@ -148,7 +148,7 @@ void _isis_tx_queue_add(struct isis_tx_queue *queue,
        e->type = type;
 
        THREAD_OFF(e->retry);
-       thread_add_event(master, tx_queue_send_event, e, 0, &e->retry);
+       event_add_event(master, tx_queue_send_event, e, 0, &e->retry);
 
        e->is_retry = false;
 }
index 73049d208396fd0b9b2ec0a6032ecc1d9aa66170..886849fed5c7dc3d4111db347d065404f9efb3b9 100644 (file)
@@ -325,7 +325,7 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)
        area->area_addrs->del = delete_area_addr;
 
        if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
-               thread_add_timer(master, lsp_tick, area, 1, &area->t_tick);
+               event_add_timer(master, lsp_tick, area, 1, &area->t_tick);
        flags_initialize(&area->flags);
 
        isis_sr_area_init(area);
index 6151c1a0b6c707b55905162e51a0eeac8bde4f60..2088ce977023ed769072567dd5940aca73f19772 100644 (file)
@@ -46,7 +46,7 @@ int accept_add(int fd, void (*cb)(struct event *), void *arg)
        av->arg = arg;
        LIST_INSERT_HEAD(&accept_queue.queue, av, entry);
 
-       thread_add_read(master, accept_cb, av, av->fd, &av->ev);
+       event_add_read(master, accept_cb, av, av->fd, &av->ev);
 
        log_debug("%s: accepting on fd %d", __func__, fd);
 
@@ -73,7 +73,7 @@ accept_pause(void)
 {
        log_debug(__func__);
        accept_unarm();
-       thread_add_timer(master, accept_timeout, NULL, 1, &accept_queue.evt);
+       event_add_timer(master, accept_timeout, NULL, 1, &accept_queue.evt);
 }
 
 void
@@ -91,7 +91,7 @@ accept_arm(void)
 {
        struct accept_ev        *av;
        LIST_FOREACH(av, &accept_queue.queue, entry) {
-               thread_add_read(master, accept_cb, av, av->fd, &av->ev);
+               event_add_read(master, accept_cb, av, av->fd, &av->ev);
        }
 }
 
@@ -106,7 +106,7 @@ accept_unarm(void)
 static void accept_cb(struct event *thread)
 {
        struct accept_ev        *av = THREAD_ARG(thread);
-       thread_add_read(master, accept_cb, av, av->fd, &av->ev);
+       event_add_read(master, accept_cb, av, av->fd, &av->ev);
        av->accept_cb(thread);
 }
 
index 36c14a5622c97dd295c684d324f23408c3734c85..d9a9d434a5788d69f4e02f007644bfdebd137eb6 100644 (file)
@@ -187,8 +187,8 @@ adj_start_itimer(struct adj *adj)
 {
        THREAD_OFF(adj->inactivity_timer);
        adj->inactivity_timer = NULL;
-       thread_add_timer(master, adj_itimer, adj, adj->holdtime,
-                        &adj->inactivity_timer);
+       event_add_timer(master, adj_itimer, adj, adj->holdtime,
+                       &adj->inactivity_timer);
 }
 
 void
@@ -345,8 +345,8 @@ tnbr_start_hello_timer(struct tnbr *tnbr)
 {
        THREAD_OFF(tnbr->hello_timer);
        tnbr->hello_timer = NULL;
-       thread_add_timer(master, tnbr_hello_timer, tnbr, tnbr_get_hello_interval(tnbr),
-                        &tnbr->hello_timer);
+       event_add_timer(master, tnbr_hello_timer, tnbr,
+                       tnbr_get_hello_interval(tnbr), &tnbr->hello_timer);
 }
 
 static void
index 2313e232fe1e8778c794f2b49484c6968eac2c9b..ade50edd4a27003387e55222719f7dacf53050a6 100644 (file)
@@ -122,8 +122,8 @@ static void control_accept(struct event *thread)
        imsg_init(&c->iev.ibuf, connfd);
        c->iev.handler_read = control_dispatch_imsg;
        c->iev.ev_read = NULL;
-       thread_add_read(master, c->iev.handler_read, &c->iev, c->iev.ibuf.fd,
-                       &c->iev.ev_read);
+       event_add_read(master, c->iev.handler_read, &c->iev, c->iev.ibuf.fd,
+                      &c->iev.ev_read);
        c->iev.handler_write = ldp_write_handler;
        c->iev.ev_write = NULL;
 
index 6996bf7c103b9bb625d40607ec16947608183fc8..5a6ea9c51809b7f4f76fba58f9e78c8590d27ca4 100644 (file)
@@ -457,8 +457,8 @@ static void
 if_start_hello_timer(struct iface_af *ia)
 {
        THREAD_OFF(ia->hello_timer);
-       thread_add_timer(master, if_hello_timer, ia, if_get_hello_interval(ia),
-                        &ia->hello_timer);
+       event_add_timer(master, if_hello_timer, ia, if_get_hello_interval(ia),
+                       &ia->hello_timer);
 }
 
 static void
@@ -733,7 +733,7 @@ static void start_wait_for_ldp_sync_timer(struct iface *iface)
                return;
 
        THREAD_OFF(iface->ldp_sync.wait_for_sync_timer);
-       thread_add_timer(master, iface_wait_for_ldp_sync_timer, iface,
+       event_add_timer(master, iface_wait_for_ldp_sync_timer, iface,
                        if_get_wait_for_sync_interval(),
                        &iface->ldp_sync.wait_for_sync_timer);
 }
index 3a38e165cc53b0f770aa5d3618a6803f3eb71dd2..a84c6635daea8177f695de52fe10a598d2e0d2ba 100644 (file)
@@ -134,8 +134,8 @@ lde(void)
                fatal(NULL);
        imsg_init(&iev_main->ibuf, LDPD_FD_ASYNC);
        iev_main->handler_read = lde_dispatch_parent;
-       thread_add_read(master, iev_main->handler_read, iev_main, iev_main->ibuf.fd,
-                       &iev_main->ev_read);
+       event_add_read(master, iev_main->handler_read, iev_main,
+                      iev_main->ibuf.fd, &iev_main->ev_read);
        iev_main->handler_write = ldp_write_handler;
 
        memset(&iev_main_sync_data, 0, sizeof(iev_main_sync_data));
@@ -523,8 +523,8 @@ static void lde_dispatch_parent(struct event *thread)
                                fatal(NULL);
                        imsg_init(&iev_ldpe->ibuf, fd);
                        iev_ldpe->handler_read = lde_dispatch_imsg;
-                       thread_add_read(master, iev_ldpe->handler_read, iev_ldpe, iev_ldpe->ibuf.fd,
-                                       &iev_ldpe->ev_read);
+                       event_add_read(master, iev_ldpe->handler_read, iev_ldpe,
+                                      iev_ldpe->ibuf.fd, &iev_ldpe->ev_read);
                        iev_ldpe->handler_write = ldp_write_handler;
                        iev_ldpe->ev_write = NULL;
                        break;
@@ -2178,7 +2178,7 @@ retry:
        zclient_sync = NULL;
 
        /* Retry using a timer */
-       thread_add_timer(master, zclient_sync_retry, NULL, 1, NULL);
+       event_add_timer(master, zclient_sync_retry, NULL, 1, NULL);
 }
 
 static void
index 62d06dfb19c364c08d9d3b5e0a1bdfe1e35f375f..721a1c11eff8fce89d6a86f8e96992ccdd6b09ff 100644 (file)
@@ -1058,8 +1058,7 @@ void
 lde_gc_start_timer(void)
 {
        THREAD_OFF(gc_timer);
-       thread_add_timer(master, lde_gc_timer, NULL, LDE_GC_INTERVAL,
-                        &gc_timer);
+       event_add_timer(master, lde_gc_timer, NULL, LDE_GC_INTERVAL, &gc_timer);
 }
 
 void
index f549b34ee26c2ef6eff2ccd9e786721075c92d99..c87bf1ea1a38c4ec0c5d5118b745319cc30dc3d0 100644 (file)
@@ -383,7 +383,7 @@ main(int argc, char *argv[])
        frr_config_fork();
 
        /* apply configuration */
-       thread_add_event(master, ldp_config_fork_apply, NULL, 0, NULL);
+       event_add_event(master, ldp_config_fork_apply, NULL, 0, NULL);
 
        /* setup pipes to children */
        if ((iev_ldpe = calloc(1, sizeof(struct imsgev))) == NULL ||
@@ -394,26 +394,26 @@ main(int argc, char *argv[])
 
        imsg_init(&iev_ldpe->ibuf, pipe_parent2ldpe[0]);
        iev_ldpe->handler_read = main_dispatch_ldpe;
-       thread_add_read(master, iev_ldpe->handler_read, iev_ldpe, iev_ldpe->ibuf.fd,
-                       &iev_ldpe->ev_read);
+       event_add_read(master, iev_ldpe->handler_read, iev_ldpe,
+                      iev_ldpe->ibuf.fd, &iev_ldpe->ev_read);
        iev_ldpe->handler_write = ldp_write_handler;
 
        imsg_init(&iev_ldpe_sync->ibuf, pipe_parent2ldpe_sync[0]);
        iev_ldpe_sync->handler_read = main_dispatch_ldpe;
-       thread_add_read(master, iev_ldpe_sync->handler_read, iev_ldpe_sync, iev_ldpe_sync->ibuf.fd,
-                       &iev_ldpe_sync->ev_read);
+       event_add_read(master, iev_ldpe_sync->handler_read, iev_ldpe_sync,
+                      iev_ldpe_sync->ibuf.fd, &iev_ldpe_sync->ev_read);
        iev_ldpe_sync->handler_write = ldp_write_handler;
 
        imsg_init(&iev_lde->ibuf, pipe_parent2lde[0]);
        iev_lde->handler_read = main_dispatch_lde;
-       thread_add_read(master, iev_lde->handler_read, iev_lde, iev_lde->ibuf.fd,
-                       &iev_lde->ev_read);
+       event_add_read(master, iev_lde->handler_read, iev_lde, iev_lde->ibuf.fd,
+                      &iev_lde->ev_read);
        iev_lde->handler_write = ldp_write_handler;
 
        imsg_init(&iev_lde_sync->ibuf, pipe_parent2lde_sync[0]);
        iev_lde_sync->handler_read = main_dispatch_lde;
-       thread_add_read(master, iev_lde_sync->handler_read, iev_lde_sync, iev_lde_sync->ibuf.fd,
-                       &iev_lde_sync->ev_read);
+       event_add_read(master, iev_lde_sync->handler_read, iev_lde_sync,
+                      iev_lde_sync->ibuf.fd, &iev_lde_sync->ev_read);
        iev_lde_sync->handler_write = ldp_write_handler;
 
        if (main_imsg_send_ipc_sockets(&iev_ldpe->ibuf, &iev_lde->ibuf))
@@ -787,12 +787,12 @@ void
 imsg_event_add(struct imsgev *iev)
 {
        if (iev->handler_read)
-               thread_add_read(master, iev->handler_read, iev, iev->ibuf.fd,
-                               &iev->ev_read);
+               event_add_read(master, iev->handler_read, iev, iev->ibuf.fd,
+                              &iev->ev_read);
 
        if (iev->handler_write && iev->ibuf.w.queued)
-               thread_add_write(master, iev->handler_write, iev,
-                                iev->ibuf.fd, &iev->ev_write);
+               event_add_write(master, iev->handler_write, iev, iev->ibuf.fd,
+                               &iev->ev_write);
 }
 
 int
@@ -819,8 +819,8 @@ void
 evbuf_event_add(struct evbuf *eb)
 {
        if (eb->wbuf.queued)
-               thread_add_write(master, eb->handler, eb->arg, eb->wbuf.fd,
-                                &eb->ev);
+               event_add_write(master, eb->handler, eb->arg, eb->wbuf.fd,
+                               &eb->ev);
 }
 
 void evbuf_init(struct evbuf *eb, int fd, void (*handler)(struct event *),
index 61a1a2aa81346c26990a5ecca290dfd653987163..68f6bc8bc3cbbccc6013c3bd01445add27bc3c7b 100644 (file)
@@ -111,8 +111,8 @@ ldpe(void)
                fatal(NULL);
        imsg_init(&iev_main->ibuf, LDPD_FD_ASYNC);
        iev_main->handler_read = ldpe_dispatch_main;
-       thread_add_read(master, iev_main->handler_read, iev_main, iev_main->ibuf.fd,
-                       &iev_main->ev_read);
+       event_add_read(master, iev_main->handler_read, iev_main,
+                      iev_main->ibuf.fd, &iev_main->ev_read);
        iev_main->handler_write = ldp_write_handler;
 
        memset(&iev_main_data, 0, sizeof(iev_main_data));
@@ -137,8 +137,8 @@ ldpe_init(struct ldpd_init *init)
        /* This socket must be open before dropping privileges. */
        global.pfkeysock = pfkey_init();
        if (sysdep.no_pfkey == 0) {
-               thread_add_read(master, ldpe_dispatch_pfkey, NULL, global.pfkeysock,
-                               &pfkey_ev);
+               event_add_read(master, ldpe_dispatch_pfkey, NULL,
+                              global.pfkeysock, &pfkey_ev);
        }
 #endif
 
@@ -363,8 +363,8 @@ static void ldpe_dispatch_main(struct event *thread)
                                fatal(NULL);
                        imsg_init(&iev_lde->ibuf, fd);
                        iev_lde->handler_read = ldpe_dispatch_lde;
-                       thread_add_read(master, iev_lde->handler_read, iev_lde, iev_lde->ibuf.fd,
-                                       &iev_lde->ev_read);
+                       event_add_read(master, iev_lde->handler_read, iev_lde,
+                                      iev_lde->ibuf.fd, &iev_lde->ev_read);
                        iev_lde->handler_write = ldp_write_handler;
                        iev_lde->ev_write = NULL;
                        break;
@@ -763,8 +763,8 @@ static void ldpe_dispatch_pfkey(struct event *thread)
 {
        int      fd = THREAD_FD(thread);
 
-       thread_add_read(master, ldpe_dispatch_pfkey, NULL, global.pfkeysock,
-                       &pfkey_ev);
+       event_add_read(master, ldpe_dispatch_pfkey, NULL, global.pfkeysock,
+                      &pfkey_ev);
 
        if (pfkey_read(fd, NULL) == -1)
                fatal("pfkey_read failed, exiting...");
@@ -781,13 +781,13 @@ ldpe_setup_sockets(int af, int disc_socket, int edisc_socket,
 
        /* discovery socket */
        af_global->ldp_disc_socket = disc_socket;
-       thread_add_read(master, disc_recv_packet, &af_global->disc_ev, af_global->ldp_disc_socket,
-                       &af_global->disc_ev);
+       event_add_read(master, disc_recv_packet, &af_global->disc_ev,
+                      af_global->ldp_disc_socket, &af_global->disc_ev);
 
        /* extended discovery socket */
        af_global->ldp_edisc_socket = edisc_socket;
-       thread_add_read(master, disc_recv_packet, &af_global->edisc_ev, af_global->ldp_edisc_socket,
-                       &af_global->edisc_ev);
+       event_add_read(master, disc_recv_packet, &af_global->edisc_ev,
+                      af_global->ldp_edisc_socket, &af_global->edisc_ev);
 
        /* session socket */
        af_global->ldp_session_socket = session_socket;
index e1c9e6337521ffb4ba26adb9f278eb57fa38d971..e0cd0ec3940cb00218a9865a3b941630fa0c2fb5 100644 (file)
@@ -425,7 +425,7 @@ nbr_start_ktimer(struct nbr *nbr)
        secs = nbr->keepalive / KEEPALIVE_PER_PERIOD;
        THREAD_OFF(nbr->keepalive_timer);
        nbr->keepalive_timer = NULL;
-       thread_add_timer(master, nbr_ktimer, nbr, secs, &nbr->keepalive_timer);
+       event_add_timer(master, nbr_ktimer, nbr, secs, &nbr->keepalive_timer);
 }
 
 void
@@ -452,8 +452,8 @@ nbr_start_ktimeout(struct nbr *nbr)
 {
        THREAD_OFF(nbr->keepalive_timeout);
        nbr->keepalive_timeout = NULL;
-       thread_add_timer(master, nbr_ktimeout, nbr, nbr->keepalive,
-                        &nbr->keepalive_timeout);
+       event_add_timer(master, nbr_ktimeout, nbr, nbr->keepalive,
+                       &nbr->keepalive_timeout);
 }
 
 void
@@ -481,7 +481,7 @@ nbr_start_itimeout(struct nbr *nbr)
        secs = INIT_FSM_TIMEOUT;
        THREAD_OFF(nbr->init_timeout);
        nbr->init_timeout = NULL;
-       thread_add_timer(master, nbr_itimeout, nbr, secs, &nbr->init_timeout);
+       event_add_timer(master, nbr_itimeout, nbr, secs, &nbr->init_timeout);
 }
 
 void
@@ -527,8 +527,7 @@ nbr_start_idtimer(struct nbr *nbr)
 
        THREAD_OFF(nbr->initdelay_timer);
        nbr->initdelay_timer = NULL;
-       thread_add_timer(master, nbr_idtimer, nbr, secs,
-                        &nbr->initdelay_timer);
+       event_add_timer(master, nbr_idtimer, nbr, secs, &nbr->initdelay_timer);
 }
 
 void
@@ -650,8 +649,8 @@ nbr_establish_connection(struct nbr *nbr)
        if (connect(nbr->fd, &remote_su.sa, sockaddr_len(&remote_su.sa))
            == -1) {
                if (errno == EINPROGRESS) {
-                       thread_add_write(master, nbr_connect_cb, nbr, nbr->fd,
-                                        &nbr->ev_connect);
+                       event_add_write(master, nbr_connect_cb, nbr, nbr->fd,
+                                       &nbr->ev_connect);
                        return (0);
                }
                log_warn("%s: error while connecting to %s", __func__,
index 6770ab73ef3ec4f69904d6272d607a3b7cc561d8..ef2f6e82b8644ae4b3cdd5fe610a302dd788d9a5 100644 (file)
@@ -129,7 +129,7 @@ void disc_recv_packet(struct event *thread)
        struct in_addr           lsr_id;
 
        /* reschedule read */
-       thread_add_read(master, disc_recv_packet, threadp, fd, threadp);
+       event_add_read(master, disc_recv_packet, threadp, fd, threadp);
 
        /* setup buffer */
        memset(&m, 0, sizeof(m));
@@ -406,7 +406,7 @@ static void session_read(struct event *thread)
        uint16_t         pdu_len, msg_len, msg_size, max_pdu_len;
        int              ret;
 
-       thread_add_read(master, session_read, nbr, fd, &tcp->rev);
+       event_add_read(master, session_read, nbr, fd, &tcp->rev);
 
        if ((n = read(fd, tcp->rbuf->buf + tcp->rbuf->wpos,
            sizeof(tcp->rbuf->buf) - tcp->rbuf->wpos)) == -1) {
@@ -721,7 +721,7 @@ tcp_new(int fd, struct nbr *nbr)
                if ((tcp->rbuf = calloc(1, sizeof(struct ibuf_read))) == NULL)
                        fatal(__func__);
 
-               thread_add_read(master, session_read, nbr, tcp->fd, &tcp->rev);
+               event_add_read(master, session_read, nbr, tcp->fd, &tcp->rev);
                tcp->nbr = nbr;
        }
 
@@ -768,8 +768,8 @@ pending_conn_new(int fd, int af, union ldpd_addr *addr)
        pconn->addr = *addr;
        TAILQ_INSERT_TAIL(&global.pending_conns, pconn, entry);
        pconn->ev_timeout = NULL;
-       thread_add_timer(master, pending_conn_timeout, pconn, PENDING_CONN_TIMEOUT,
-                        &pconn->ev_timeout);
+       event_add_timer(master, pending_conn_timeout, pconn,
+                       PENDING_CONN_TIMEOUT, &pconn->ev_timeout);
 
        return (pconn);
 }
index a17ee17253ea4654e830423bc7bbe9f25a79534d..fc724e7d700c41298a252859d75d7ab00c30de56 100644 (file)
@@ -103,8 +103,8 @@ static void agentx_events_update(void)
        snmp_select_info(&maxfd, &fds, &timeout, &block);
 
        if (!block) {
-               thread_add_timer_tv(agentx_tm, agentx_timeout, NULL, &timeout,
-                                   &timeout_thr);
+               event_add_timer_tv(agentx_tm, agentx_timeout, NULL, &timeout,
+                                  &timeout_thr);
        }
 
        ln = listhead(events);
@@ -133,7 +133,7 @@ static void agentx_events_update(void)
 
                        thr = XCALLOC(MTYPE_TMP, sizeof(struct event *));
                        newln = listnode_add_before(events, ln, thr);
-                       thread_add_read(agentx_tm, agentx_read, newln, fd, thr);
+                       event_add_read(agentx_tm, agentx_read, newln, fd, thr);
                }
        }
 
index 04f1c27b85d3ea5393aee4ced21c0665cec20701..e1aa45f097157822b903ac665ed364a5bdec5f77 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -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.
         */
@@ -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)
index 266670e396c1d2ffe20a72a94ddb30422c8e4272..f081ec4274bfbe1c62af3c220f60a93645fd64be 100644 (file)
@@ -948,10 +948,10 @@ done:
 }
 
 /* Add new read thread. */
-void _thread_add_read_write(const struct xref_threadsched *xref,
-                           struct thread_master *m,
-                           void (*func)(struct event *), void *arg, int fd,
-                           struct event **t_ptr)
+void _event_add_read_write(const struct xref_threadsched *xref,
+                          struct thread_master *m,
+                          void (*func)(struct event *), void *arg, int fd,
+                          struct event **t_ptr)
 {
        int dir = xref->thread_type;
        struct event *thread = NULL;
@@ -1028,11 +1028,11 @@ void _thread_add_read_write(const struct xref_threadsched *xref,
        }
 }
 
-static void _thread_add_timer_timeval(const struct xref_threadsched *xref,
-                                     struct thread_master *m,
-                                     void (*func)(struct event *), void *arg,
-                                     struct timeval *time_relative,
-                                     struct event **t_ptr)
+static void _event_add_timer_timeval(const struct xref_threadsched *xref,
+                                    struct thread_master *m,
+                                    void (*func)(struct event *), void *arg,
+                                    struct timeval *time_relative,
+                                    struct event **t_ptr)
 {
        struct event *thread;
        struct timeval t;
@@ -1082,9 +1082,9 @@ static void _thread_add_timer_timeval(const struct xref_threadsched *xref,
 
 
 /* Add timer event thread. */
-void _thread_add_timer(const struct xref_threadsched *xref,
-                      struct thread_master *m, void (*func)(struct event *),
-                      void *arg, long timer, struct event **t_ptr)
+void _event_add_timer(const struct xref_threadsched *xref,
+                     struct thread_master *m, void (*func)(struct event *),
+                     void *arg, long timer, struct event **t_ptr)
 {
        struct timeval trel;
 
@@ -1093,14 +1093,14 @@ void _thread_add_timer(const struct xref_threadsched *xref,
        trel.tv_sec = timer;
        trel.tv_usec = 0;
 
-       _thread_add_timer_timeval(xref, m, func, arg, &trel, t_ptr);
+       _event_add_timer_timeval(xref, m, func, arg, &trel, t_ptr);
 }
 
 /* Add timer event thread with "millisecond" resolution */
-void _thread_add_timer_msec(const struct xref_threadsched *xref,
-                           struct thread_master *m,
-                           void (*func)(struct event *), void *arg, long timer,
-                           struct event **t_ptr)
+void _event_add_timer_msec(const struct xref_threadsched *xref,
+                          struct thread_master *m,
+                          void (*func)(struct event *), void *arg, long timer,
+                          struct event **t_ptr)
 {
        struct timeval trel;
 
@@ -1109,21 +1109,21 @@ void _thread_add_timer_msec(const struct xref_threadsched *xref,
        trel.tv_sec = timer / 1000;
        trel.tv_usec = 1000 * (timer % 1000);
 
-       _thread_add_timer_timeval(xref, m, func, arg, &trel, t_ptr);
+       _event_add_timer_timeval(xref, m, func, arg, &trel, t_ptr);
 }
 
 /* Add timer event thread with "timeval" resolution */
-void _thread_add_timer_tv(const struct xref_threadsched *xref,
-                         struct thread_master *m, void (*func)(struct event *),
-                         void *arg, struct timeval *tv, struct event **t_ptr)
+void _event_add_timer_tv(const struct xref_threadsched *xref,
+                        struct thread_master *m, void (*func)(struct event *),
+                        void *arg, struct timeval *tv, struct event **t_ptr)
 {
-       _thread_add_timer_timeval(xref, m, func, arg, tv, t_ptr);
+       _event_add_timer_timeval(xref, m, func, arg, tv, t_ptr);
 }
 
 /* Add simple event thread. */
-void _thread_add_event(const struct xref_threadsched *xref,
-                      struct thread_master *m, void (*func)(struct event *),
-                      void *arg, int val, struct event **t_ptr)
+void _event_add_event(const struct xref_threadsched *xref,
+                     struct thread_master *m, void (*func)(struct event *),
+                     void *arg, int val, struct event **t_ptr)
 {
        struct event *thread = NULL;
 
index e1d3ad68ab397569971e2260321a6e9b048012cc..375cd46bbfdbded08b8c1d106e8ed07ae4543a94 100644 (file)
@@ -172,24 +172,26 @@ struct cpu_thread_history {
 
 #define _xref_t_a(addfn, type, m, f, a, v, t)                                  \
        ({                                                                     \
-               static const struct xref_threadsched _xref                     \
-                               __attribute__((used)) = {                      \
+               static const struct xref_threadsched _xref __attribute__(      \
+                       (used)) = {                                            \
                        .xref = XREF_INIT(XREFT_THREADSCHED, NULL, __func__),  \
                        .funcname = #f,                                        \
                        .dest = #t,                                            \
-                       .thread_type = THREAD_ ## type,                        \
+                       .thread_type = THREAD_##type,                          \
                };                                                             \
                XREF_LINK(_xref.xref);                                         \
-               _thread_add_ ## addfn(&_xref, m, f, a, v, t);                  \
-       })                                                                     \
-       /* end */
+               _event_add_##addfn(&_xref, m, f, a, v, t);                     \
+       }) /* end */
 
-#define thread_add_read(m,f,a,v,t)       _xref_t_a(read_write, READ,  m,f,a,v,t)
-#define thread_add_write(m,f,a,v,t)      _xref_t_a(read_write, WRITE, m,f,a,v,t)
-#define thread_add_timer(m,f,a,v,t)      _xref_t_a(timer,      TIMER, m,f,a,v,t)
-#define thread_add_timer_msec(m,f,a,v,t) _xref_t_a(timer_msec, TIMER, m,f,a,v,t)
-#define thread_add_timer_tv(m,f,a,v,t)   _xref_t_a(timer_tv,   TIMER, m,f,a,v,t)
-#define thread_add_event(m,f,a,v,t)      _xref_t_a(event,      EVENT, m,f,a,v,t)
+#define event_add_read(m, f, a, v, t) _xref_t_a(read_write, READ, m, f, a, v, t)
+#define event_add_write(m, f, a, v, t)                                         \
+       _xref_t_a(read_write, WRITE, m, f, a, v, t)
+#define event_add_timer(m, f, a, v, t) _xref_t_a(timer, TIMER, m, f, a, v, t)
+#define event_add_timer_msec(m, f, a, v, t)                                    \
+       _xref_t_a(timer_msec, TIMER, m, f, a, v, t)
+#define event_add_timer_tv(m, f, a, v, t)                                      \
+       _xref_t_a(timer_tv, TIMER, m, f, a, v, t)
+#define event_add_event(m, f, a, v, t) _xref_t_a(event, EVENT, m, f, a, v, t)
 
 #define thread_execute(m,f,a,v)                                                \
        ({                                                                     \
@@ -210,30 +212,30 @@ void thread_master_set_name(struct thread_master *master, const char *name);
 extern void thread_master_free(struct thread_master *);
 extern void thread_master_free_unused(struct thread_master *);
 
-extern void _thread_add_read_write(const struct xref_threadsched *xref,
-                                  struct thread_master *master,
-                                  void (*fn)(struct event *), void *arg,
-                                  int fd, struct event **tref);
-
-extern void _thread_add_timer(const struct xref_threadsched *xref,
-                             struct thread_master *master,
-                             void (*fn)(struct event *), void *arg, long t,
-                             struct event **tref);
-
-extern void _thread_add_timer_msec(const struct xref_threadsched *xref,
-                                  struct thread_master *master,
-                                  void (*fn)(struct event *), void *arg,
-                                  long t, struct event **tref);
-
-extern void _thread_add_timer_tv(const struct xref_threadsched *xref,
-                                struct thread_master *master,
-                                void (*fn)(struct event *), void *arg,
-                                struct timeval *tv, struct event **tref);
-
-extern void _thread_add_event(const struct xref_threadsched *xref,
-                             struct thread_master *master,
-                             void (*fn)(struct event *), void *arg, int val,
-                             struct event **tref);
+extern void _event_add_read_write(const struct xref_threadsched *xref,
+                                 struct thread_master *master,
+                                 void (*fn)(struct event *), void *arg, int fd,
+                                 struct event **tref);
+
+extern void _event_add_timer(const struct xref_threadsched *xref,
+                            struct thread_master *master,
+                            void (*fn)(struct event *), void *arg, long t,
+                            struct event **tref);
+
+extern void _event_add_timer_msec(const struct xref_threadsched *xref,
+                                 struct thread_master *master,
+                                 void (*fn)(struct event *), void *arg, long t,
+                                 struct event **tref);
+
+extern void _event_add_timer_tv(const struct xref_threadsched *xref,
+                               struct thread_master *master,
+                               void (*fn)(struct event *), void *arg,
+                               struct timeval *tv, struct event **tref);
+
+extern void _event_add_event(const struct xref_threadsched *xref,
+                            struct thread_master *master,
+                            void (*fn)(struct event *), void *arg, int val,
+                            struct event **tref);
 
 extern void _thread_execute(const struct xref_threadsched *xref,
                            struct thread_master *master,
index 9f026868dbc53553cad28078b4904e8a3f528668..e7bbae0c597ef279041bdf61a881854ec8aea798 100644 (file)
@@ -239,7 +239,7 @@ static void fpt_finish(struct event *thread)
 /* stop function, called from other threads to halt this one */
 static int fpt_halt(struct frr_pthread *fpt, void **res)
 {
-       thread_add_event(fpt->master, &fpt_finish, fpt, 0, NULL);
+       event_add_event(fpt->master, &fpt_finish, fpt, 0, NULL);
        pthread_join(fpt->thread, res);
 
        return 0;
@@ -281,7 +281,7 @@ static void *fpt_run(void *arg)
 
        int sleeper[2];
        pipe(sleeper);
-       thread_add_read(fpt->master, &fpt_dummy, NULL, sleeper[0], NULL);
+       event_add_read(fpt->master, &fpt_dummy, NULL, sleeper[0], NULL);
 
        fpt->master->handle_signals = false;
 
index 30c51230cb46e47498a0fadf91a4eba3429ed9e0..65e1cf5cfb36e201aafcb5cca2881fe7e0b75f79 100644 (file)
@@ -138,8 +138,8 @@ static void frrzmq_read_msg(struct event *t)
        if (read)
                frrzmq_check_events(cbp, &cb->write, ZMQ_POLLOUT);
 
-       thread_add_read(t->master, frrzmq_read_msg, cbp,
-                       cb->fd, &cb->read.thread);
+       event_add_read(t->master, frrzmq_read_msg, cbp, cb->fd,
+                      &cb->read.thread);
        return;
 
 out_err:
@@ -149,14 +149,13 @@ out_err:
                cb->read.cb_error(cb->read.arg, cb->zmqsock);
 }
 
-int _frrzmq_thread_add_read(const struct xref_threadsched *xref,
-                           struct thread_master *master,
-                           void (*msgfunc)(void *arg, void *zmqsock),
-                           void (*partfunc)(void *arg, void *zmqsock,
-                                            zmq_msg_t *msg, unsigned partnum),
-                           void (*errfunc)(void *arg, void *zmqsock),
-                           void *arg, void *zmqsock,
-                           struct frrzmq_cb **cbp)
+int _frrzmq_event_add_read(const struct xref_threadsched *xref,
+                          struct thread_master *master,
+                          void (*msgfunc)(void *arg, void *zmqsock),
+                          void (*partfunc)(void *arg, void *zmqsock,
+                                           zmq_msg_t *msg, unsigned partnum),
+                          void (*errfunc)(void *arg, void *zmqsock), void *arg,
+                          void *zmqsock, struct frrzmq_cb **cbp)
 {
        int fd, events;
        size_t len;
@@ -193,11 +192,11 @@ int _frrzmq_thread_add_read(const struct xref_threadsched *xref,
        if (events & ZMQ_POLLIN) {
                thread_cancel(&cb->read.thread);
 
-               thread_add_event(master, frrzmq_read_msg, cbp, fd,
-                                 &cb->read.thread);
-       } else
-               thread_add_read(master, frrzmq_read_msg, cbp, fd,
+               event_add_event(master, frrzmq_read_msg, cbp, fd,
                                &cb->read.thread);
+       } else
+               event_add_read(master, frrzmq_read_msg, cbp, fd,
+                              &cb->read.thread);
        return 0;
 }
 
@@ -247,8 +246,8 @@ static void frrzmq_write_msg(struct event *t)
        if (written)
                frrzmq_check_events(cbp, &cb->read, ZMQ_POLLIN);
 
-       thread_add_write(t->master, frrzmq_write_msg, cbp,
-                        cb->fd, &cb->write.thread);
+       event_add_write(t->master, frrzmq_write_msg, cbp, cb->fd,
+                       &cb->write.thread);
        return;
 
 out_err:
@@ -258,11 +257,11 @@ out_err:
                cb->write.cb_error(cb->write.arg, cb->zmqsock);
 }
 
-int _frrzmq_thread_add_write(const struct xref_threadsched *xref,
-                            struct thread_master *master,
-                            void (*msgfunc)(void *arg, void *zmqsock),
-                            void (*errfunc)(void *arg, void *zmqsock),
-                            void *arg, void *zmqsock, struct frrzmq_cb **cbp)
+int _frrzmq_event_add_write(const struct xref_threadsched *xref,
+                           struct thread_master *master,
+                           void (*msgfunc)(void *arg, void *zmqsock),
+                           void (*errfunc)(void *arg, void *zmqsock),
+                           void *arg, void *zmqsock, struct frrzmq_cb **cbp)
 {
        int fd, events;
        size_t len;
@@ -299,11 +298,11 @@ int _frrzmq_thread_add_write(const struct xref_threadsched *xref,
        if (events & ZMQ_POLLOUT) {
                thread_cancel(&cb->write.thread);
 
-               _thread_add_event(xref, master, frrzmq_write_msg, cbp, fd,
-                                 &cb->write.thread);
-       } else
-               thread_add_write(master, frrzmq_write_msg, cbp, fd,
+               _event_add_event(xref, master, frrzmq_write_msg, cbp, fd,
                                 &cb->write.thread);
+       } else
+               event_add_write(master, frrzmq_write_msg, cbp, fd,
+                               &cb->write.thread);
        return 0;
 }
 
@@ -348,10 +347,10 @@ void frrzmq_check_events(struct frrzmq_cb **cbp, struct cb_core *core,
                thread_cancel(&core->thread);
 
                if (event == ZMQ_POLLIN)
-                       thread_add_event(tm, frrzmq_read_msg,
-                                        cbp, cb->fd, &core->thread);
+                       event_add_event(tm, frrzmq_read_msg, cbp, cb->fd,
+                                       &core->thread);
                else
-                       thread_add_event(tm, frrzmq_write_msg,
-                                        cbp, cb->fd, &core->thread);
+                       event_add_event(tm, frrzmq_write_msg, cbp, cb->fd,
+                                       &core->thread);
        }
 }
index d90088edb259fa81f9c38d5051703db0224cbc47..b12c0f754afc3f9374be50111733173fb3559800 100644 (file)
@@ -72,17 +72,17 @@ extern void frrzmq_finish(void);
        /* end */
 
 /* core event registration, one of these 2 macros should be used */
-#define frrzmq_thread_add_read_msg(m, f, e, a, z, d)                           \
+#define frrzmq_event_add_read_msg(m, f, e, a, z, d)                            \
        _xref_zmq_a(READ, f, d,                                                \
-               _frrzmq_thread_add_read(&_xref, m, f, NULL, e, a, z, d))
+                   _frrzmq_event_add_read(&_xref, m, f, NULL, e, a, z, d))
 
-#define frrzmq_thread_add_read_part(m, f, e, a, z, d)                          \
+#define frrzmq_event_add_read_part(m, f, e, a, z, d)                           \
        _xref_zmq_a(READ, f, d,                                                \
-               _frrzmq_thread_add_read(&_xref, m, NULL, f, e, a, z, d))
+                   _frrzmq_event_add_read(&_xref, m, NULL, f, e, a, z, d))
 
-#define frrzmq_thread_add_write_msg(m, f, e, a, z, d)                          \
+#define frrzmq_event_add_write_msg(m, f, e, a, z, d)                           \
        _xref_zmq_a(WRITE, f, d,                                               \
-               _frrzmq_thread_add_write(&_xref, m, f, e, a, z, d))
+                   _frrzmq_event_add_write(&_xref, m, f, e, a, z, d))
 
 struct cb_core;
 struct frrzmq_cb;
@@ -108,18 +108,20 @@ struct frrzmq_cb;
  *   may schedule the event to run as soon as libfrr is back in its main
  *   loop.
  */
-extern int _frrzmq_thread_add_read(
-       const struct xref_threadsched *xref, struct thread_master *master,
-       void (*msgfunc)(void *arg, void *zmqsock),
-       void (*partfunc)(void *arg, void *zmqsock, zmq_msg_t *msg,
-                        unsigned partnum),
-       void (*errfunc)(void *arg, void *zmqsock), void *arg, void *zmqsock,
-       struct frrzmq_cb **cb);
-extern int _frrzmq_thread_add_write(
-       const struct xref_threadsched *xref, struct thread_master *master,
-       void (*msgfunc)(void *arg, void *zmqsock),
-       void (*errfunc)(void *arg, void *zmqsock), void *arg, void *zmqsock,
-       struct frrzmq_cb **cb);
+extern int
+_frrzmq_event_add_read(const struct xref_threadsched *xref,
+                      struct thread_master *master,
+                      void (*msgfunc)(void *arg, void *zmqsock),
+                      void (*partfunc)(void *arg, void *zmqsock,
+                                       zmq_msg_t *msg, unsigned partnum),
+                      void (*errfunc)(void *arg, void *zmqsock), void *arg,
+                      void *zmqsock, struct frrzmq_cb **cb);
+extern int _frrzmq_event_add_write(const struct xref_threadsched *xref,
+                                  struct thread_master *master,
+                                  void (*msgfunc)(void *arg, void *zmqsock),
+                                  void (*errfunc)(void *arg, void *zmqsock),
+                                  void *arg, void *zmqsock,
+                                  struct frrzmq_cb **cb);
 
 extern void frrzmq_thread_cancel(struct frrzmq_cb **cb, struct cb_core *core);
 
index 433e9cb1488ac0a7f2fd902277583cb74067bdea..9a57c2313c3a651abbf3daa13ce4ccfc4c0f1385 100644 (file)
@@ -1015,8 +1015,8 @@ void frr_config_fork(void)
                        exit(0);
                }
 
-               thread_add_event(master, frr_config_read_in, NULL, 0,
-                                &di->read_in);
+               event_add_event(master, frr_config_read_in, NULL, 0,
+                               &di->read_in);
        }
 
        if (di->daemon_mode || di->terminal)
@@ -1129,8 +1129,8 @@ static void frr_daemon_ctl(struct event *t)
        }
 
 out:
-       thread_add_read(master, frr_daemon_ctl, NULL, daemon_ctl_sock,
-                       &daemon_ctl_thread);
+       event_add_read(master, frr_daemon_ctl, NULL, daemon_ctl_sock,
+                      &daemon_ctl_thread);
 }
 
 void frr_detach(void)
@@ -1158,8 +1158,8 @@ void frr_run(struct thread_master *master)
                vty_stdio(frr_terminal_close);
                if (daemon_ctl_sock != -1) {
                        set_nonblocking(daemon_ctl_sock);
-                       thread_add_read(master, frr_daemon_ctl, NULL,
-                                       daemon_ctl_sock, &daemon_ctl_thread);
+                       event_add_read(master, frr_daemon_ctl, NULL,
+                                      daemon_ctl_sock, &daemon_ctl_thread);
                }
        } else if (di->daemon_mode) {
                int nullfd = open("/dev/null", O_RDONLY | O_NOCTTY);
index b70c00635dcd7cd71b4419c17ac1fcab17991f3c..ca4e219480c9a136a05460efcff20598d7337fc2 100644 (file)
@@ -1053,25 +1053,25 @@ mgmt_be_client_register_event(struct mgmt_be_client_ctx *client_ctx,
 
        switch (event) {
        case MGMTD_BE_CONN_READ:
-               thread_add_read(client_ctx->tm, mgmt_be_client_read,
+               event_add_read(client_ctx->tm, mgmt_be_client_read,
                                client_ctx, client_ctx->conn_fd,
                                &client_ctx->conn_read_ev);
                assert(client_ctx->conn_read_ev);
                break;
        case MGMTD_BE_CONN_WRITE:
-               thread_add_write(client_ctx->tm, mgmt_be_client_write,
+               event_add_write(client_ctx->tm, mgmt_be_client_write,
                                 client_ctx, client_ctx->conn_fd,
                                 &client_ctx->conn_write_ev);
                assert(client_ctx->conn_write_ev);
                break;
        case MGMTD_BE_PROC_MSG:
                tv.tv_usec = MGMTD_BE_MSG_PROC_DELAY_USEC;
-               thread_add_timer_tv(client_ctx->tm, mgmt_be_client_proc_msgbufs,
+               event_add_timer_tv(client_ctx->tm, mgmt_be_client_proc_msgbufs,
                                    client_ctx, &tv, &client_ctx->msg_proc_ev);
                assert(client_ctx->msg_proc_ev);
                break;
        case MGMTD_BE_CONN_WRITES_ON:
-               thread_add_timer_msec(client_ctx->tm,
+               event_add_timer_msec(client_ctx->tm,
                                      mgmt_be_client_resume_writes, client_ctx,
                                      MGMTD_BE_MSG_WRITE_DELAY_MSEC,
                                      &client_ctx->conn_writes_on);
@@ -1095,7 +1095,7 @@ mgmt_be_client_schedule_conn_retry(struct mgmt_be_client_ctx *client_ctx,
        MGMTD_BE_CLIENT_DBG(
                "Scheduling MGMTD Backend server connection retry after %lu seconds",
                intvl_secs);
-       thread_add_timer(client_ctx->tm, mgmt_be_client_conn_timeout,
+       event_add_timer(client_ctx->tm, mgmt_be_client_conn_timeout,
                         (void *)client_ctx, intvl_secs,
                         &client_ctx->conn_retry_tmr);
 }
index c0d897ab2c9174d3df6e28c53678261dda902c3d..f41217ce31efc34aeaee98b0c3c27c2f0053b626 100644 (file)
@@ -738,26 +738,26 @@ mgmt_fe_client_register_event(struct mgmt_fe_client_ctx *client_ctx,
 
        switch (event) {
        case MGMTD_FE_CONN_READ:
-               thread_add_read(client_ctx->tm, mgmt_fe_client_read,
+               event_add_read(client_ctx->tm, mgmt_fe_client_read,
                                client_ctx, client_ctx->conn_fd,
                                &client_ctx->conn_read_ev);
                assert(client_ctx->conn_read_ev);
                break;
        case MGMTD_FE_CONN_WRITE:
-               thread_add_write(client_ctx->tm, mgmt_fe_client_write,
+               event_add_write(client_ctx->tm, mgmt_fe_client_write,
                                 client_ctx, client_ctx->conn_fd,
                                 &client_ctx->conn_write_ev);
                assert(client_ctx->conn_write_ev);
                break;
        case MGMTD_FE_PROC_MSG:
                tv.tv_usec = MGMTD_FE_MSG_PROC_DELAY_USEC;
-               thread_add_timer_tv(client_ctx->tm,
+               event_add_timer_tv(client_ctx->tm,
                                    mgmt_fe_client_proc_msgbufs, client_ctx,
                                    &tv, &client_ctx->msg_proc_ev);
                assert(client_ctx->msg_proc_ev);
                break;
        case MGMTD_FE_CONN_WRITES_ON:
-               thread_add_timer_msec(
+               event_add_timer_msec(
                        client_ctx->tm, mgmt_fe_client_resume_writes,
                        client_ctx, MGMTD_FE_MSG_WRITE_DELAY_MSEC,
                        &client_ctx->conn_writes_on);
@@ -775,7 +775,7 @@ static void mgmt_fe_client_schedule_conn_retry(
        MGMTD_FE_CLIENT_DBG(
                "Scheduling MGMTD Frontend server connection retry after %lu seconds",
                intvl_secs);
-       thread_add_timer(client_ctx->tm, mgmt_fe_client_conn_timeout,
+       event_add_timer(client_ctx->tm, mgmt_fe_client_conn_timeout,
                         (void *)client_ctx, intvl_secs,
                         &client_ctx->conn_retry_tmr);
 }
index 6d0ee100bc2fa5cc801605745bf4847699c10dbb..704904304c0349541a014c4c36d74dbab51bc50d 100644 (file)
@@ -329,10 +329,9 @@ static int nb_cli_commit(struct vty *vty, bool force,
                                confirmed_timeout);
 
                        thread_cancel(&vty->t_confirmed_commit_timeout);
-                       thread_add_timer(master,
-                                        nb_cli_confirmed_commit_timeout, vty,
-                                        confirmed_timeout * 60,
-                                        &vty->t_confirmed_commit_timeout);
+                       event_add_timer(master, nb_cli_confirmed_commit_timeout,
+                                       vty, confirmed_timeout * 60,
+                                       &vty->t_confirmed_commit_timeout);
                } else {
                        /* Accept commit confirmation. */
                        vty_out(vty, "%% Commit complete.\n\n");
@@ -355,9 +354,9 @@ static int nb_cli_commit(struct vty *vty, bool force,
                vty->confirmed_commit_rollback = nb_config_dup(running_config);
 
                vty->t_confirmed_commit_timeout = NULL;
-               thread_add_timer(master, nb_cli_confirmed_commit_timeout, vty,
-                                confirmed_timeout * 60,
-                                &vty->t_confirmed_commit_timeout);
+               event_add_timer(master, nb_cli_confirmed_commit_timeout, vty,
+                               confirmed_timeout * 60,
+                               &vty->t_confirmed_commit_timeout);
        }
 
        context.client = NB_CLIENT_CLI;
index f0084e576b36f56067b09a6d4db9d078c28479b3..b67491235451624d8c52ad01c4cf4eb3d02d60d4 100644 (file)
@@ -409,7 +409,7 @@ static void frr_confd_cdb_read_cb(struct event *thread)
        int *subp = NULL;
        int reslen = 0;
 
-       thread_add_read(master, frr_confd_cdb_read_cb, NULL, fd, &t_cdb_sub);
+       event_add_read(master, frr_confd_cdb_read_cb, NULL, fd, &t_cdb_sub);
 
        if (cdb_read_subscription_socket2(fd, &cdb_ev, &flags, &subp, &reslen)
            != CONFD_OK) {
@@ -574,8 +574,8 @@ static int frr_confd_init_cdb(void)
        }
        pthread_detach(cdb_trigger_thread);
 
-       thread_add_read(master, frr_confd_cdb_read_cb, NULL, cdb_sub_sock,
-                       &t_cdb_sub);
+       event_add_read(master, frr_confd_cdb_read_cb, NULL, cdb_sub_sock,
+                      &t_cdb_sub);
 
        return 0;
 
@@ -1178,7 +1178,7 @@ static void frr_confd_dp_ctl_read(struct event *thread)
        struct confd_daemon_ctx *dctx = THREAD_ARG(thread);
        int fd = THREAD_FD(thread);
 
-       thread_add_read(master, frr_confd_dp_ctl_read, dctx, fd, &t_dp_ctl);
+       event_add_read(master, frr_confd_dp_ctl_read, dctx, fd, &t_dp_ctl);
 
        frr_confd_dp_read(dctx, fd);
 }
@@ -1188,7 +1188,8 @@ static void frr_confd_dp_worker_read(struct event *thread)
        struct confd_daemon_ctx *dctx = THREAD_ARG(thread);
        int fd = THREAD_FD(thread);
 
-       thread_add_read(master, frr_confd_dp_worker_read, dctx, fd, &t_dp_worker);
+       event_add_read(master, frr_confd_dp_worker_read, dctx, fd,
+                      &t_dp_worker);
 
        frr_confd_dp_read(dctx, fd);
 }
@@ -1320,10 +1321,10 @@ static int frr_confd_init_dp(const char *program_name)
                goto error;
        }
 
-       thread_add_read(master, frr_confd_dp_ctl_read, dctx, dp_ctl_sock,
-                       &t_dp_ctl);
-       thread_add_read(master, frr_confd_dp_worker_read, dctx, dp_worker_sock,
-                       &t_dp_worker);
+       event_add_read(master, frr_confd_dp_ctl_read, dctx, dp_ctl_sock,
+                      &t_dp_ctl);
+       event_add_read(master, frr_confd_dp_worker_read, dctx, dp_worker_sock,
+                      &t_dp_worker);
 
        return 0;
 
index 4de2b0e3396f859e9461fc7d51b286daf7b1e65c..a06daa8676749010021f4604e95d1d2f5ab2dbdf 100644 (file)
@@ -157,8 +157,7 @@ class RpcStateBase
                 * state will either be MORE or FINISH. It will always be FINISH
                 * for Unary RPCs.
                 */
-               thread_add_event(main_master, c_callback, (void *)this, 0,
-                                NULL);
+               event_add_event(main_master, c_callback, (void *)this, 0, NULL);
 
                pthread_mutex_lock(&this->cmux);
                while (this->state == PROCESS)
@@ -1303,7 +1302,7 @@ static int frr_grpc_module_late_init(struct thread_master *tm)
 {
        main_master = tm;
        hook_register(frr_fini, frr_grpc_finish);
-       thread_add_event(tm, frr_grpc_module_very_late_init, NULL, 0, NULL);
+       event_add_event(tm, frr_grpc_module_very_late_init, NULL, 0, NULL);
        return 0;
 }
 
index 9b0d2817d7e8bf0772015876f748cc76aad93b3a..145e43ddb18b0d48297a7db138c72cb5d9b2ed3c 100644 (file)
@@ -528,7 +528,7 @@ static void frr_sr_read_cb(struct event *thread)
                return;
        }
 
-       thread_add_read(master, frr_sr_read_cb, module, fd, &module->sr_thread);
+       event_add_read(master, frr_sr_read_cb, module, fd, &module->sr_thread);
 }
 
 static void frr_sr_subscribe_config(struct yang_module *module)
@@ -688,8 +688,8 @@ static int frr_sr_init(void)
                                 sr_strerror(ret));
                        goto cleanup;
                }
-               thread_add_read(master, frr_sr_read_cb, module,
-                               event_pipe, &module->sr_thread);
+               event_add_read(master, frr_sr_read_cb, module, event_pipe,
+                              &module->sr_thread);
        }
 
        hook_register(nb_notification_send, frr_sr_notification_send);
index de07ca16812a646762257cc03d6545da2cc8b34c..55ff4df011c06790ad84cbd73a117c575c8ce240 100644 (file)
@@ -80,7 +80,7 @@ void pullwr_bump(struct pullwr *pullwr)
        if (pullwr->writer)
                return;
 
-       thread_add_timer(pullwr->tm, pullwr_run, pullwr, 0, &pullwr->writer);
+       event_add_timer(pullwr->tm, pullwr_run, pullwr, 0, &pullwr->writer);
 }
 
 static size_t pullwr_iov(struct pullwr *pullwr, struct iovec *iov)
@@ -206,7 +206,7 @@ static void pullwr_run(struct event *t)
                if (pullwr->valid == 0) {
                        /* we made a fill() call above that didn't feed any
                         * data in, and we have nothing more queued, so we go
-                        * into idle, i.e. no calling thread_add_write()
+                        * into idle, i.e. no calling event_add_write()
                         */
                        pullwr_resize(pullwr, 0);
                        return;
@@ -237,7 +237,7 @@ static void pullwr_run(struct event *t)
         * is full and we go wait until it's available for writing again.
         */
 
-       thread_add_write(pullwr->tm, pullwr_run, pullwr, pullwr->fd,
+       event_add_write(pullwr->tm, pullwr_run, pullwr, pullwr->fd,
                        &pullwr->writer);
 
        /* if we hit the time limit, just keep the buffer, we'll probably need
index c455b9bd2a20e5044828d9267f1ce142e60b8435..36bad20f373b905a3e05f59ac1e602833b4edc96 100644 (file)
@@ -113,8 +113,8 @@ static void resolver_cb_socket_readable(struct event *t)
        struct resolver_fd *resfd = THREAD_ARG(t);
        struct resolver_state *r = resfd->state;
 
-       thread_add_read(r->master, resolver_cb_socket_readable, resfd,
-                       resfd->fd, &resfd->t_read);
+       event_add_read(r->master, resolver_cb_socket_readable, resfd, resfd->fd,
+                      &resfd->t_read);
        /* ^ ordering important:
         * ares_process_fd may transitively call THREAD_OFF(resfd->t_read)
         * combined with resolver_fd_drop_maybe, so resfd may be free'd after!
@@ -128,8 +128,8 @@ static void resolver_cb_socket_writable(struct event *t)
        struct resolver_fd *resfd = THREAD_ARG(t);
        struct resolver_state *r = resfd->state;
 
-       thread_add_write(r->master, resolver_cb_socket_writable, resfd,
-                        resfd->fd, &resfd->t_write);
+       event_add_write(r->master, resolver_cb_socket_writable, resfd,
+                       resfd->fd, &resfd->t_write);
        /* ^ ordering important:
         * ares_process_fd may transitively call THREAD_OFF(resfd->t_write)
         * combined with resolver_fd_drop_maybe, so resfd may be free'd after!
@@ -147,8 +147,8 @@ static void resolver_update_timeouts(struct resolver_state *r)
        if (tv) {
                unsigned int timeoutms = tv->tv_sec * 1000 + tv->tv_usec / 1000;
 
-               thread_add_timer_msec(r->master, resolver_cb_timeout, r,
-                                     timeoutms, &r->timeout);
+               event_add_timer_msec(r->master, resolver_cb_timeout, r,
+                                    timeoutms, &r->timeout);
        }
 }
 
@@ -167,14 +167,14 @@ static void ares_socket_cb(void *data, ares_socket_t fd, int readable,
        if (!readable)
                THREAD_OFF(resfd->t_read);
        else if (!resfd->t_read)
-               thread_add_read(r->master, resolver_cb_socket_readable, resfd,
-                               fd, &resfd->t_read);
+               event_add_read(r->master, resolver_cb_socket_readable, resfd,
+                              fd, &resfd->t_read);
 
        if (!writable)
                THREAD_OFF(resfd->t_write);
        else if (!resfd->t_write)
-               thread_add_write(r->master, resolver_cb_socket_writable, resfd,
-                                fd, &resfd->t_write);
+               event_add_write(r->master, resolver_cb_socket_writable, resfd,
+                               fd, &resfd->t_write);
 
        resolver_fd_drop_maybe(resfd);
 }
@@ -264,8 +264,8 @@ void resolver_resolve(struct resolver_query *query, int af, vrf_id_t vrf_id,
                /* for consistency with proper name lookup, don't call the
                 * callback immediately; defer to thread loop
                 */
-               thread_add_timer_msec(state.master, resolver_cb_literal,
-                                     query, 0, &query->literal_cb);
+               event_add_timer_msec(state.master, resolver_cb_literal, query,
+                                    0, &query->literal_cb);
                return;
        }
 
index 40da4f3fce6d73066f449384d2c5557a9252788e..a7900466b885609e4afa86154897f5739989b24b 100644 (file)
@@ -133,8 +133,8 @@ void frr_signal_timer(struct event *t)
 
        sigm = THREAD_ARG(t);
        sigm->t = NULL;
-       thread_add_timer(sigm->t->master, frr_signal_timer, &sigmaster,
-                        FRR_SIGNAL_TIMER_INTERVAL, &sigm->t);
+       event_add_timer(sigm->t->master, frr_signal_timer, &sigmaster,
+                       FRR_SIGNAL_TIMER_INTERVAL, &sigm->t);
        frr_sigevent_process();
 }
 #endif /* SIGEVENT_SCHEDULE_THREAD */
@@ -354,7 +354,7 @@ void signal_init(struct thread_master *m, int sigc,
 
 #ifdef SIGEVENT_SCHEDULE_THREAD
        sigmaster.t = NULL;
-       thread_add_timer(m, frr_signal_timer, &sigmaster,
-                        FRR_SIGNAL_TIMER_INTERVAL, &sigmaster.t);
+       event_add_timer(m, frr_signal_timer, &sigmaster,
+                       FRR_SIGNAL_TIMER_INTERVAL, &sigmaster.t);
 #endif /* SIGEVENT_SCHEDULE_THREAD */
 }
index b77f782ee50d3a8ed0a092f1f84febf8af945d59..f1fb84e0b5a7fcfad1a8866fdb4111d567525d34 100644 (file)
@@ -139,21 +139,21 @@ long spf_backoff_schedule(struct spf_backoff *backoff)
        switch (backoff->state) {
        case SPF_BACKOFF_QUIET:
                backoff->state = SPF_BACKOFF_SHORT_WAIT;
-               thread_add_timer_msec(
+               event_add_timer_msec(
                        backoff->m, spf_backoff_timetolearn_elapsed, backoff,
                        backoff->timetolearn, &backoff->t_timetolearn);
-               thread_add_timer_msec(backoff->m, spf_backoff_holddown_elapsed,
-                                     backoff, backoff->holddown,
-                                     &backoff->t_holddown);
+               event_add_timer_msec(backoff->m, spf_backoff_holddown_elapsed,
+                                    backoff, backoff->holddown,
+                                    &backoff->t_holddown);
                backoff->first_event_time = now;
                rv = backoff->init_delay;
                break;
        case SPF_BACKOFF_SHORT_WAIT:
        case SPF_BACKOFF_LONG_WAIT:
                thread_cancel(&backoff->t_holddown);
-               thread_add_timer_msec(backoff->m, spf_backoff_holddown_elapsed,
-                                     backoff, backoff->holddown,
-                                     &backoff->t_holddown);
+               event_add_timer_msec(backoff->m, spf_backoff_holddown_elapsed,
+                                    backoff, backoff->holddown,
+                                    &backoff->t_holddown);
                if (backoff->state == SPF_BACKOFF_SHORT_WAIT)
                        rv = backoff->short_delay;
                else
index 14a09362dda4edd7c11a64214e4dea5bf417eb8f..5a0668f74f8749b9c10617a4dd75f075682ceb67 100644 (file)
@@ -70,8 +70,8 @@ static void systemd_send_watchdog(struct event *t)
        systemd_send_information("WATCHDOG=1");
 
        assert(watchdog_msec > 0);
-       thread_add_timer_msec(systemd_master, systemd_send_watchdog, NULL,
-                             watchdog_msec, NULL);
+       event_add_timer_msec(systemd_master, systemd_send_watchdog, NULL,
+                            watchdog_msec, NULL);
 }
 
 void systemd_send_started(struct thread_master *m)
index aaf7db0f808de430af1aa26cda29692f4ae465f4..8324878c2870a3f17f7fb0bb1b3404a4ca613b72 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2807,13 +2807,13 @@ static void vty_event_serv(enum vty_event event, struct vty_serv *vty_serv)
 {
        switch (event) {
        case VTY_SERV:
-               thread_add_read(vty_master, vty_accept, vty_serv,
-                               vty_serv->sock, &vty_serv->t_accept);
+               event_add_read(vty_master, vty_accept, vty_serv, vty_serv->sock,
+                              &vty_serv->t_accept);
                break;
 #ifdef VTYSH
        case VTYSH_SERV:
-               thread_add_read(vty_master, vtysh_accept, vty_serv,
-                               vty_serv->sock, &vty_serv->t_accept);
+               event_add_read(vty_master, vtysh_accept, vty_serv,
+                              vty_serv->sock, &vty_serv->t_accept);
                break;
 #endif /* VTYSH */
        case VTY_READ:
@@ -2830,34 +2830,34 @@ static void vty_event(enum vty_event event, struct vty *vty)
        switch (event) {
 #ifdef VTYSH
        case VTYSH_READ:
-               thread_add_read(vty_master, vtysh_read, vty, vty->fd,
-                               &vty->t_read);
+               event_add_read(vty_master, vtysh_read, vty, vty->fd,
+                              &vty->t_read);
                break;
        case VTYSH_WRITE:
-               thread_add_write(vty_master, vtysh_write, vty, vty->wfd,
-                                &vty->t_write);
+               event_add_write(vty_master, vtysh_write, vty, vty->wfd,
+                               &vty->t_write);
                break;
 #endif /* VTYSH */
        case VTY_READ:
-               thread_add_read(vty_master, vty_read, vty, vty->fd,
-                               &vty->t_read);
+               event_add_read(vty_master, vty_read, vty, vty->fd,
+                              &vty->t_read);
 
                /* Time out treatment. */
                if (vty->v_timeout) {
                        THREAD_OFF(vty->t_timeout);
-                       thread_add_timer(vty_master, vty_timeout, vty,
-                                        vty->v_timeout, &vty->t_timeout);
+                       event_add_timer(vty_master, vty_timeout, vty,
+                                       vty->v_timeout, &vty->t_timeout);
                }
                break;
        case VTY_WRITE:
-               thread_add_write(vty_master, vty_flush, vty, vty->wfd,
-                                &vty->t_write);
+               event_add_write(vty_master, vty_flush, vty, vty->wfd,
+                               &vty->t_write);
                break;
        case VTY_TIMEOUT_RESET:
                THREAD_OFF(vty->t_timeout);
                if (vty->v_timeout)
-                       thread_add_timer(vty_master, vty_timeout, vty,
-                                        vty->v_timeout, &vty->t_timeout);
+                       event_add_timer(vty_master, vty_timeout, vty,
+                                       vty->v_timeout, &vty->t_timeout);
                break;
        case VTY_SERV:
        case VTYSH_SERV:
index 363b27ab13568880b44cff37e908bf521f89d975..27e087efc6b5c5f8c7fe8a6146e7d888379d9072 100644 (file)
@@ -47,8 +47,8 @@ static void wheel_timer_thread_helper(struct event *t)
                slots_to_skip++;
 
        wheel->slots_to_skip = slots_to_skip;
-       thread_add_timer_msec(wheel->master, wheel_timer_thread, wheel,
-                             wheel->nexttime * slots_to_skip, &wheel->timer);
+       event_add_timer_msec(wheel->master, wheel_timer_thread, wheel,
+                            wheel->nexttime * slots_to_skip, &wheel->timer);
 }
 
 static void wheel_timer_thread(struct event *t)
@@ -85,8 +85,8 @@ struct timer_wheel *wheel_init(struct thread_master *master, int period,
        for (i = 0; i < slots; i++)
                wheel->wheel_slot_lists[i] = list_new();
 
-       thread_add_timer_msec(wheel->master, wheel_timer_thread, wheel,
-                             wheel->nexttime, &wheel->timer);
+       event_add_timer_msec(wheel->master, wheel_timer_thread, wheel,
+                            wheel->nexttime, &wheel->timer);
 
        return wheel;
 }
index 50a0ad388cf4d4b83bd1075bb1f88b649e848744..4a8084bbc68f16b4bde3e30ffa64e8d4e522ae15 100644 (file)
@@ -118,12 +118,12 @@ static int work_queue_schedule(struct work_queue *wq, unsigned int delay)
                 * as an 'event'
                 */
                if (delay > 0) {
-                       thread_add_timer_msec(wq->master, work_queue_run, wq,
-                                             delay, &wq->thread);
+                       event_add_timer_msec(wq->master, work_queue_run, wq,
+                                            delay, &wq->thread);
                        thread_ignore_late_timer(wq->thread);
                } else
-                       thread_add_event(wq->master, work_queue_run, wq, 0,
-                                        &wq->thread);
+                       event_add_event(wq->master, work_queue_run, wq, 0,
+                                       &wq->thread);
 
                /* set thread yield time, if needed */
                if (thread_is_scheduled(wq->thread) &&
index bb5d66df5dc7423ba14b972a551f5a6f5f8e5559..bd8a53d3369d16e0bb9692556b8dbea2d969ecdd 100644 (file)
@@ -266,8 +266,8 @@ static void zclient_flush_data(struct event *thread)
                return;
        case BUFFER_PENDING:
                zclient->t_write = NULL;
-               thread_add_write(zclient->master, zclient_flush_data, zclient,
-                                zclient->sock, &zclient->t_write);
+               event_add_write(zclient->master, zclient_flush_data, zclient,
+                               zclient->sock, &zclient->t_write);
                break;
        case BUFFER_EMPTY:
                if (zclient->zebra_buffer_write_ready)
@@ -298,8 +298,8 @@ enum zclient_send_status zclient_send_message(struct zclient *zclient)
                THREAD_OFF(zclient->t_write);
                return ZCLIENT_SEND_SUCCESS;
        case BUFFER_PENDING:
-               thread_add_write(zclient->master, zclient_flush_data, zclient,
-                                zclient->sock, &zclient->t_write);
+               event_add_write(zclient->master, zclient_flush_data, zclient,
+                               zclient->sock, &zclient->t_write);
                return ZCLIENT_SEND_BUFFERED;
        }
 
@@ -4204,22 +4204,22 @@ static void zclient_event(enum zclient_event event, struct zclient *zclient)
 {
        switch (event) {
        case ZCLIENT_SCHEDULE:
-               thread_add_event(zclient->master, zclient_connect, zclient, 0,
-                                &zclient->t_connect);
+               event_add_event(zclient->master, zclient_connect, zclient, 0,
+                               &zclient->t_connect);
                break;
        case ZCLIENT_CONNECT:
                if (zclient_debug)
                        zlog_debug(
                                "zclient connect failures: %d schedule interval is now %d",
                                zclient->fail, zclient->fail < 3 ? 10 : 60);
-               thread_add_timer(zclient->master, zclient_connect, zclient,
-                                zclient->fail < 3 ? 10 : 60,
-                                &zclient->t_connect);
+               event_add_timer(zclient->master, zclient_connect, zclient,
+                               zclient->fail < 3 ? 10 : 60,
+                               &zclient->t_connect);
                break;
        case ZCLIENT_READ:
                zclient->t_read = NULL;
-               thread_add_read(zclient->master, zclient_read, zclient,
-                               zclient->sock, &zclient->t_read);
+               event_add_read(zclient->master, zclient_read, zclient,
+                              zclient->sock, &zclient->t_read);
                break;
        }
 }
index 14b6396b84ec6e9c5de3a4c7d8fba4bf13aec933..7bfc89bb22dc1f5c792adb9633fa9131579a9d13 100644 (file)
@@ -800,8 +800,8 @@ static void zlog_5424_reconnect(struct event *t)
                ret = read(fd, dummy, sizeof(dummy));
                if (ret > 0) {
                        /* logger is sending us something?!?! */
-                       thread_add_read(t->master, zlog_5424_reconnect, zcf, fd,
-                                       &zcf->t_reconnect);
+                       event_add_read(t->master, zlog_5424_reconnect, zcf, fd,
+                                      &zcf->t_reconnect);
                        return;
                }
 
@@ -1030,14 +1030,14 @@ static int zlog_5424_open(struct zlog_cfg_5424 *zcf, int sock_type)
                assert(zcf->master);
 
                if (fd != -1) {
-                       thread_add_read(zcf->master, zlog_5424_reconnect, zcf,
-                                       fd, &zcf->t_reconnect);
+                       event_add_read(zcf->master, zlog_5424_reconnect, zcf,
+                                      fd, &zcf->t_reconnect);
                        zcf->reconn_backoff_cur = zcf->reconn_backoff;
 
                } else {
-                       thread_add_timer_msec(zcf->master, zlog_5424_reconnect,
-                                             zcf, zcf->reconn_backoff_cur,
-                                             &zcf->t_reconnect);
+                       event_add_timer_msec(zcf->master, zlog_5424_reconnect,
+                                            zcf, zcf->reconn_backoff_cur,
+                                            &zcf->t_reconnect);
 
                        zcf->reconn_backoff_cur += zcf->reconn_backoff_cur / 2;
                        if (zcf->reconn_backoff_cur > zcf->reconn_backoff_max)
index c1a9fadb4bb98039d0a405d16153c4674048b51d..66184ad2fc83774a9e7d58680e1654dd211cac34 100644 (file)
@@ -733,14 +733,14 @@ mgmt_be_adapter_register_event(struct mgmt_be_client_adapter *adapter,
 
        switch (event) {
        case MGMTD_BE_CONN_INIT:
-               thread_add_timer_msec(mgmt_be_adapter_tm,
+               event_add_timer_msec(mgmt_be_adapter_tm,
                                      mgmt_be_adapter_conn_init, adapter,
                                      MGMTD_BE_CONN_INIT_DELAY_MSEC,
                                      &adapter->conn_init_ev);
                assert(adapter->conn_init_ev);
                break;
        case MGMTD_BE_CONN_READ:
-               thread_add_read(mgmt_be_adapter_tm, mgmt_be_adapter_read,
+               event_add_read(mgmt_be_adapter_tm, mgmt_be_adapter_read,
                                adapter, adapter->conn_fd, &adapter->conn_read_ev);
                assert(adapter->conn_read_ev);
                break;
@@ -753,19 +753,19 @@ mgmt_be_adapter_register_event(struct mgmt_be_client_adapter *adapter,
                        MGMTD_BE_ADAPTER_DBG(
                                "scheduling write ready notify for client %s",
                                adapter->name);
-               thread_add_write(mgmt_be_adapter_tm, mgmt_be_adapter_write,
+               event_add_write(mgmt_be_adapter_tm, mgmt_be_adapter_write,
                                 adapter, adapter->conn_fd, &adapter->conn_write_ev);
                assert(adapter->conn_write_ev);
                break;
        case MGMTD_BE_PROC_MSG:
                tv.tv_usec = MGMTD_BE_MSG_PROC_DELAY_USEC;
-               thread_add_timer_tv(mgmt_be_adapter_tm,
+               event_add_timer_tv(mgmt_be_adapter_tm,
                                    mgmt_be_adapter_proc_msgbufs, adapter, &tv,
                                    &adapter->proc_msg_ev);
                assert(adapter->proc_msg_ev);
                break;
        case MGMTD_BE_CONN_WRITES_ON:
-               thread_add_timer_msec(mgmt_be_adapter_tm,
+               event_add_timer_msec(mgmt_be_adapter_tm,
                                      mgmt_be_adapter_resume_writes, adapter,
                                      MGMTD_BE_MSG_WRITE_DELAY_MSEC,
                                      &adapter->conn_writes_on);
index 1fcc6bd6a1efa972eb6f9f5209cbb899bde2974b..083e8299ffcffa07aa402c1049b49be40724d64e 100644 (file)
@@ -65,7 +65,7 @@ static void mgmt_be_conn_accept(struct event *thread)
 static void mgmt_be_server_register_event(enum mgmt_be_event event)
 {
        if (event == MGMTD_BE_SERVER) {
-               thread_add_read(mgmt_be_listen_tm, mgmt_be_conn_accept,
+               event_add_read(mgmt_be_listen_tm, mgmt_be_conn_accept,
                                NULL, mgmt_be_listen_fd,
                                &mgmt_be_listen_ev);
                assert(mgmt_be_listen_ev);
index eaa50367cb488485f67871b0176c3bcbf5fed1a1..5c6258dc69bc80aa2f0e2bbe4c4e1b6d83effcc2 100644 (file)
@@ -656,13 +656,13 @@ mgmt_fe_session_register_event(struct mgmt_fe_session_ctx *session,
 
        switch (event) {
        case MGMTD_FE_SESSION_CFG_TXN_CLNUP:
-               thread_add_timer_tv(mgmt_fe_adapter_tm,
+               event_add_timer_tv(mgmt_fe_adapter_tm,
                                    mgmt_fe_session_cfg_txn_clnup, session,
                                    &tv, &session->proc_cfg_txn_clnp);
                assert(session->proc_cfg_txn_clnp);
                break;
        case MGMTD_FE_SESSION_SHOW_TXN_CLNUP:
-               thread_add_timer_tv(mgmt_fe_adapter_tm,
+               event_add_timer_tv(mgmt_fe_adapter_tm,
                                    mgmt_fe_session_show_txn_clnup, session,
                                    &tv, &session->proc_show_txn_clnp);
                assert(session->proc_show_txn_clnp);
@@ -1495,25 +1495,25 @@ mgmt_fe_adapter_register_event(struct mgmt_fe_client_adapter *adapter,
 
        switch (event) {
        case MGMTD_FE_CONN_READ:
-               thread_add_read(mgmt_fe_adapter_tm, mgmt_fe_adapter_read,
+               event_add_read(mgmt_fe_adapter_tm, mgmt_fe_adapter_read,
                                adapter, adapter->conn_fd, &adapter->conn_read_ev);
                assert(adapter->conn_read_ev);
                break;
        case MGMTD_FE_CONN_WRITE:
-               thread_add_write(mgmt_fe_adapter_tm,
+               event_add_write(mgmt_fe_adapter_tm,
                                 mgmt_fe_adapter_write, adapter,
                                 adapter->conn_fd, &adapter->conn_write_ev);
                assert(adapter->conn_write_ev);
                break;
        case MGMTD_FE_PROC_MSG:
                tv.tv_usec = MGMTD_FE_MSG_PROC_DELAY_USEC;
-               thread_add_timer_tv(mgmt_fe_adapter_tm,
+               event_add_timer_tv(mgmt_fe_adapter_tm,
                                    mgmt_fe_adapter_proc_msgbufs, adapter,
                                    &tv, &adapter->proc_msg_ev);
                assert(adapter->proc_msg_ev);
                break;
        case MGMTD_FE_CONN_WRITES_ON:
-               thread_add_timer_msec(mgmt_fe_adapter_tm,
+               event_add_timer_msec(mgmt_fe_adapter_tm,
                                      mgmt_fe_adapter_resume_writes, adapter,
                                      MGMTD_FE_MSG_WRITE_DELAY_MSEC,
                                      &adapter->conn_writes_on);
index 6996070fa3d7e4767fcebb4951d378565e815192..2d576663db0d3e0711a0f22aea8287ec1d292441 100644 (file)
@@ -65,7 +65,7 @@ static void mgmt_fe_conn_accept(struct event *thread)
 static void mgmt_fe_server_register_event(enum mgmt_fe_event event)
 {
        if (event == MGMTD_FE_SERVER) {
-               thread_add_read(mgmt_fe_listen_tm, mgmt_fe_conn_accept,
+               event_add_read(mgmt_fe_listen_tm, mgmt_fe_conn_accept,
                                NULL, mgmt_fe_listen_fd,
                                &mgmt_fe_listen_ev);
                assert(mgmt_fe_listen_ev);
index bbc210614fdfb2dc9752755870bf10f1fe28649c..2610d7e85f95e9ad2f47b4cfa3b8d07b28da7a84 100644 (file)
@@ -2226,27 +2226,27 @@ static void mgmt_txn_register_event(struct mgmt_txn_ctx *txn,
 
        switch (event) {
        case MGMTD_TXN_PROC_SETCFG:
-               thread_add_timer_tv(mgmt_txn_tm, mgmt_txn_process_set_cfg,
+               event_add_timer_tv(mgmt_txn_tm, mgmt_txn_process_set_cfg,
                                    txn, &tv, &txn->proc_set_cfg);
                assert(txn->proc_set_cfg);
                break;
        case MGMTD_TXN_PROC_COMMITCFG:
-               thread_add_timer_tv(mgmt_txn_tm, mgmt_txn_process_commit_cfg,
+               event_add_timer_tv(mgmt_txn_tm, mgmt_txn_process_commit_cfg,
                                    txn, &tv, &txn->proc_comm_cfg);
                assert(txn->proc_comm_cfg);
                break;
        case MGMTD_TXN_PROC_GETCFG:
-               thread_add_timer_tv(mgmt_txn_tm, mgmt_txn_process_get_cfg,
+               event_add_timer_tv(mgmt_txn_tm, mgmt_txn_process_get_cfg,
                                    txn, &tv, &txn->proc_get_cfg);
                assert(txn->proc_get_cfg);
                break;
        case MGMTD_TXN_PROC_GETDATA:
-               thread_add_timer_tv(mgmt_txn_tm, mgmt_txn_process_get_data,
+               event_add_timer_tv(mgmt_txn_tm, mgmt_txn_process_get_data,
                                    txn, &tv, &txn->proc_get_data);
                assert(txn->proc_get_data);
                break;
        case MGMTD_TXN_COMMITCFG_TIMEOUT:
-               thread_add_timer_msec(mgmt_txn_tm,
+               event_add_timer_msec(mgmt_txn_tm,
                                      mgmt_txn_cfg_commit_timedout, txn,
                                      MGMTD_TXN_CFG_COMMIT_MAX_DELAY_MSEC,
                                      &txn->comm_cfg_timeout);
@@ -2254,7 +2254,7 @@ static void mgmt_txn_register_event(struct mgmt_txn_ctx *txn,
                break;
        case MGMTD_TXN_CLEANUP:
                tv.tv_usec = MGMTD_TXN_CLEANUP_DELAY_USEC;
-               thread_add_timer_tv(mgmt_txn_tm, mgmt_txn_cleanup, txn, &tv,
+               event_add_timer_tv(mgmt_txn_tm, mgmt_txn_cleanup, txn, &tv,
                                    &txn->clnup);
                assert(txn->clnup);
        }
index 485aae74222bec08313c5f074e2b650e12e34ee7..746cac044dbcb8ce19744e63a8d20756e00e35a5 100644 (file)
@@ -118,8 +118,8 @@ static void netlink_log_recv(struct event *t)
                }
        }
 
-       thread_add_read(master, netlink_log_recv, 0, netlink_log_fd,
-                       &netlink_log_thread);
+       event_add_read(master, netlink_log_recv, 0, netlink_log_fd,
+                      &netlink_log_thread);
 }
 
 void netlink_set_nflog_group(int nlgroup)
@@ -136,8 +136,8 @@ void netlink_set_nflog_group(int nlgroup)
                        return;
 
                netlink_log_register(netlink_log_fd, nlgroup);
-               thread_add_read(master, netlink_log_recv, 0, netlink_log_fd,
-                               &netlink_log_thread);
+               event_add_read(master, netlink_log_recv, 0, netlink_log_fd,
+                              &netlink_log_thread);
        }
 }
 
index cb50dd52d94fd54a4da108f0dd59ebcafa178735..8bc44f9474124af0e4d7d5526face0853b030c14 100644 (file)
@@ -325,8 +325,8 @@ static void nhrp_cache_update_timers(struct nhrp_cache *c)
        switch (c->cur.type) {
        case NHRP_CACHE_INVALID:
                if (!c->t_auth)
-                       thread_add_timer_msec(master, nhrp_cache_do_free, c, 10,
-                                             &c->t_timeout);
+                       event_add_timer_msec(master, nhrp_cache_do_free, c, 10,
+                                            &c->t_timeout);
                break;
        case NHRP_CACHE_INCOMPLETE:
        case NHRP_CACHE_NEGATIVE:
@@ -337,9 +337,9 @@ static void nhrp_cache_update_timers(struct nhrp_cache *c)
        case NHRP_CACHE_LOCAL:
        case NHRP_CACHE_NUM_TYPES:
                if (c->cur.expires)
-                       thread_add_timer(master, nhrp_cache_do_timeout, c,
-                                        c->cur.expires - monotime(NULL),
-                                        &c->t_timeout);
+                       event_add_timer(master, nhrp_cache_do_timeout, c,
+                                       c->cur.expires - monotime(NULL),
+                                       &c->t_timeout);
                break;
        }
 }
@@ -413,8 +413,8 @@ static void nhrp_cache_newpeer_notifier(struct notifier_block *n,
                if (nhrp_peer_check(c->new.peer, 1)) {
                        evmgr_notify("authorize-binding", c,
                                     nhrp_cache_authorize_binding);
-                       thread_add_timer(master, nhrp_cache_do_auth_timeout, c,
-                                        10, &c->t_auth);
+                       event_add_timer(master, nhrp_cache_do_auth_timeout, c,
+                                       10, &c->t_auth);
                }
                break;
        case NOTIFY_PEER_DOWN:
@@ -506,8 +506,8 @@ int nhrp_cache_update_binding(struct nhrp_cache *c, enum nhrp_cache_type type,
                                             nhrp_cache_newpeer_notifier);
                        nhrp_cache_newpeer_notifier(&c->newpeer_notifier,
                                                    NOTIFY_PEER_UP);
-                       thread_add_timer(master, nhrp_cache_do_auth_timeout, c,
-                                        60, &c->t_auth);
+                       event_add_timer(master, nhrp_cache_do_auth_timeout, c,
+                                       60, &c->t_auth);
                }
        }
        nhrp_cache_update_timers(c);
index ad98da9baa0b4f344253997aca3a9e4e1014610c..3bcd42691b99352939189393cb986bcec08f9fbf 100644 (file)
@@ -40,8 +40,8 @@ static void evmgr_connection_error(struct event_manager *evmgr)
                close(evmgr->fd);
        evmgr->fd = -1;
        if (nhrp_event_socket_path)
-               thread_add_timer_msec(master, evmgr_reconnect, evmgr, 10,
-                                     &evmgr->t_reconnect);
+               event_add_timer_msec(master, evmgr_reconnect, evmgr, 10,
+                                    &evmgr->t_reconnect);
 }
 
 static void evmgr_recv_message(struct event_manager *evmgr, struct zbuf *zb)
@@ -89,7 +89,7 @@ static void evmgr_read(struct event *t)
        while (zbuf_may_pull_until(ibuf, "\n\n", &msg))
                evmgr_recv_message(evmgr, &msg);
 
-       thread_add_read(master, evmgr_read, evmgr, evmgr->fd, &evmgr->t_read);
+       event_add_read(master, evmgr_read, evmgr, evmgr->fd, &evmgr->t_read);
 }
 
 static void evmgr_write(struct event *t)
@@ -99,8 +99,8 @@ static void evmgr_write(struct event *t)
 
        r = zbufq_write(&evmgr->obuf, evmgr->fd);
        if (r > 0) {
-               thread_add_write(master, evmgr_write, evmgr, evmgr->fd,
-                                &evmgr->t_write);
+               event_add_write(master, evmgr_write, evmgr, evmgr->fd,
+                               &evmgr->t_write);
        } else if (r < 0) {
                evmgr_connection_error(evmgr);
        }
@@ -175,8 +175,8 @@ static void evmgr_submit(struct event_manager *evmgr, struct zbuf *obuf)
        zbuf_put(obuf, "\n", 1);
        zbufq_queue(&evmgr->obuf, obuf);
        if (evmgr->fd >= 0)
-               thread_add_write(master, evmgr_write, evmgr, evmgr->fd,
-                                &evmgr->t_write);
+               event_add_write(master, evmgr_write, evmgr, evmgr->fd,
+                               &evmgr->t_write);
 }
 
 static void evmgr_reconnect(struct event *t)
@@ -192,14 +192,14 @@ static void evmgr_reconnect(struct event *t)
                zlog_warn("%s: failure connecting nhrp-event socket: %s",
                          __func__, strerror(errno));
                zbufq_reset(&evmgr->obuf);
-               thread_add_timer(master, evmgr_reconnect, evmgr, 10,
-                                &evmgr->t_reconnect);
+               event_add_timer(master, evmgr_reconnect, evmgr, 10,
+                               &evmgr->t_reconnect);
                return;
        }
 
        zlog_info("Connected to Event Manager");
        evmgr->fd = fd;
-       thread_add_read(master, evmgr_read, evmgr, evmgr->fd, &evmgr->t_read);
+       event_add_read(master, evmgr_read, evmgr, evmgr->fd, &evmgr->t_read);
 }
 
 static struct event_manager evmgr_connection;
@@ -211,8 +211,8 @@ void evmgr_init(void)
        evmgr->fd = -1;
        zbuf_init(&evmgr->ibuf, evmgr->ibuf_data, sizeof(evmgr->ibuf_data), 0);
        zbufq_init(&evmgr->obuf);
-       thread_add_timer_msec(master, evmgr_reconnect, evmgr, 10,
-                             &evmgr->t_reconnect);
+       event_add_timer_msec(master, evmgr_reconnect, evmgr, 10,
+                            &evmgr->t_reconnect);
 }
 
 void evmgr_set_socket(const char *socket)
index db85d550c2108bccbff5e2d16c41092688689221..759dbd1b9276388d0e0f32660014e0057d65621a 100644 (file)
@@ -160,8 +160,8 @@ static void netlink_mcast_log_recv(struct event *t)
                }
        }
 
-       thread_add_read(master, netlink_mcast_log_recv, 0, netlink_mcast_log_fd,
-                       &netlink_mcast_log_thread);
+       event_add_read(master, netlink_mcast_log_recv, 0, netlink_mcast_log_fd,
+                      &netlink_mcast_log_thread);
 }
 
 static void netlink_mcast_log_register(int fd, int group)
@@ -202,9 +202,8 @@ void netlink_mcast_set_nflog_group(int nlgroup)
                        return;
 
                netlink_mcast_log_register(netlink_mcast_log_fd, nlgroup);
-               thread_add_read(master, netlink_mcast_log_recv, 0,
-                               netlink_mcast_log_fd,
-                               &netlink_mcast_log_thread);
+               event_add_read(master, netlink_mcast_log_recv, 0,
+                              netlink_mcast_log_fd, &netlink_mcast_log_thread);
                debugf(NHRP_DEBUG_COMMON, "Register nflog group: %d",
                       netlink_mcast_nflog_group);
        }
index c6a6b8e75db2f1f7419278b52e863c0993439740..9ffb0c095f998a5bf386843bb8d69b1de5b3bb57 100644 (file)
@@ -92,8 +92,8 @@ static void nhrp_reg_reply(struct nhrp_reqid *reqid, void *arg)
 
        /* RFC 2332 5.2.3 - Registration is recommend to be renewed
         * every one third of holdtime */
-       thread_add_timer(master, nhrp_reg_send_req, r, holdtime / 3,
-                        &r->t_register);
+       event_add_timer(master, nhrp_reg_send_req, r, holdtime / 3,
+                       &r->t_register);
 
        r->proto_addr = p->dst_proto;
        c = nhrp_cache_get(ifp, &p->dst_proto, 1);
@@ -133,7 +133,7 @@ static void nhrp_reg_timeout(struct event *t)
                }
                r->timeout = 2;
        }
-       thread_add_timer_msec(master, nhrp_reg_send_req, r, 10, &r->t_register);
+       event_add_timer_msec(master, nhrp_reg_send_req, r, 10, &r->t_register);
 }
 
 static void nhrp_reg_peer_notify(struct notifier_block *n, unsigned long cmd)
@@ -149,8 +149,8 @@ static void nhrp_reg_peer_notify(struct notifier_block *n, unsigned long cmd)
                debugf(NHRP_DEBUG_COMMON, "NHS: Flush timer for %pSU",
                       &r->peer->vc->remote.nbma);
                THREAD_OFF(r->t_register);
-               thread_add_timer_msec(master, nhrp_reg_send_req, r, 10,
-                                     &r->t_register);
+               event_add_timer_msec(master, nhrp_reg_send_req, r, 10,
+                                    &r->t_register);
                break;
        }
 }
@@ -171,13 +171,13 @@ static void nhrp_reg_send_req(struct event *t)
        if (!nhrp_peer_check(r->peer, 2)) {
                debugf(NHRP_DEBUG_COMMON, "NHS: Waiting link for %pSU",
                       &r->peer->vc->remote.nbma);
-               thread_add_timer(master, nhrp_reg_send_req, r, 120,
-                                &r->t_register);
+               event_add_timer(master, nhrp_reg_send_req, r, 120,
+                               &r->t_register);
                return;
        }
 
-       thread_add_timer(master, nhrp_reg_timeout, r, r->timeout,
-                        &r->t_register);
+       event_add_timer(master, nhrp_reg_timeout, r, r->timeout,
+                       &r->t_register);
 
        /* RFC2332 5.2.3 NHC uses it's own address as dst if NHS is unknown */
        dst_proto = &nhs->proto_addr;
@@ -269,13 +269,13 @@ static void nhrp_nhs_resolve_cb(struct resolver_query *q, const char *errstr,
 
        if (n < 0) {
                /* Failed, retry in a moment */
-               thread_add_timer(master, nhrp_nhs_resolve, nhs, 5,
-                                &nhs->t_resolve);
+               event_add_timer(master, nhrp_nhs_resolve, nhs, 5,
+                               &nhs->t_resolve);
                return;
        }
 
-       thread_add_timer(master, nhrp_nhs_resolve, nhs, 2 * 60 * 60,
-                        &nhs->t_resolve);
+       event_add_timer(master, nhrp_nhs_resolve, nhs, 2 * 60 * 60,
+                       &nhs->t_resolve);
 
        frr_each (nhrp_reglist, &nhs->reglist_head, reg)
                reg->mark = 1;
@@ -300,8 +300,8 @@ static void nhrp_nhs_resolve_cb(struct resolver_query *q, const char *errstr,
                nhrp_reglist_add_tail(&nhs->reglist_head, reg);
                nhrp_peer_notify_add(reg->peer, &reg->peer_notifier,
                                     nhrp_reg_peer_notify);
-               thread_add_timer_msec(master, nhrp_reg_send_req, reg, 50,
-                                     &reg->t_register);
+               event_add_timer_msec(master, nhrp_reg_send_req, reg, 50,
+                                    &reg->t_register);
        }
 
        frr_each_safe (nhrp_reglist, &nhs->reglist_head, reg)
@@ -347,8 +347,8 @@ int nhrp_nhs_add(struct interface *ifp, afi_t afi, union sockunion *proto_addr,
                .reglist_head = INIT_DLIST(nhs->reglist_head),
        };
        nhrp_nhslist_add_tail(&nifp->afi[afi].nhslist_head, nhs);
-       thread_add_timer_msec(master, nhrp_nhs_resolve, nhs, 1000,
-                             &nhs->t_resolve);
+       event_add_timer_msec(master, nhrp_nhs_resolve, nhs, 1000,
+                            &nhs->t_resolve);
 
        return NHRP_OK;
 }
index 650b3ab8755c0dcbb95b77152e1b4700d638e90c..6502cff51e1e467389774b3effc1d7169fbae759 100644 (file)
@@ -296,7 +296,7 @@ static void nhrp_packet_recvraw(struct event *t)
        uint8_t addr[64];
        size_t len, addrlen;
 
-       thread_add_read(master, nhrp_packet_recvraw, 0, fd, NULL);
+       event_add_read(master, nhrp_packet_recvraw, 0, fd, NULL);
 
        zb = zbuf_alloc(1500);
        if (!zb)
@@ -336,6 +336,6 @@ err:
 
 int nhrp_packet_init(void)
 {
-       thread_add_read(master, nhrp_packet_recvraw, 0, os_socket(), NULL);
+       event_add_read(master, nhrp_packet_recvraw, 0, os_socket(), NULL);
        return 0;
 }
index 95694a41fd85110cbf7bb8abafb0d8db2d298d1a..9ca7b8441c3b0e097de26935b5be86816253d1e3 100644 (file)
@@ -82,8 +82,8 @@ static void __nhrp_peer_check(struct nhrp_peer *p)
                         * the up notification a bit to allow things
                         * settle down. This allows IKE to install
                         * SPDs and SAs. */
-                       thread_add_timer_msec(master, nhrp_peer_notify_up, p,
-                                             50, &p->t_fallback);
+                       event_add_timer_msec(master, nhrp_peer_notify_up, p, 50,
+                                            &p->t_fallback);
                } else {
                        nhrp_peer_ref(p);
                        p->online = online;
@@ -264,8 +264,8 @@ static void nhrp_peer_request_timeout(struct event *t)
                p->fallback_requested = 1;
                vici_request_vc(nifp->ipsec_fallback_profile, &vc->local.nbma,
                                &vc->remote.nbma, p->prio);
-               thread_add_timer(master, nhrp_peer_request_timeout, p, 30,
-                                &p->t_fallback);
+               event_add_timer(master, nhrp_peer_request_timeout, p, 30,
+                               &p->t_fallback);
        } else {
                p->requested = p->fallback_requested = 0;
        }
@@ -287,10 +287,10 @@ static void nhrp_peer_defer_vici_request(struct event *t)
        } else {
                vici_request_vc(nifp->ipsec_profile, &vc->local.nbma,
                                &vc->remote.nbma, p->prio);
-               thread_add_timer(
-                       master, nhrp_peer_request_timeout, p,
-                       (nifp->ipsec_fallback_profile && !p->prio) ? 15 : 30,
-                       &p->t_fallback);
+               event_add_timer(master, nhrp_peer_request_timeout, p,
+                               (nifp->ipsec_fallback_profile && !p->prio) ? 15
+                                                                          : 30,
+                               &p->t_fallback);
        }
 }
 
@@ -320,10 +320,10 @@ int nhrp_peer_check(struct nhrp_peer *p, int establish)
        if (p->prio) {
                vici_request_vc(nifp->ipsec_profile, &vc->local.nbma,
                                &vc->remote.nbma, p->prio);
-               thread_add_timer(
-                       master, nhrp_peer_request_timeout, p,
-                       (nifp->ipsec_fallback_profile && !p->prio) ? 15 : 30,
-                       &p->t_fallback);
+               event_add_timer(master, nhrp_peer_request_timeout, p,
+                               (nifp->ipsec_fallback_profile && !p->prio) ? 15
+                                                                          : 30,
+                               &p->t_fallback);
        } else {
                /* Maximum timeout is 1 second */
                int r_time_ms = frr_weak_random() % 1000;
@@ -331,8 +331,8 @@ int nhrp_peer_check(struct nhrp_peer *p, int establish)
                debugf(NHRP_DEBUG_COMMON,
                       "Initiating IPsec connection request to %pSU after %d ms:",
                       &vc->remote.nbma, r_time_ms);
-               thread_add_timer_msec(master, nhrp_peer_defer_vici_request,
-                                     p, r_time_ms, &p->t_timer);
+               event_add_timer_msec(master, nhrp_peer_defer_vici_request, p,
+                                    r_time_ms, &p->t_timer);
        }
 
        return 0;
index b1e2b7cea4478eefd57fb2408e7f170922da883d..838fac7528185fd5b1c61cce6f745700f6f80a4d 100644 (file)
@@ -35,8 +35,8 @@ static void nhrp_shortcut_do_expire(struct event *t)
 {
        struct nhrp_shortcut *s = THREAD_ARG(t);
 
-       thread_add_timer(master, nhrp_shortcut_do_purge, s, s->holding_time / 3,
-                        &s->t_timer);
+       event_add_timer(master, nhrp_shortcut_do_purge, s, s->holding_time / 3,
+                       &s->t_timer);
        s->expiring = 1;
        nhrp_shortcut_check_use(s);
 }
@@ -127,8 +127,8 @@ static void nhrp_shortcut_update_binding(struct nhrp_shortcut *s,
        if (holding_time) {
                s->expiring = 0;
                s->holding_time = holding_time;
-               thread_add_timer(master, nhrp_shortcut_do_expire, s,
-                                2 * holding_time / 3, &s->t_timer);
+               event_add_timer(master, nhrp_shortcut_do_expire, s,
+                               2 * holding_time / 3, &s->t_timer);
        }
 }
 
@@ -205,7 +205,7 @@ static void nhrp_shortcut_recv_resolution_rep(struct nhrp_reqid *reqid,
 
        nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid);
        THREAD_OFF(s->t_timer);
-       thread_add_timer(master, nhrp_shortcut_do_purge, s, 1, &s->t_timer);
+       event_add_timer(master, nhrp_shortcut_do_purge, s, 1, &s->t_timer);
 
        if (pp->hdr->type != NHRP_PACKET_RESOLUTION_REPLY) {
                if (pp->hdr->type == NHRP_PACKET_ERROR_INDICATION
@@ -455,8 +455,8 @@ void nhrp_shortcut_initiate(union sockunion *addr)
        if (s && s->type != NHRP_CACHE_INCOMPLETE) {
                s->addr = *addr;
                THREAD_OFF(s->t_timer);
-               thread_add_timer(master, nhrp_shortcut_do_purge, s, 30,
-                                &s->t_timer);
+               event_add_timer(master, nhrp_shortcut_do_purge, s, 30,
+                               &s->t_timer);
                nhrp_shortcut_send_resolution_req(s);
        }
 }
@@ -504,8 +504,8 @@ void nhrp_shortcut_purge(struct nhrp_shortcut *s, int force)
 
        if (force) {
                /* Immediate purge on route with draw or pending shortcut */
-               thread_add_timer_msec(master, nhrp_shortcut_do_purge, s, 5,
-                                     &s->t_timer);
+               event_add_timer_msec(master, nhrp_shortcut_do_purge, s, 5,
+                                    &s->t_timer);
        } else {
                /* Soft expire - force immediate renewal, but purge
                 * in few seconds to make sure stale route is not
@@ -514,8 +514,8 @@ void nhrp_shortcut_purge(struct nhrp_shortcut *s, int force)
                 * This allows to keep nhrp route up, and to not
                 * cause temporary rerouting via hubs causing latency
                 * jitter. */
-               thread_add_timer_msec(master, nhrp_shortcut_do_purge, s, 3000,
-                                     &s->t_timer);
+               event_add_timer_msec(master, nhrp_shortcut_do_purge, s, 3000,
+                                    &s->t_timer);
                s->expiring = 1;
                nhrp_shortcut_check_use(s);
        }
index 02e36d2e6ae763874248c076d4de0bc1e6225aea..67a7877b6d7d2591baf3dff9f4e8414542fdae34 100644 (file)
@@ -77,7 +77,7 @@ static void vici_connection_error(struct vici_conn *vici)
 
        close(vici->fd);
        vici->fd = -1;
-       thread_add_timer(master, vici_reconnect, vici, 2, &vici->t_reconnect);
+       event_add_timer(master, vici_reconnect, vici, 2, &vici->t_reconnect);
 }
 
 static void vici_parse_message(struct vici_conn *vici, struct zbuf *msg,
@@ -384,7 +384,7 @@ static void vici_read(struct event *t)
                vici_recv_message(vici, &pktbuf);
        } while (1);
 
-       thread_add_read(master, vici_read, vici, vici->fd, &vici->t_read);
+       event_add_read(master, vici_read, vici, vici->fd, &vici->t_read);
 }
 
 static void vici_write(struct event *t)
@@ -394,8 +394,8 @@ static void vici_write(struct event *t)
 
        r = zbufq_write(&vici->obuf, vici->fd);
        if (r > 0) {
-               thread_add_write(master, vici_write, vici, vici->fd,
-                                &vici->t_write);
+               event_add_write(master, vici_write, vici, vici->fd,
+                               &vici->t_write);
        } else if (r < 0) {
                vici_connection_error(vici);
        }
@@ -409,7 +409,7 @@ static void vici_submit(struct vici_conn *vici, struct zbuf *obuf)
        }
 
        zbufq_queue(&vici->obuf, obuf);
-       thread_add_write(master, vici_write, vici, vici->fd, &vici->t_write);
+       event_add_write(master, vici_write, vici, vici->fd, &vici->t_write);
 }
 
 static void vici_submit_request(struct vici_conn *vici, const char *name, ...)
@@ -519,14 +519,14 @@ static void vici_reconnect(struct event *t)
                debugf(NHRP_DEBUG_VICI,
                       "%s: failure connecting VICI socket: %s", __func__,
                       strerror(errno));
-               thread_add_timer(master, vici_reconnect, vici, 2,
-                                &vici->t_reconnect);
+               event_add_timer(master, vici_reconnect, vici, 2,
+                               &vici->t_reconnect);
                return;
        }
 
        debugf(NHRP_DEBUG_COMMON, "VICI: Connected");
        vici->fd = fd;
-       thread_add_read(master, vici_read, vici, vici->fd, &vici->t_read);
+       event_add_read(master, vici_read, vici, vici->fd, &vici->t_read);
 
        /* Send event subscribtions */
        // vici_register_event(vici, "child-updown");
@@ -547,8 +547,8 @@ void vici_init(void)
        vici->fd = -1;
        zbuf_init(&vici->ibuf, vici->ibuf_data, sizeof(vici->ibuf_data), 0);
        zbufq_init(&vici->obuf);
-       thread_add_timer_msec(master, vici_reconnect, vici, 10,
-                             &vici->t_reconnect);
+       event_add_timer_msec(master, vici_reconnect, vici, 10,
+                            &vici->t_reconnect);
 }
 
 void vici_terminate(void)
index a2e77d922857eea88db19b9c78f2df88fef286ad..bb47b66755462cadc3c890b504b3e430051cec42 100644 (file)
@@ -1110,9 +1110,8 @@ void ospf6_asbr_distribute_list_update(struct ospf6 *ospf6,
        if (IS_OSPF6_DEBUG_ASBR)
                zlog_debug("%s: trigger redistribute reset thread", __func__);
 
-       thread_add_timer_msec(master, ospf6_asbr_routemap_update_timer, ospf6,
-                             OSPF_MIN_LS_INTERVAL,
-                             &ospf6->t_distribute_update);
+       event_add_timer_msec(master, ospf6_asbr_routemap_update_timer, ospf6,
+                            OSPF_MIN_LS_INTERVAL, &ospf6->t_distribute_update);
 }
 
 void ospf6_asbr_routemap_update(const char *mapname)
@@ -3024,8 +3023,8 @@ static void ospf6_aggr_handle_external_info(void *data)
                                zlog_debug("%s: LSA found, refresh it",
                                           __func__);
                        THREAD_OFF(lsa->refresh);
-                       thread_add_event(master, ospf6_lsa_refresh, lsa, 0,
-                                        &lsa->refresh);
+                       event_add_event(master, ospf6_lsa_refresh, lsa, 0,
+                                       &lsa->refresh);
                        return;
                }
        }
@@ -3227,8 +3226,8 @@ static void ospf6_handle_exnl_rt_after_aggr_del(struct ospf6 *ospf6,
 
        if (lsa) {
                THREAD_OFF(lsa->refresh);
-               thread_add_event(master, ospf6_lsa_refresh, lsa, 0,
-                                &lsa->refresh);
+               event_add_event(master, ospf6_lsa_refresh, lsa, 0,
+                               &lsa->refresh);
        } else {
                if (IS_OSPF6_DEBUG_AGGR)
                        zlog_debug("%s: Originate external route(%pFX)",
@@ -3386,10 +3385,8 @@ ospf6_start_asbr_summary_delay_timer(struct ospf6 *ospf6,
                           __func__, ospf6->aggr_delay_interval);
 
        ospf6->aggr_action = operation;
-       thread_add_timer(master,
-                       ospf6_asbr_summary_process,
-                       ospf6, ospf6->aggr_delay_interval,
-                       &ospf6->t_external_aggr);
+       event_add_timer(master, ospf6_asbr_summary_process, ospf6,
+                       ospf6->aggr_delay_interval, &ospf6->t_external_aggr);
 }
 
 int ospf6_asbr_external_rt_advertise(struct ospf6 *ospf6,
index 1b879ae2809bfbfdb2ba63a15335365049c36a43..bbe3fcd03880419c231483c7725059badfb9f12b 100644 (file)
@@ -106,7 +106,7 @@ static void ospf6_bfd_callback(struct bfd_session_params *bsp,
        if (bss->state == BFD_STATUS_DOWN
            && bss->previous_state == BFD_STATUS_UP) {
                THREAD_OFF(on->inactivity_timer);
-               thread_add_event(master, inactivity_timer, on, 0, NULL);
+               event_add_event(master, inactivity_timer, on, 0, NULL);
        }
 }
 
index a782d97304bb696516c780b12fac854b2b2a1aa7..ddf775d72d6424c309dbba21c635c945a9cbc8d4 100644 (file)
@@ -104,8 +104,8 @@ void ospf6_lsa_originate(struct ospf6 *ospf6, struct ospf6_lsa *lsa)
        ospf6_lsdb_add(ospf6_lsa_copy(lsa), lsdb_self);
 
        THREAD_OFF(lsa->refresh);
-       thread_add_timer(master, ospf6_lsa_refresh, lsa, OSPF_LS_REFRESH_TIME,
-                        &lsa->refresh);
+       event_add_timer(master, ospf6_lsa_refresh, lsa, OSPF_LS_REFRESH_TIME,
+                       &lsa->refresh);
 
        if (IS_OSPF6_DEBUG_LSA_TYPE(lsa->header->type)
            || IS_OSPF6_DEBUG_ORIGINATE_TYPE(lsa->header->type)) {
@@ -257,10 +257,10 @@ void ospf6_install_lsa(struct ospf6_lsa *lsa)
 
        monotime(&now);
        if (!OSPF6_LSA_IS_MAXAGE(lsa)) {
-               thread_add_timer(master, ospf6_lsa_expire, lsa,
-                                OSPF_LSA_MAXAGE + lsa->birth.tv_sec
-                                        - now.tv_sec,
-                                &lsa->expire);
+               event_add_timer(master, ospf6_lsa_expire, lsa,
+                               OSPF_LSA_MAXAGE + lsa->birth.tv_sec -
+                                       now.tv_sec,
+                               &lsa->expire);
        } else
                lsa->expire = NULL;
 
@@ -473,10 +473,10 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
 
                                ospf6_lsdb_add(ospf6_lsa_copy(lsa),
                                               on->retrans_list);
-                               thread_add_timer(
-                                       master, ospf6_lsupdate_send_neighbor,
-                                       on, on->ospf6_if->rxmt_interval,
-                                       &on->thread_send_lsupdate);
+                               event_add_timer(master,
+                                               ospf6_lsupdate_send_neighbor,
+                                               on, on->ospf6_if->rxmt_interval,
+                                               &on->thread_send_lsupdate);
                                retrans_added++;
                        }
                }
@@ -520,14 +520,14 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
        if ((oi->type == OSPF_IFTYPE_BROADCAST)
            || (oi->type == OSPF_IFTYPE_POINTOPOINT)) {
                ospf6_lsdb_add(ospf6_lsa_copy(lsa), oi->lsupdate_list);
-               thread_add_event(master, ospf6_lsupdate_send_interface, oi, 0,
-                                &oi->thread_send_lsupdate);
+               event_add_event(master, ospf6_lsupdate_send_interface, oi, 0,
+                               &oi->thread_send_lsupdate);
        } else {
                /* reschedule retransmissions to all neighbors */
                for (ALL_LIST_ELEMENTS(oi->neighbor_list, node, nnode, on)) {
                        THREAD_OFF(on->thread_send_lsupdate);
-                       thread_add_event(master, ospf6_lsupdate_send_neighbor,
-                                        on, 0, &on->thread_send_lsupdate);
+                       event_add_event(master, ospf6_lsupdate_send_neighbor,
+                                       on, 0, &on->thread_send_lsupdate);
                }
        }
 }
@@ -697,8 +697,8 @@ static void ospf6_acknowledge_lsa_bdrouter(struct ospf6_lsa *lsa,
                                        "Delayed acknowledgement (BDR & MoreRecent & from DR)");
                        /* Delayed acknowledgement */
                        ospf6_lsdb_add(ospf6_lsa_copy(lsa), oi->lsack_list);
-                       thread_add_timer(master, ospf6_lsack_send_interface, oi,
-                                        3, &oi->thread_send_lsack);
+                       event_add_timer(master, ospf6_lsack_send_interface, oi,
+                                       3, &oi->thread_send_lsack);
                } else {
                        if (is_debug)
                                zlog_debug(
@@ -718,8 +718,8 @@ static void ospf6_acknowledge_lsa_bdrouter(struct ospf6_lsa *lsa,
                                        "Delayed acknowledgement (BDR & Duplicate & ImpliedAck & from DR)");
                        /* Delayed acknowledgement */
                        ospf6_lsdb_add(ospf6_lsa_copy(lsa), oi->lsack_list);
-                       thread_add_timer(master, ospf6_lsack_send_interface, oi,
-                                        3, &oi->thread_send_lsack);
+                       event_add_timer(master, ospf6_lsack_send_interface, oi,
+                                       3, &oi->thread_send_lsack);
                } else {
                        if (is_debug)
                                zlog_debug(
@@ -736,8 +736,8 @@ static void ospf6_acknowledge_lsa_bdrouter(struct ospf6_lsa *lsa,
                if (is_debug)
                        zlog_debug("Direct acknowledgement (BDR & Duplicate)");
                ospf6_lsdb_add(ospf6_lsa_copy(lsa), from->lsack_list);
-               thread_add_event(master, ospf6_lsack_send_neighbor, from, 0,
-                                &from->thread_send_lsack);
+               event_add_event(master, ospf6_lsack_send_neighbor, from, 0,
+                               &from->thread_send_lsack);
                return;
        }
 
@@ -778,8 +778,8 @@ static void ospf6_acknowledge_lsa_allother(struct ospf6_lsa *lsa,
                                "Delayed acknowledgement (AllOther & MoreRecent)");
                /* Delayed acknowledgement */
                ospf6_lsdb_add(ospf6_lsa_copy(lsa), oi->lsack_list);
-               thread_add_timer(master, ospf6_lsack_send_interface, oi, 3,
-                                &oi->thread_send_lsack);
+               event_add_timer(master, ospf6_lsack_send_interface, oi, 3,
+                               &oi->thread_send_lsack);
                return;
        }
 
@@ -802,8 +802,8 @@ static void ospf6_acknowledge_lsa_allother(struct ospf6_lsa *lsa,
                        zlog_debug(
                                "Direct acknowledgement (AllOther & Duplicate)");
                ospf6_lsdb_add(ospf6_lsa_copy(lsa), from->lsack_list);
-               thread_add_event(master, ospf6_lsack_send_neighbor, from, 0,
-                                &from->thread_send_lsack);
+               event_add_event(master, ospf6_lsack_send_neighbor, from, 0,
+                               &from->thread_send_lsack);
                return;
        }
 
@@ -973,8 +973,8 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
                /* a) Acknowledge back to neighbor (Direct acknowledgement,
                 * 13.5) */
                ospf6_lsdb_add(ospf6_lsa_copy(new), from->lsack_list);
-               thread_add_event(master, ospf6_lsack_send_neighbor, from, 0,
-                                &from->thread_send_lsack);
+               event_add_event(master, ospf6_lsack_send_neighbor, from, 0,
+                               &from->thread_send_lsack);
 
                /* b) Discard */
                ospf6_lsa_delete(new);
@@ -1105,8 +1105,8 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
                                        "Newer instance of the self-originated LSA");
                                zlog_debug("Schedule reorigination");
                        }
-                       thread_add_event(master, ospf6_lsa_refresh, new, 0,
-                                        &new->refresh);
+                       event_add_event(master, ospf6_lsa_refresh, new, 0,
+                                       &new->refresh);
                }
 
                /* GR: check for network topology change. */
@@ -1134,7 +1134,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
                        new->name);
 
                /* BadLSReq */
-               thread_add_event(master, bad_lsreq, from, 0, NULL);
+               event_add_event(master, bad_lsreq, from, 0, NULL);
 
                ospf6_lsa_delete(new);
                return;
@@ -1231,8 +1231,8 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
 
                        ospf6_lsdb_add(ospf6_lsa_copy(old),
                                       from->lsupdate_list);
-                       thread_add_event(master, ospf6_lsupdate_send_neighbor,
-                                        from, 0, &from->thread_send_lsupdate);
+                       event_add_event(master, ospf6_lsupdate_send_neighbor,
+                                       from, 0, &from->thread_send_lsupdate);
 
                        ospf6_lsa_delete(new);
                        return;
index b3f485915851b3459e2488440cba7de6a2319a8f..c79f3de9c35b6a4c4678c93a2f6e3fe5206286b7 100644 (file)
@@ -592,9 +592,9 @@ void ospf6_gr_nvm_read(struct ospf6 *ospf6)
                                zlog_debug(
                                        "GR: remaining time until grace period expires: %lu(s)",
                                        remaining_time);
-                       thread_add_timer(master, ospf6_gr_grace_period_expired,
-                                        ospf6, remaining_time,
-                                        &ospf6->gr_info.t_grace_period);
+                       event_add_timer(master, ospf6_gr_grace_period_expired,
+                                       ospf6, remaining_time,
+                                       &ospf6->gr_info.t_grace_period);
                }
        }
 
index fb710cc1cddc1d457ae7e58c2d40953fe956a354..599c2944cf9555f32e11c3504d757eca4ffd2ae7 100644 (file)
@@ -415,9 +415,9 @@ int ospf6_process_grace_lsa(struct ospf6 *ospf6, struct ospf6_lsa *lsa,
                           actual_grace_interval);
 
        /* Start the grace timer */
-       thread_add_timer(master, ospf6_handle_grace_timer_expiry, restarter,
-                        actual_grace_interval,
-                        &restarter->gr_helper_info.t_grace_timer);
+       event_add_timer(master, ospf6_handle_grace_timer_expiry, restarter,
+                       actual_grace_interval,
+                       &restarter->gr_helper_info.t_grace_timer);
 
        return OSPF6_GR_ACTIVE_HELPER;
 }
index f465d876308a28a011819fb07b942fcb197dfd3d..baf9b7691afe55c28b9f3106933d1e5ad51d3ae7 100644 (file)
@@ -671,8 +671,8 @@ uint8_t dr_election(struct ospf6_interface *oi)
                        if (on->state < OSPF6_NEIGHBOR_TWOWAY)
                                continue;
                        /* Schedule AdjOK. */
-                       thread_add_event(master, adj_ok, on, 0,
-                                        &on->thread_adj_ok);
+                       event_add_event(master, adj_ok, on, 0,
+                                       &on->thread_adj_ok);
                }
        }
 
@@ -785,9 +785,8 @@ void interface_up(struct event *thread)
                zlog_info(
                        "Interface %s is still in all routers group, rescheduling for SSO",
                        oi->interface->name);
-               thread_add_timer(master, interface_up, oi,
-                                OSPF6_INTERFACE_SSO_RETRY_INT,
-                                &oi->thread_sso);
+               event_add_timer(master, interface_up, oi,
+                               OSPF6_INTERFACE_SSO_RETRY_INT, &oi->thread_sso);
                return;
        }
 #endif /* __FreeBSD__ */
@@ -802,9 +801,9 @@ void interface_up(struct event *thread)
                        zlog_info(
                                "Scheduling %s for sso retry, trial count: %d",
                                oi->interface->name, oi->sso_try_cnt);
-                       thread_add_timer(master, interface_up, oi,
-                                        OSPF6_INTERFACE_SSO_RETRY_INT,
-                                        &oi->thread_sso);
+                       event_add_timer(master, interface_up, oi,
+                                       OSPF6_INTERFACE_SSO_RETRY_INT,
+                                       &oi->thread_sso);
                }
                return;
        }
@@ -816,8 +815,8 @@ void interface_up(struct event *thread)
        /* Schedule Hello */
        if (!CHECK_FLAG(oi->flag, OSPF6_INTERFACE_PASSIVE)
            && !if_is_loopback(oi->interface)) {
-               thread_add_timer(master, ospf6_hello_send, oi, 0,
-                                &oi->thread_send_hello);
+               event_add_timer(master, ospf6_hello_send, oi, 0,
+                               &oi->thread_send_hello);
        }
 
        /* decide next interface state */
@@ -829,8 +828,8 @@ void interface_up(struct event *thread)
                ospf6_interface_state_change(OSPF6_INTERFACE_DROTHER, oi);
        else {
                ospf6_interface_state_change(OSPF6_INTERFACE_WAITING, oi);
-               thread_add_timer(master, wait_timer, oi, oi->dead_interval,
-                                &oi->thread_wait_timer);
+               event_add_timer(master, wait_timer, oi, oi->dead_interval,
+                               &oi->thread_wait_timer);
        }
 }
 
@@ -1880,7 +1879,7 @@ DEFUN (ipv6_ospf6_ifmtu,
        /* re-establish adjacencies */
        for (ALL_LIST_ELEMENTS(oi->neighbor_list, node, nnode, on)) {
                THREAD_OFF(on->inactivity_timer);
-               thread_add_event(master, inactivity_timer, on, 0, NULL);
+               event_add_event(master, inactivity_timer, on, 0, NULL);
        }
 
        return CMD_SUCCESS;
@@ -1926,7 +1925,7 @@ DEFUN (no_ipv6_ospf6_ifmtu,
        /* re-establish adjacencies */
        for (ALL_LIST_ELEMENTS(oi->neighbor_list, node, nnode, on)) {
                THREAD_OFF(on->inactivity_timer);
-               thread_add_event(master, inactivity_timer, on, 0, NULL);
+               event_add_event(master, inactivity_timer, on, 0, NULL);
        }
 
        return CMD_SUCCESS;
@@ -2111,8 +2110,8 @@ DEFUN (ipv6_ospf6_hellointerval,
        if (thread_is_scheduled(oi->thread_send_hello)) {
                THREAD_OFF(oi->thread_send_hello);
 
-               thread_add_timer(master, ospf6_hello_send, oi, 0,
-                                &oi->thread_send_hello);
+               event_add_timer(master, ospf6_hello_send, oi, 0,
+                               &oi->thread_send_hello);
        }
        return CMD_SUCCESS;
 }
@@ -2330,7 +2329,7 @@ DEFUN (ipv6_ospf6_passive,
 
        for (ALL_LIST_ELEMENTS(oi->neighbor_list, node, nnode, on)) {
                THREAD_OFF(on->inactivity_timer);
-               thread_add_event(master, inactivity_timer, on, 0, NULL);
+               event_add_event(master, inactivity_timer, on, 0, NULL);
        }
 
        return CMD_SUCCESS;
@@ -2360,8 +2359,8 @@ DEFUN (no_ipv6_ospf6_passive,
 
        /* don't send hellos over loopback interface */
        if (!if_is_loopback(oi->interface))
-               thread_add_timer(master, ospf6_hello_send, oi, 0,
-                                &oi->thread_send_hello);
+               event_add_timer(master, ospf6_hello_send, oi, 0,
+                               &oi->thread_send_hello);
 
        return CMD_SUCCESS;
 }
index f4b392f4663ca1be9c6bd2777863dc77b3535f27..b09c4163f9e763b0f704de915df5702f5b9b84ae 100644 (file)
@@ -139,32 +139,32 @@ struct ospf6_intra_prefix_lsa {
 #define OSPF6_ROUTER_LSA_SCHEDULE(oa)                                          \
        do {                                                                   \
                if (CHECK_FLAG((oa)->flag, OSPF6_AREA_ENABLE))                 \
-                       thread_add_event(master, ospf6_router_lsa_originate,   \
-                                        oa, 0, &(oa)->thread_router_lsa);     \
+                       event_add_event(master, ospf6_router_lsa_originate,    \
+                                       oa, 0, &(oa)->thread_router_lsa);      \
        } while (0)
 #define OSPF6_NETWORK_LSA_SCHEDULE(oi)                                         \
        do {                                                                   \
                if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE))          \
-                       thread_add_event(master, ospf6_network_lsa_originate,  \
-                                        oi, 0, &(oi)->thread_network_lsa);    \
+                       event_add_event(master, ospf6_network_lsa_originate,   \
+                                       oi, 0, &(oi)->thread_network_lsa);     \
        } while (0)
 #define OSPF6_LINK_LSA_SCHEDULE(oi)                                            \
        do {                                                                   \
                if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE))          \
-                       thread_add_event(master, ospf6_link_lsa_originate, oi, \
-                                        0, &(oi)->thread_link_lsa);           \
+                       event_add_event(master, ospf6_link_lsa_originate, oi,  \
+                                       0, &(oi)->thread_link_lsa);            \
        } while (0)
 #define OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oa)                               \
        do {                                                                   \
                if (CHECK_FLAG((oa)->flag, OSPF6_AREA_ENABLE))                 \
-                       thread_add_event(                                      \
+                       event_add_event(                                       \
                                master, ospf6_intra_prefix_lsa_originate_stub, \
                                oa, 0, &(oa)->thread_intra_prefix_lsa);        \
        } while (0)
 #define OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi)                            \
        do {                                                                   \
                if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE))          \
-                       thread_add_event(                                      \
+                       event_add_event(                                       \
                                master,                                        \
                                ospf6_intra_prefix_lsa_originate_transit, oi,  \
                                0, &(oi)->thread_intra_prefix_lsa);            \
@@ -173,8 +173,8 @@ struct ospf6_intra_prefix_lsa {
 #define OSPF6_AS_EXTERN_LSA_SCHEDULE(oi)                                       \
        do {                                                                   \
                if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE))          \
-                       thread_add_event(master, ospf6_orig_as_external_lsa,   \
-                                        oi, 0, &(oi)->thread_as_extern_lsa);  \
+                       event_add_event(master, ospf6_orig_as_external_lsa,    \
+                                       oi, 0, &(oi)->thread_as_extern_lsa);   \
        } while (0)
 
 #define OSPF6_ROUTER_LSA_EXECUTE(oa)                                           \
index 508cb6f5e0125a3d4a4e77770ed36641afb3e20c..a9dd7aa28ca15b07887d29d18be760622905c075 100644 (file)
@@ -875,8 +875,8 @@ void ospf6_lsa_refresh(struct event *thread)
 
        new = ospf6_lsa_create(self->header);
        new->lsdb = old->lsdb;
-       thread_add_timer(master, ospf6_lsa_refresh, new, OSPF_LS_REFRESH_TIME,
-                        &new->refresh);
+       event_add_timer(master, ospf6_lsa_refresh, new, OSPF_LS_REFRESH_TIME,
+                       &new->refresh);
 
        /* store it in the LSDB for self-originated LSAs */
        ospf6_lsdb_add(ospf6_lsa_copy(new), lsdb_self);
index 1d3d1f7e6fc101c7e76fca72353c53655e668ed5..ff739587429a6e07a7764cc8028b2c09e470ff56 100644 (file)
@@ -594,9 +594,9 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst,
 
        /* Schedule interface events */
        if (backupseen)
-               thread_add_event(master, backup_seen, oi, 0, NULL);
+               event_add_event(master, backup_seen, oi, 0, NULL);
        if (neighborchange)
-               thread_add_event(master, neighbor_change, oi, 0, NULL);
+               event_add_event(master, neighbor_change, oi, 0, NULL);
 
        if (neighbor_ifindex_change && on->state == OSPF6_NEIGHBOR_FULL)
                OSPF6_ROUTER_LSA_SCHEDULE(oi->area);
@@ -667,24 +667,24 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,
                        zlog_warn(
                                "DbDesc recv: Master/Slave bit mismatch Nbr %s",
                                on->name);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
-                                        NULL);
+                       event_add_event(master, seqnumber_mismatch, on, 0,
+                                       NULL);
                        return;
                }
 
                if (CHECK_FLAG(dbdesc->bits, OSPF6_DBDESC_IBIT)) {
                        zlog_warn("DbDesc recv: Initialize bit mismatch Nbr %s",
                                  on->name);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
-                                        NULL);
+                       event_add_event(master, seqnumber_mismatch, on, 0,
+                                       NULL);
                        return;
                }
 
                if (memcmp(on->options, dbdesc->options, sizeof(on->options))) {
                        zlog_warn("DbDesc recv: Option field mismatch Nbr %s",
                                  on->name);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
-                                        NULL);
+                       event_add_event(master, seqnumber_mismatch, on, 0,
+                                       NULL);
                        return;
                }
 
@@ -693,7 +693,7 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,
                                "DbDesc recv: Sequence number mismatch Nbr %s (received %#lx, %#lx expected)",
                                on->name, (unsigned long)ntohl(dbdesc->seqnum),
                                (unsigned long)on->dbdesc_seqnum);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
+                       event_add_event(master, seqnumber_mismatch, on, 0,
                                         NULL);
                        return;
                }
@@ -714,7 +714,7 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,
                zlog_warn(
                        "DbDesc recv: Not duplicate dbdesc in state %s Nbr %s",
                        ospf6_neighbor_state_str[on->state], on->name);
-               thread_add_event(master, seqnumber_mismatch, on, 0, NULL);
+               event_add_event(master, seqnumber_mismatch, on, 0, NULL);
                return;
 
        default:
@@ -758,8 +758,8 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,
                                zlog_debug(
                                        "SeqNumMismatch (E-bit mismatch), discard");
                        ospf6_lsa_delete(his);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
-                                        NULL);
+                       event_add_event(master, seqnumber_mismatch, on, 0,
+                                       NULL);
                        return;
                }
 
@@ -787,19 +787,19 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,
 
        /* schedule send lsreq */
        if (on->request_list->count)
-               thread_add_event(master, ospf6_lsreq_send, on, 0,
-                                &on->thread_send_lsreq);
+               event_add_event(master, ospf6_lsreq_send, on, 0,
+                               &on->thread_send_lsreq);
 
        THREAD_OFF(on->thread_send_dbdesc);
 
        /* More bit check */
        if (!CHECK_FLAG(dbdesc->bits, OSPF6_DBDESC_MBIT)
            && !CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT))
-               thread_add_event(master, exchange_done, on, 0,
-                                &on->thread_exchange_done);
+               event_add_event(master, exchange_done, on, 0,
+                               &on->thread_exchange_done);
        else {
-               thread_add_event(master, ospf6_dbdesc_send_newone, on, 0,
-                                &on->thread_send_dbdesc);
+               event_add_event(master, ospf6_dbdesc_send_newone, on, 0,
+                               &on->thread_send_dbdesc);
        }
 
        /* save last received dbdesc */
@@ -876,8 +876,8 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
                                zlog_debug(
                                        "Duplicated dbdesc causes retransmit");
                        THREAD_OFF(on->thread_send_dbdesc);
-                       thread_add_event(master, ospf6_dbdesc_send, on, 0,
-                                        &on->thread_send_dbdesc);
+                       event_add_event(master, ospf6_dbdesc_send, on, 0,
+                                       &on->thread_send_dbdesc);
                        return;
                }
 
@@ -885,8 +885,8 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
                        zlog_warn(
                                "DbDesc slave recv: Master/Slave bit mismatch Nbr %s",
                                on->name);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
-                                        NULL);
+                       event_add_event(master, seqnumber_mismatch, on, 0,
+                                       NULL);
                        return;
                }
 
@@ -894,8 +894,8 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
                        zlog_warn(
                                "DbDesc slave recv: Initialize bit mismatch Nbr %s",
                                on->name);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
-                                        NULL);
+                       event_add_event(master, seqnumber_mismatch, on, 0,
+                                       NULL);
                        return;
                }
 
@@ -903,8 +903,8 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
                        zlog_warn(
                                "DbDesc slave recv: Option field mismatch Nbr %s",
                                on->name);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
-                                        NULL);
+                       event_add_event(master, seqnumber_mismatch, on, 0,
+                                       NULL);
                        return;
                }
 
@@ -913,7 +913,7 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
                                "DbDesc slave recv: Sequence number mismatch Nbr %s (received %#lx, %#lx expected)",
                                on->name, (unsigned long)ntohl(dbdesc->seqnum),
                                (unsigned long)on->dbdesc_seqnum + 1);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
+                       event_add_event(master, seqnumber_mismatch, on, 0,
                                         NULL);
                        return;
                }
@@ -929,15 +929,15 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
                                zlog_debug(
                                        "Duplicated dbdesc causes retransmit");
                        THREAD_OFF(on->thread_send_dbdesc);
-                       thread_add_event(master, ospf6_dbdesc_send, on, 0,
-                                        &on->thread_send_dbdesc);
+                       event_add_event(master, ospf6_dbdesc_send, on, 0,
+                                       &on->thread_send_dbdesc);
                        return;
                }
 
                zlog_warn(
                        "DbDesc slave recv: Not duplicate dbdesc in state %s Nbr %s",
                        ospf6_neighbor_state_str[on->state], on->name);
-               thread_add_event(master, seqnumber_mismatch, on, 0, NULL);
+               event_add_event(master, seqnumber_mismatch, on, 0, NULL);
                return;
 
        default:
@@ -977,8 +977,8 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
                        if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV))
                                zlog_debug("E-bit mismatch with LSA Headers");
                        ospf6_lsa_delete(his);
-                       thread_add_event(master, seqnumber_mismatch, on, 0,
-                                        NULL);
+                       event_add_event(master, seqnumber_mismatch, on, 0,
+                                       NULL);
                        return;
                }
 
@@ -999,12 +999,12 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
 
        /* schedule send lsreq */
        if (on->request_list->count)
-               thread_add_event(master, ospf6_lsreq_send, on, 0,
-                                &on->thread_send_lsreq);
+               event_add_event(master, ospf6_lsreq_send, on, 0,
+                               &on->thread_send_lsreq);
 
        THREAD_OFF(on->thread_send_dbdesc);
-       thread_add_event(master, ospf6_dbdesc_send_newone, on, 0,
-                        &on->thread_send_dbdesc);
+       event_add_event(master, ospf6_dbdesc_send_newone, on, 0,
+                       &on->thread_send_dbdesc);
 
        /* save last received dbdesc */
        memcpy(&on->dbdesc_last, dbdesc, sizeof(struct ospf6_dbdesc));
@@ -1126,7 +1126,7 @@ static void ospf6_lsreq_recv(struct in6_addr *src, struct in6_addr *dst,
                                "Can't find requested lsa [%s Id:%pI4 Adv:%pI4] send badLSReq",
                                ospf6_lstype_name(e->type), &e->id,
                                &e->adv_router);
-                       thread_add_event(master, bad_lsreq, on, 0, NULL);
+                       event_add_event(master, bad_lsreq, on, 0, NULL);
                        return;
                }
 
@@ -1137,8 +1137,8 @@ static void ospf6_lsreq_recv(struct in6_addr *src, struct in6_addr *dst,
 
        /* schedule send lsupdate */
        THREAD_OFF(on->thread_send_lsupdate);
-       thread_add_event(master, ospf6_lsupdate_send_neighbor, on, 0,
-                        &on->thread_send_lsupdate);
+       event_add_event(master, ospf6_lsupdate_send_neighbor, on, 0,
+                       &on->thread_send_lsupdate);
 }
 
 /* Verify, that the specified memory area contains exactly N valid IPv6
@@ -1917,8 +1917,8 @@ void ospf6_receive(struct event *thread)
        ospf6 = THREAD_ARG(thread);
        sockfd = THREAD_FD(thread);
 
-       thread_add_read(master, ospf6_receive, ospf6, ospf6->fd,
-                       &ospf6->t_ospf6_receive);
+       event_add_read(master, ospf6_receive, ospf6, ospf6->fd,
+                      &ospf6->t_ospf6_receive);
 
        while (count < ospf6->write_oi_count) {
                count++;
@@ -2232,8 +2232,8 @@ static void ospf6_write(struct event *thread)
 
        /* If packets still remain in queue, call write thread. */
        if (!list_isempty(ospf6->oi_write_q))
-               thread_add_write(master, ospf6_write, ospf6, ospf6->fd,
-                                &ospf6->t_write);
+               event_add_write(master, ospf6_write, ospf6, ospf6->fd,
+                               &ospf6->t_write);
 }
 
 void ospf6_hello_send(struct event *thread)
@@ -2279,8 +2279,8 @@ void ospf6_hello_send(struct event *thread)
        ospf6_packet_add_top(oi, op);
 
        /* set next thread */
-       thread_add_timer(master, ospf6_hello_send, oi, oi->hello_interval,
-                        &oi->thread_send_hello);
+       event_add_timer(master, ospf6_hello_send, oi, oi->hello_interval,
+                       &oi->thread_send_hello);
 
        OSPF6_MESSAGE_WRITE_ON(oi);
 }
@@ -2351,9 +2351,9 @@ void ospf6_dbdesc_send(struct event *thread)
 
        /* set next thread if master */
        if (CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT))
-               thread_add_timer(master, ospf6_dbdesc_send, on,
-                                on->ospf6_if->rxmt_interval,
-                                &on->thread_send_dbdesc);
+               event_add_timer(master, ospf6_dbdesc_send, on,
+                               on->ospf6_if->rxmt_interval,
+                               &on->thread_send_dbdesc);
 
        op = ospf6_packet_new(on->ospf6_if->ifmtu);
        ospf6_make_header(OSPF6_MESSAGE_TYPE_DBDESC, on->ospf6_if, op->s);
@@ -2418,8 +2418,8 @@ void ospf6_dbdesc_send_newone(struct event *thread)
        if (!CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT) && /* Slave */
            !CHECK_FLAG(on->dbdesc_last.bits, OSPF6_DBDESC_MBIT)
            && !CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT))
-               thread_add_event(master, exchange_done, on, 0,
-                                &on->thread_exchange_done);
+               event_add_event(master, exchange_done, on, 0,
+                               &on->thread_exchange_done);
 
        thread_execute(master, ospf6_dbdesc_send, on, 0);
 }
@@ -2518,7 +2518,7 @@ void ospf6_lsreq_send(struct event *thread)
 
        /* schedule loading_done if request list is empty */
        if (on->request_list->count == 0) {
-               thread_add_event(master, loading_done, on, 0, NULL);
+               event_add_event(master, loading_done, on, 0, NULL);
                return;
        }
 
@@ -2551,9 +2551,9 @@ void ospf6_lsreq_send(struct event *thread)
 
        /* set next thread */
        if (on->request_list->count != 0) {
-               thread_add_timer(master, ospf6_lsreq_send, on,
-                                on->ospf6_if->rxmt_interval,
-                                &on->thread_send_lsreq);
+               event_add_timer(master, ospf6_lsreq_send, on,
+                               on->ospf6_if->rxmt_interval,
+                               &on->thread_send_lsreq);
        }
 }
 
@@ -2734,12 +2734,12 @@ void ospf6_lsupdate_send_neighbor(struct event *thread)
                ospf6_packet_free(op);
 
        if (on->lsupdate_list->count != 0) {
-               thread_add_event(master, ospf6_lsupdate_send_neighbor, on, 0,
-                                &on->thread_send_lsupdate);
+               event_add_event(master, ospf6_lsupdate_send_neighbor, on, 0,
+                               &on->thread_send_lsupdate);
        } else if (on->retrans_list->count != 0) {
-               thread_add_timer(master, ospf6_lsupdate_send_neighbor, on,
-                                on->ospf6_if->rxmt_interval,
-                                &on->thread_send_lsupdate);
+               event_add_timer(master, ospf6_lsupdate_send_neighbor, on,
+                               on->ospf6_if->rxmt_interval,
+                               &on->thread_send_lsupdate);
        }
 }
 
@@ -2847,8 +2847,8 @@ void ospf6_lsupdate_send_interface(struct event *thread)
                ospf6_packet_free(op);
 
        if (oi->lsupdate_list->count > 0) {
-               thread_add_event(master, ospf6_lsupdate_send_interface, oi, 0,
-                                &oi->thread_send_lsupdate);
+               event_add_event(master, ospf6_lsupdate_send_interface, oi, 0,
+                               &oi->thread_send_lsupdate);
        }
 }
 
@@ -2893,8 +2893,8 @@ void ospf6_lsack_send_neighbor(struct event *thread)
        OSPF6_MESSAGE_WRITE_ON(on->ospf6_if);
 
        if (on->lsack_list->count > 0)
-               thread_add_event(master, ospf6_lsack_send_neighbor, on, 0,
-                                &on->thread_send_lsack);
+               event_add_event(master, ospf6_lsack_send_neighbor, on, 0,
+                               &on->thread_send_lsack);
 }
 
 static uint16_t ospf6_make_lsack_interface(struct ospf6_interface *oi,
@@ -2910,8 +2910,8 @@ static uint16_t ospf6_make_lsack_interface(struct ospf6_interface *oi,
                        /* if we run out of packet size/space here,
                           better to try again soon. */
                        THREAD_OFF(oi->thread_send_lsack);
-                       thread_add_event(master, ospf6_lsack_send_interface, oi,
-                                        0, &oi->thread_send_lsack);
+                       event_add_event(master, ospf6_lsack_send_interface, oi,
+                                       0, &oi->thread_send_lsack);
 
                        ospf6_lsa_unlock(lsa);
                        if (lsanext)
@@ -2975,8 +2975,8 @@ void ospf6_lsack_send_interface(struct event *thread)
        OSPF6_MESSAGE_WRITE_ON(oi);
 
        if (oi->lsack_list->count > 0)
-               thread_add_event(master, ospf6_lsack_send_interface, oi, 0,
-                                &oi->thread_send_lsack);
+               event_add_event(master, ospf6_lsack_send_interface, oi, 0,
+                               &oi->thread_send_lsack);
 }
 
 /* Commands */
index 95c8f189d05d5509507b2004498a6abe84b40e9c..aaa23659eb95e94443552a18bb17b5031d4d151c 100644 (file)
@@ -284,8 +284,8 @@ void hello_received(struct event *thread)
 
        /* reset Inactivity Timer */
        THREAD_OFF(on->inactivity_timer);
-       thread_add_timer(master, inactivity_timer, on,
-                        on->ospf6_if->dead_interval, &on->inactivity_timer);
+       event_add_timer(master, inactivity_timer, on,
+                       on->ospf6_if->dead_interval, &on->inactivity_timer);
 
        if (on->state <= OSPF6_NEIGHBOR_DOWN)
                ospf6_neighbor_state_change(OSPF6_NEIGHBOR_INIT, on,
@@ -305,7 +305,7 @@ void twoway_received(struct event *thread)
        if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT))
                zlog_debug("Neighbor Event %s: *2Way-Received*", on->name);
 
-       thread_add_event(master, neighbor_change, on->ospf6_if, 0, NULL);
+       event_add_event(master, neighbor_change, on->ospf6_if, 0, NULL);
 
        if (!need_adjacency(on)) {
                ospf6_neighbor_state_change(OSPF6_NEIGHBOR_TWOWAY, on,
@@ -320,8 +320,8 @@ void twoway_received(struct event *thread)
        SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT);
 
        THREAD_OFF(on->thread_send_dbdesc);
-       thread_add_event(master, ospf6_dbdesc_send, on, 0,
-                        &on->thread_send_dbdesc);
+       event_add_event(master, ospf6_dbdesc_send, on, 0,
+                       &on->thread_send_dbdesc);
 }
 
 void negotiation_done(struct event *thread)
@@ -400,9 +400,9 @@ void exchange_done(struct event *thread)
        /* RFC 2328 (10.8): Release the last dbdesc after dead_interval */
        if (!CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)) {
                THREAD_OFF(on->last_dbdesc_release_timer);
-               thread_add_timer(master, ospf6_neighbor_last_dbdesc_release, on,
-                                on->ospf6_if->dead_interval,
-                                &on->last_dbdesc_release_timer);
+               event_add_timer(master, ospf6_neighbor_last_dbdesc_release, on,
+                               on->ospf6_if->dead_interval,
+                               &on->last_dbdesc_release_timer);
        }
 
        if (on->request_list->count == 0)
@@ -412,8 +412,8 @@ void exchange_done(struct event *thread)
                ospf6_neighbor_state_change(OSPF6_NEIGHBOR_LOADING, on,
                                            OSPF6_NEIGHBOR_EVENT_EXCHANGE_DONE);
 
-               thread_add_event(master, ospf6_lsreq_send, on, 0,
-                                &on->thread_send_lsreq);
+               event_add_event(master, ospf6_lsreq_send, on, 0,
+                               &on->thread_send_lsreq);
        }
 }
 
@@ -428,11 +428,11 @@ void ospf6_check_nbr_loading(struct ospf6_neighbor *on)
        if ((on->state == OSPF6_NEIGHBOR_LOADING)
            || (on->state == OSPF6_NEIGHBOR_EXCHANGE)) {
                if (on->request_list->count == 0)
-                       thread_add_event(master, loading_done, on, 0, NULL);
+                       event_add_event(master, loading_done, on, 0, NULL);
                else if (on->last_ls_req == NULL) {
                        THREAD_OFF(on->thread_send_lsreq);
-                       thread_add_event(master, ospf6_lsreq_send, on, 0,
-                                        &on->thread_send_lsreq);
+                       event_add_event(master, ospf6_lsreq_send, on, 0,
+                                       &on->thread_send_lsreq);
                }
        }
 }
@@ -474,8 +474,8 @@ void adj_ok(struct event *thread)
                SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT);
 
                THREAD_OFF(on->thread_send_dbdesc);
-               thread_add_event(master, ospf6_dbdesc_send, on, 0,
-                                &on->thread_send_dbdesc);
+               event_add_event(master, ospf6_dbdesc_send, on, 0,
+                               &on->thread_send_dbdesc);
 
        } else if (on->state >= OSPF6_NEIGHBOR_EXSTART && !need_adjacency(on)) {
                ospf6_neighbor_state_change(OSPF6_NEIGHBOR_TWOWAY, on,
@@ -508,8 +508,8 @@ void seqnumber_mismatch(struct event *thread)
        THREAD_OFF(on->thread_send_dbdesc);
        on->dbdesc_seqnum++; /* Incr seqnum as per RFC2328, sec 10.3 */
 
-       thread_add_event(master, ospf6_dbdesc_send, on, 0,
-                        &on->thread_send_dbdesc);
+       event_add_event(master, ospf6_dbdesc_send, on, 0,
+                       &on->thread_send_dbdesc);
 }
 
 void bad_lsreq(struct event *thread)
@@ -536,9 +536,8 @@ void bad_lsreq(struct event *thread)
        THREAD_OFF(on->thread_send_dbdesc);
        on->dbdesc_seqnum++; /* Incr seqnum as per RFC2328, sec 10.3 */
 
-       thread_add_event(master, ospf6_dbdesc_send, on, 0,
-                        &on->thread_send_dbdesc);
-
+       event_add_event(master, ospf6_dbdesc_send, on, 0,
+                       &on->thread_send_dbdesc);
 }
 
 void oneway_received(struct event *thread)
@@ -556,7 +555,7 @@ void oneway_received(struct event *thread)
 
        ospf6_neighbor_state_change(OSPF6_NEIGHBOR_INIT, on,
                                    OSPF6_NEIGHBOR_EVENT_ONEWAY_RCVD);
-       thread_add_event(master, neighbor_change, on->ospf6_if, 0, NULL);
+       event_add_event(master, neighbor_change, on->ospf6_if, 0, NULL);
 
        ospf6_neighbor_clear_ls_lists(on);
 
@@ -588,8 +587,7 @@ void inactivity_timer(struct event *thread)
                ospf6_neighbor_state_change(
                        OSPF6_NEIGHBOR_DOWN, on,
                        OSPF6_NEIGHBOR_EVENT_INACTIVITY_TIMER);
-               thread_add_event(master, neighbor_change, on->ospf6_if, 0,
-                                NULL);
+               event_add_event(master, neighbor_change, on->ospf6_if, 0, NULL);
 
                listnode_delete(on->ospf6_if->neighbor_list, on);
                ospf6_neighbor_delete(on);
@@ -600,9 +598,9 @@ void inactivity_timer(struct event *thread)
                                "%s, Acting as HELPER for this neighbour, So restart the dead timer.",
                                __PRETTY_FUNCTION__);
 
-               thread_add_timer(master, inactivity_timer, on,
-                                on->ospf6_if->dead_interval,
-                                &on->inactivity_timer);
+               event_add_timer(master, inactivity_timer, on,
+                               on->ospf6_if->dead_interval,
+                               &on->inactivity_timer);
        }
 }
 
index c5627212f8c0df1bea274c3a54b9637529f1bab8..60b7cc59e9c7af364903f78b6676b541b2c21c69 100644 (file)
@@ -29,11 +29,11 @@ extern int ospf6_recvmsg(struct in6_addr *src, struct in6_addr *dst,
                        listnode_add(oi->area->ospf6->oi_write_q, (oi));       \
                        (oi)->on_write_q = 1;                                  \
                }                                                              \
-               if (list_was_empty                                             \
-                   && !list_isempty(oi->area->ospf6->oi_write_q))             \
-                       thread_add_write(master, ospf6_write, oi->area->ospf6, \
-                                        oi->area->ospf6->fd,                  \
-                                        &oi->area->ospf6->t_write);           \
+               if (list_was_empty &&                                          \
+                   !list_isempty(oi->area->ospf6->oi_write_q))                \
+                       event_add_write(master, ospf6_write, oi->area->ospf6,  \
+                                       oi->area->ospf6->fd,                   \
+                                       &oi->area->ospf6->t_write);            \
        } while (0)
 
 #endif /* OSPF6_NETWORK_H */
index 6bae9b6175f5d746027937084174299deaa3933e..ca48b25d680b533794889c199bb1d1576ef3be95 100644 (file)
@@ -1001,8 +1001,8 @@ void ospf6_schedule_abr_task(struct ospf6 *ospf6)
        if (IS_OSPF6_DEBUG_ABR)
                zlog_debug("Scheduling ABR task");
 
-       thread_add_timer(master, ospf6_abr_task_timer, ospf6,
-                        OSPF6_ABR_TASK_DELAY, &ospf6->t_abr_task);
+       event_add_timer(master, ospf6_abr_task_timer, ospf6,
+                       OSPF6_ABR_TASK_DELAY, &ospf6->t_abr_task);
 }
 
 /* Flush the NSSA LSAs from the area */
@@ -1090,8 +1090,8 @@ static void ospf6_ase_lsa_refresh(struct ospf6 *o)
                                        o->lsdb);
                if (old) {
                        THREAD_OFF(old->refresh);
-                       thread_add_event(master, ospf6_lsa_refresh, old, 0,
-                                        &old->refresh);
+                       event_add_event(master, ospf6_lsa_refresh, old, 0,
+                                       &old->refresh);
                } else {
                        ospf6_as_external_lsa_originate(route, o);
                }
@@ -1165,8 +1165,8 @@ void ospf6_area_nssa_update(struct ospf6_area *area)
                                if (IS_OSPF6_DEBUG_NSSA)
                                        ospf6_lsa_header_print(lsa);
                                THREAD_OFF(lsa->refresh);
-                               thread_add_event(master, ospf6_lsa_refresh, lsa,
-                                                0, &lsa->refresh);
+                               event_add_event(master, ospf6_lsa_refresh, lsa,
+                                               0, &lsa->refresh);
                        }
                }
        }
index d2366be46854e7c0a33a4a0d16327d4977f111f2..051fd83f6d6e4af60b64d64bf17adfd55577cff0 100644 (file)
@@ -725,8 +725,8 @@ void ospf6_spf_schedule(struct ospf6 *ospf6, unsigned int reason)
                zlog_debug("SPF: Rescheduling in %ld msec", delay);
 
        THREAD_OFF(ospf6->t_spf_calc);
-       thread_add_timer_msec(master, ospf6_spf_calculation_thread, ospf6,
-                             delay, &ospf6->t_spf_calc);
+       event_add_timer_msec(master, ospf6_spf_calculation_thread, ospf6, delay,
+                            &ospf6->t_spf_calc);
 }
 
 void ospf6_spf_display_subtree(struct vty *vty, const char *prefix, int rest,
@@ -1272,6 +1272,6 @@ void ospf6_ase_calculate_timer_add(struct ospf6 *ospf6)
        if (ospf6 == NULL)
                return;
 
-       thread_add_timer(master, ospf6_ase_calculate_timer, ospf6,
-                        OSPF6_ASE_CALC_INTERVAL, &ospf6->t_ase_calc);
+       event_add_timer(master, ospf6_ase_calculate_timer, ospf6,
+                       OSPF6_ASE_CALC_INTERVAL, &ospf6->t_ase_calc);
 }
index ad4e58ae241fb852bcba7938ce389657c54ace80..203d344b3a246b5360b3d12d3f1e3974a0c38ce9 100644 (file)
@@ -207,8 +207,8 @@ static int ospf6_vrf_enable(struct vrf *vrf)
                        ret = ospf6_serv_sock(ospf6);
                        if (ret < 0 || ospf6->fd <= 0)
                                return 0;
-                       thread_add_read(master, ospf6_receive, ospf6, ospf6->fd,
-                                       &ospf6->t_ospf6_receive);
+                       event_add_read(master, ospf6_receive, ospf6, ospf6->fd,
+                                      &ospf6->t_ospf6_receive);
 
                        ospf6_router_id_update(ospf6, true);
                }
@@ -471,8 +471,8 @@ struct ospf6 *ospf6_instance_create(const char *name)
         */
        ospf6_gr_nvm_read(ospf6);
 
-       thread_add_read(master, ospf6_receive, ospf6, ospf6->fd,
-                       &ospf6->t_ospf6_receive);
+       event_add_read(master, ospf6_receive, ospf6, ospf6->fd,
+                      &ospf6->t_ospf6_receive);
 
        return ospf6;
 }
@@ -619,9 +619,9 @@ static void ospf6_maxage_remover(struct event *thread)
 void ospf6_maxage_remove(struct ospf6 *o)
 {
        if (o)
-               thread_add_timer(master, ospf6_maxage_remover, o,
-                                OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT,
-                                &o->maxage_remover);
+               event_add_timer(master, ospf6_maxage_remover, o,
+                               OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT,
+                               &o->maxage_remover);
 }
 
 bool ospf6_router_id_update(struct ospf6 *ospf6, bool init)
index 2c554c9b76c618248369ba6e7f62ca7cd6a10276..689e58addedc069c1cad48407b046c16dee39866 100644 (file)
@@ -157,7 +157,7 @@ static void lsa_read(struct event *thread)
        }
 
        /* Reschedule read thread */
-       thread_add_read(master, lsa_read, oclient, fd, NULL);
+       event_add_read(master, lsa_read, oclient, fd, NULL);
 }
 
 /* ---------------------------------------------------------
@@ -209,13 +209,13 @@ static void ready_callback(uint8_t lsa_type, uint8_t opaque_type,
                 lsa_type, opaque_type, &addr);
 
        /* Schedule opaque LSA originate in 5 secs */
-       thread_add_timer(master, lsa_inject, oclient, 5, NULL);
+       event_add_timer(master, lsa_inject, oclient, 5, NULL);
 
        /* Schedule opaque LSA update with new value */
-       thread_add_timer(master, lsa_inject, oclient, 10, NULL);
+       event_add_timer(master, lsa_inject, oclient, 10, NULL);
 
        /* Schedule delete */
-       thread_add_timer(master, lsa_delete, oclient, 30, NULL);
+       event_add_timer(master, lsa_delete, oclient, 30, NULL);
 }
 
 static void new_if_callback(struct in_addr ifaddr, struct in_addr area_id)
@@ -316,7 +316,7 @@ int main(int argc, char *argv[])
        ospf_apiclient_sync_lsdb(oclient);
 
        /* Schedule thread that handles asynchronous messages */
-       thread_add_read(master, lsa_read, oclient, oclient->fd_async, NULL);
+       event_add_read(master, lsa_read, oclient, oclient->fd_async, NULL);
 
        /* Now connection is established, run loop */
        while (1) {
index aa1798ff98743772228aeab76a33381910509b0d..a00e58b2f1ae9206e7a351bd9a50f32a90e61b70 100644 (file)
@@ -2040,9 +2040,9 @@ void ospf_abr_task(struct ospf *ospf)
                         * giving time for route synchronization in
                         * all the routers.
                         */
-                       thread_add_timer(
-                               master, ospf_abr_announce_non_dna_routers, ospf,
-                               OSPF_ABR_DNA_TIMER, &ospf->t_abr_fr);
+                       event_add_timer(master,
+                                       ospf_abr_announce_non_dna_routers, ospf,
+                                       OSPF_ABR_DNA_TIMER, &ospf->t_abr_fr);
                }
        }
 
@@ -2077,6 +2077,6 @@ void ospf_schedule_abr_task(struct ospf *ospf)
        if (IS_DEBUG_OSPF_EVENT)
                zlog_debug("Scheduling ABR task");
 
-       thread_add_timer(master, ospf_abr_task_timer, ospf, OSPF_ABR_TASK_DELAY,
-                        &ospf->t_abr_task);
+       event_add_timer(master, ospf_abr_task_timer, ospf, OSPF_ABR_TASK_DELAY,
+                       &ospf->t_abr_task);
 }
index 56731b751ab78efb5cf383bdf111b89fcfe2bd69..79626142f108c3f5d4aa74ae682fbba8f0740414 100644 (file)
@@ -278,28 +278,28 @@ void ospf_apiserver_event(enum ospf_apiserver_event event, int fd,
 {
        switch (event) {
        case OSPF_APISERVER_ACCEPT:
-               (void)thread_add_read(master, ospf_apiserver_accept, apiserv,
-                                     fd, NULL);
+               (void)event_add_read(master, ospf_apiserver_accept, apiserv, fd,
+                                    NULL);
                break;
        case OSPF_APISERVER_SYNC_READ:
                apiserv->t_sync_read = NULL;
-               thread_add_read(master, ospf_apiserver_read, apiserv, fd,
-                               &apiserv->t_sync_read);
+               event_add_read(master, ospf_apiserver_read, apiserv, fd,
+                              &apiserv->t_sync_read);
                break;
 #ifdef USE_ASYNC_READ
        case OSPF_APISERVER_ASYNC_READ:
                apiserv->t_async_read = NULL;
-               thread_add_read(master, ospf_apiserver_read, apiserv, fd,
-                               &apiserv->t_async_read);
+               event_add_read(master, ospf_apiserver_read, apiserv, fd,
+                              &apiserv->t_async_read);
                break;
 #endif /* USE_ASYNC_READ */
        case OSPF_APISERVER_SYNC_WRITE:
-               thread_add_write(master, ospf_apiserver_sync_write, apiserv, fd,
-                                &apiserv->t_sync_write);
+               event_add_write(master, ospf_apiserver_sync_write, apiserv, fd,
+                               &apiserv->t_sync_write);
                break;
        case OSPF_APISERVER_ASYNC_WRITE:
-               thread_add_write(master, ospf_apiserver_async_write, apiserv,
-                                fd, &apiserv->t_async_write);
+               event_add_write(master, ospf_apiserver_async_write, apiserv, fd,
+                               &apiserv->t_async_write);
                break;
        }
 }
index 19f422d61387a42fdb113b84157c1ca89bbdd8a6..c9228c4eb901580b441e58a57195a03f08102cb6 100644 (file)
@@ -297,9 +297,9 @@ void ospf_schedule_asbr_nssa_redist_update(struct ospf *ospf)
        if (IS_DEBUG_OSPF_EVENT)
                zlog_debug("Scheduling ASBR NSSA redistribution update");
 
-       thread_add_timer(master, ospf_asbr_nssa_redist_update_timer, ospf,
-                        OSPF_ASBR_NSSA_REDIST_UPDATE_DELAY,
-                        &ospf->t_asbr_nssa_redist_update);
+       event_add_timer(master, ospf_asbr_nssa_redist_update_timer, ospf,
+                       OSPF_ASBR_NSSA_REDIST_UPDATE_DELAY,
+                       &ospf->t_asbr_nssa_redist_update);
 }
 
 void ospf_redistribute_withdraw(struct ospf *ospf, uint8_t type,
@@ -1093,8 +1093,8 @@ static void ospf_external_aggr_timer(struct ospf *ospf,
                           __func__, ospf->aggr_delay_interval);
 
        ospf->aggr_action = operation;
-       thread_add_timer(master, ospf_asbr_external_aggr_process, ospf,
-                        ospf->aggr_delay_interval, &ospf->t_external_aggr);
+       event_add_timer(master, ospf_asbr_external_aggr_process, ospf,
+                       ospf->aggr_delay_interval, &ospf->t_external_aggr);
 }
 
 int ospf_asbr_external_aggregator_set(struct ospf *ospf, struct prefix_ipv4 *p,
index 61f87bb2d0f98e07d6cb5e43c2d64f5fa46d31e6..9ad3d276d7253cf21c9c8e10c5033ec59ea2ce58 100644 (file)
@@ -630,8 +630,8 @@ void ospf_ase_calculate_timer_add(struct ospf *ospf)
        if (ospf == NULL)
                return;
 
-       thread_add_timer(master, ospf_ase_calculate_timer, ospf,
-                        OSPF_ASE_CALC_INTERVAL, &ospf->t_ase_calc);
+       event_add_timer(master, ospf_ase_calculate_timer, ospf,
+                       OSPF_ASE_CALC_INTERVAL, &ospf->t_ase_calc);
 }
 
 void ospf_ase_register_external_lsa(struct ospf_lsa *lsa, struct ospf *top)
index 8c1274739dd964407781971c44daa7f29568b30e..08706990142899508db61c18a7c811f4dea90e7c 100644 (file)
@@ -648,9 +648,9 @@ void ospf_gr_nvm_read(struct ospf *ospf)
                                zlog_debug(
                                        "GR: remaining time until grace period expires: %lu(s)",
                                        remaining_time);
-                       thread_add_timer(master, ospf_gr_grace_period_expired,
-                                        ospf, remaining_time,
-                                        &ospf->gr_info.t_grace_period);
+                       event_add_timer(master, ospf_gr_grace_period_expired,
+                                       ospf, remaining_time,
+                                       &ospf->gr_info.t_grace_period);
                }
        }
 
index fa78c53b1a76a4ffa6f6a7bbf1fe0562ad95206e..13ae3d9df929ab7b104fb6a94a1ea912155293ec 100644 (file)
@@ -533,9 +533,9 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa,
                           actual_grace_interval);
 
        /* Start the grace timer */
-       thread_add_timer(master, ospf_handle_grace_timer_expiry, restarter,
-                        actual_grace_interval,
-                        &restarter->gr_helper_info.t_grace_timer);
+       event_add_timer(master, ospf_handle_grace_timer_expiry, restarter,
+                       actual_grace_interval,
+                       &restarter->gr_helper_info.t_grace_timer);
 
        return OSPF_GR_ACTIVE_HELPER;
 }
index 4ae86a318af263fbdb0b1d690b3bdfc336681d04..d5261546e13501776121e0bd1a877cbb0926aa73 100644 (file)
                        oi->on_write_q = 1;                                    \
                }                                                              \
                if (!list_isempty((O)->oi_write_q))                            \
-                       thread_add_write(master, ospf_write, (O), (O)->fd,     \
-                                        &(O)->t_write);                       \
+                       event_add_write(master, ospf_write, (O), (O)->fd,      \
+                                       &(O)->t_write);                        \
        } while (0)
 
 /* Macro for OSPF ISM timer turn on. */
-#define OSPF_ISM_TIMER_ON(T, F, V) thread_add_timer(master, (F), oi, (V), &(T))
+#define OSPF_ISM_TIMER_ON(T, F, V) event_add_timer(master, (F), oi, (V), &(T))
 
 #define OSPF_ISM_TIMER_MSEC_ON(T, F, V)                                        \
-       thread_add_timer_msec(master, (F), oi, (V), &(T))
+       event_add_timer_msec(master, (F), oi, (V), &(T))
 
 /* convenience macro to set hello timer correctly, according to
  * whether fast-hello is set or not
@@ -65,7 +65,7 @@
 
 /* Macro for OSPF schedule event. */
 #define OSPF_ISM_EVENT_SCHEDULE(I, E)                                          \
-       thread_add_event(master, ospf_ism_event, (I), (E), NULL)
+       event_add_event(master, ospf_ism_event, (I), (E), NULL)
 
 /* Macro for OSPF execute event. */
 #define OSPF_ISM_EVENT_EXECUTE(I, E)                                           \
index 92e07dc5ee425efec9b38419b2098b6dbe31e835..c8ee9faf666a74809c7ee0ca01ba27562f04b9b8 100644 (file)
@@ -383,9 +383,8 @@ void ospf_ldp_sync_holddown_timer_add(struct interface *ifp)
        ols_debug("%s: start holddown timer for %s time %d", __func__,
                  ifp->name, ldp_sync_info->holddown);
 
-       thread_add_timer(master, ospf_ldp_sync_holddown_timer,
-                        ifp, ldp_sync_info->holddown,
-                        &ldp_sync_info->t_holddown);
+       event_add_timer(master, ospf_ldp_sync_holddown_timer, ifp,
+                       ldp_sync_info->holddown, &ldp_sync_info->t_holddown);
 }
 
 /*
index 92ad9951ab22151c12f28f8b7852e4d9f9723b9f..aa113b087a342e906be53d303f512321a9c5e35d 100644 (file)
@@ -3870,7 +3870,7 @@ void ospf_schedule_lsa_flood_area(struct ospf_area *area, struct ospf_lsa *lsa)
        data->area = area;
        data->lsa = ospf_lsa_lock(lsa); /* Message / Flood area */
 
-       thread_add_event(master, ospf_lsa_action, data, 0, NULL);
+       event_add_event(master, ospf_lsa_action, data, 0, NULL);
 }
 
 void ospf_schedule_lsa_flush_area(struct ospf_area *area, struct ospf_lsa *lsa)
@@ -3882,7 +3882,7 @@ void ospf_schedule_lsa_flush_area(struct ospf_area *area, struct ospf_lsa *lsa)
        data->area = area;
        data->lsa = ospf_lsa_lock(lsa); /* Message / Flush area */
 
-       thread_add_event(master, ospf_lsa_action, data, 0, NULL);
+       event_add_event(master, ospf_lsa_action, data, 0, NULL);
 }
 
 
@@ -4091,8 +4091,8 @@ void ospf_lsa_refresh_walker(struct event *t)
        }
 
        ospf->t_lsa_refresher = NULL;
-       thread_add_timer(master, ospf_lsa_refresh_walker, ospf,
-                        ospf->lsa_refresh_interval, &ospf->t_lsa_refresher);
+       event_add_timer(master, ospf_lsa_refresh_walker, ospf,
+                       ospf->lsa_refresh_interval, &ospf->t_lsa_refresher);
        ospf->lsa_refresher_started = monotime(NULL);
 
        for (ALL_LIST_ELEMENTS(lsa_to_refresh, node, nnode, lsa)) {
index c345be2869b37fea284143f717a3c8d98949d64b..140e8533fc9b518e851ed662a92fe6e0645d1869 100644 (file)
 #define OSPF_NSM_EVENT_MAX     14
 
 /* Macro for OSPF NSM timer turn on. */
-#define OSPF_NSM_TIMER_ON(T,F,V) thread_add_timer (master, (F), nbr, (V), &(T))
+#define OSPF_NSM_TIMER_ON(T, F, V) event_add_timer(master, (F), nbr, (V), &(T))
 
 /* Macro for OSPF NSM schedule event. */
 #define OSPF_NSM_EVENT_SCHEDULE(N, E)                                          \
-       thread_add_event(master, ospf_nsm_event, (N), (E), NULL)
+       event_add_event(master, ospf_nsm_event, (N), (E), NULL)
 
 /* Macro for OSPF NSM execute event. */
 #define OSPF_NSM_EVENT_EXECUTE(N, E)                                           \
index 1fe44cd1a94e9dd40e0f2a3e27c1147bf8bcf221..6cd26dd82846443d1af6adb93a037bb05101867c 100644 (file)
@@ -1332,8 +1332,8 @@ void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
                                "Schedule Type-9 Opaque-LSA origination in %d ms later.",
                                delay);
                oi->t_opaque_lsa_self = NULL;
-               thread_add_timer_msec(master, ospf_opaque_type9_lsa_originate,
-                                     oi, delay, &oi->t_opaque_lsa_self);
+               event_add_timer_msec(master, ospf_opaque_type9_lsa_originate,
+                                    oi, delay, &oi->t_opaque_lsa_self);
                delay += top->min_ls_interval;
        }
 
@@ -1350,8 +1350,8 @@ void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
                                "Schedule Type-10 Opaque-LSA origination in %d ms later.",
                                delay);
                area->t_opaque_lsa_self = NULL;
-               thread_add_timer_msec(master, ospf_opaque_type10_lsa_originate,
-                                     area, delay, &area->t_opaque_lsa_self);
+               event_add_timer_msec(master, ospf_opaque_type10_lsa_originate,
+                                    area, delay, &area->t_opaque_lsa_self);
                delay += top->min_ls_interval;
        }
 
@@ -1368,8 +1368,8 @@ void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
                                "Schedule Type-11 Opaque-LSA origination in %d ms later.",
                                delay);
                top->t_opaque_lsa_self = NULL;
-               thread_add_timer_msec(master, ospf_opaque_type11_lsa_originate,
-                                     top, delay, &top->t_opaque_lsa_self);
+               event_add_timer_msec(master, ospf_opaque_type11_lsa_originate,
+                                    top, delay, &top->t_opaque_lsa_self);
                delay += top->min_ls_interval;
        }
 
@@ -1643,7 +1643,8 @@ struct ospf_lsa *ospf_opaque_lsa_refresh(struct ospf_lsa *lsa)
  * triggered by external interventions (vty session, signaling, etc).
  *------------------------------------------------------------------------*/
 
-#define OSPF_OPAQUE_TIMER_ON(T,F,L,V) thread_add_timer_msec (master, (F), (L), (V), &(T))
+#define OSPF_OPAQUE_TIMER_ON(T, F, L, V)                                       \
+       event_add_timer_msec(master, (F), (L), (V), &(T))
 
 static struct ospf_lsa *pseudo_lsa(struct ospf_interface *oi,
                                   struct ospf_area *area, uint8_t lsa_type,
index 7c5fe441f1b951bdb83116769ed6043278af1771..d53f65e9465991c72f43525d57eb0a02c2707305 100644 (file)
@@ -457,7 +457,7 @@ static void ospf_ls_req_timer(struct event *thread)
 void ospf_ls_req_event(struct ospf_neighbor *nbr)
 {
        THREAD_OFF(nbr->t_ls_req);
-       thread_add_event(master, ospf_ls_req_timer, nbr, 0, &nbr->t_ls_req);
+       event_add_event(master, ospf_ls_req_timer, nbr, 0, &nbr->t_ls_req);
 }
 
 /* Cyclic timer function.  Fist registered in ospf_nbr_new () in
@@ -847,8 +847,8 @@ static void ospf_write(struct event *thread)
 
        /* If packets still remain in queue, call write thread. */
        if (!list_isempty(ospf->oi_write_q))
-               thread_add_write(master, ospf_write, ospf, ospf->fd,
-                                &ospf->t_write);
+               event_add_write(master, ospf_write, ospf, ospf->fd,
+                               &ospf->t_write);
 }
 
 /* OSPF Hello message read -- RFC2328 Section 10.5. */
@@ -3213,7 +3213,7 @@ void ospf_read(struct event *thread)
        ospf = THREAD_ARG(thread);
 
        /* prepare for next packet. */
-       thread_add_read(master, ospf_read, ospf, ospf->fd, &ospf->t_read);
+       event_add_read(master, ospf_read, ospf, ospf->fd, &ospf->t_read);
 
        while (count < ospf->write_oi_count) {
                count++;
@@ -4140,8 +4140,8 @@ static void ospf_ls_upd_send_queue_event(struct event *thread)
                                "%s: update lists not cleared, %d nodes to try again, raising new event",
                                __func__, again);
                oi->t_ls_upd_event = NULL;
-               thread_add_event(master, ospf_ls_upd_send_queue_event, oi, 0,
-                                &oi->t_ls_upd_event);
+               event_add_event(master, ospf_ls_upd_send_queue_event, oi, 0,
+                               &oi->t_ls_upd_event);
        }
 
        if (IS_DEBUG_OSPF_EVENT)
@@ -4212,8 +4212,8 @@ void ospf_ls_upd_send(struct ospf_neighbor *nbr, struct list *update, int flag,
                                               rn->p.u.prefix4, 1);
                }
        } else
-               thread_add_event(master, ospf_ls_upd_send_queue_event, oi, 0,
-                                &oi->t_ls_upd_event);
+               event_add_event(master, ospf_ls_upd_send_queue_event, oi, 0,
+                               &oi->t_ls_upd_event);
 }
 
 static void ospf_ls_ack_send_list(struct ospf_interface *oi, struct list *ack,
@@ -4276,8 +4276,8 @@ void ospf_ls_ack_send(struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
 
        listnode_add(oi->ls_ack_direct.ls_ack, ospf_lsa_lock(lsa));
 
-       thread_add_event(master, ospf_ls_ack_send_event, oi, 0,
-                        &oi->t_ls_ack_direct);
+       event_add_event(master, ospf_ls_ack_send_event, oi, 0,
+                       &oi->t_ls_ack_direct);
 }
 
 /* Send Link State Acknowledgment delayed. */
index 314b89933e932c8157b378549eb69a6c573fa717..39497291dcdef1afe715b4aa2f304aa2e352455e 100644 (file)
@@ -2044,8 +2044,8 @@ void ospf_spf_calculate_schedule(struct ospf *ospf, ospf_spf_reason_t reason)
                zlog_debug("SPF: calculation timer delay = %ld msec", delay);
 
        ospf->t_spf_calc = NULL;
-       thread_add_timer_msec(master, ospf_spf_calculate_schedule_worker, ospf,
-                             delay, &ospf->t_spf_calc);
+       event_add_timer_msec(master, ospf_spf_calculate_schedule_worker, ospf,
+                            delay, &ospf->t_spf_calc);
 }
 
 /* Restart OSPF SPF algorithm*/
index 34614c0fbcaad916aaac01dcb86bd767a5b7de0c..efe4f4ecc386a69e527e3d652819d7653fd87d6e 100644 (file)
@@ -496,8 +496,8 @@ static int ospf_sr_start(struct ospf *ospf)
        if (!ospf_zebra_label_manager_ready())
                if (ospf_zebra_label_manager_connect() < 0) {
                        /* Re-attempt to connect to Label Manager in 1 sec. */
-                       thread_add_timer(master, sr_start_label_manager, ospf,
-                                        1, &OspfSR.t_start_lm);
+                       event_add_timer(master, sr_start_label_manager, ospf, 1,
+                                       &OspfSR.t_start_lm);
                        osr_debug("  |- Failed to start the Label Manager");
                        return -1;
                }
index c101913bc4044793eb4d178cc0febb1a5ff49f23..4fddd1e81f65237c87d48a029709e7abe22dbc9e 100644 (file)
@@ -579,8 +579,8 @@ void ospf_external_del(struct ospf *ospf, uint8_t type, unsigned short instance)
        /*
         * Check if default needs to be flushed too.
         */
-       thread_add_event(master, ospf_external_lsa_default_routemap_timer, ospf,
-                        0, &ospf->t_default_routemap_timer);
+       event_add_event(master, ospf_external_lsa_default_routemap_timer, ospf,
+                       0, &ospf->t_default_routemap_timer);
 }
 
 /* Update NHLFE for Prefix SID */
@@ -1124,9 +1124,9 @@ static bool ospf_external_lsa_default_routemap_apply(struct ospf *ospf,
                 * there are any other external info which can still trigger
                 * default route origination else flush it.
                 */
-               thread_add_event(master,
-                                ospf_external_lsa_default_routemap_timer, ospf,
-                                0, &ospf->t_default_routemap_timer);
+               event_add_event(master,
+                               ospf_external_lsa_default_routemap_timer, ospf,
+                               0, &ospf->t_default_routemap_timer);
        }
 
        return true;
@@ -1641,9 +1641,8 @@ void ospf_distribute_list_update(struct ospf *ospf, int type,
                return;
 
        /* Set timer. If timer is already started, this call does nothing. */
-       thread_add_timer_msec(master, ospf_distribute_list_update_timer, ospf,
-                             ospf->min_ls_interval,
-                             &ospf->t_distribute_update);
+       event_add_timer_msec(master, ospf_distribute_list_update_timer, ospf,
+                            ospf->min_ls_interval, &ospf->t_distribute_update);
 }
 
 /* If access-list is updated, apply some check. */
index b167002b0b7b31811bafb6bf14875cecc58bd465..a9e2aaabc36275fae6fe14021d39c88847d76623 100644 (file)
@@ -385,8 +385,8 @@ struct ospf *ospf_new_alloc(unsigned short instance, const char *name)
        new->maxage_delay = OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT;
        new->maxage_lsa = route_table_init();
        new->t_maxage_walker = NULL;
-       thread_add_timer(master, ospf_lsa_maxage_walker, new,
-                        OSPF_LSA_MAXAGE_CHECK_INTERVAL, &new->t_maxage_walker);
+       event_add_timer(master, ospf_lsa_maxage_walker, new,
+                       OSPF_LSA_MAXAGE_CHECK_INTERVAL, &new->t_maxage_walker);
 
        /* Max paths initialization */
        new->max_multipath = MULTIPATH_NUM;
@@ -398,8 +398,8 @@ struct ospf *ospf_new_alloc(unsigned short instance, const char *name)
        new->lsa_refresh_interval = OSPF_LSA_REFRESH_INTERVAL_DEFAULT;
        new->lsa_refresh_timer = OSPF_LS_REFRESH_TIME;
        new->t_lsa_refresher = NULL;
-       thread_add_timer(master, ospf_lsa_refresh_walker, new,
-                        new->lsa_refresh_interval, &new->t_lsa_refresher);
+       event_add_timer(master, ospf_lsa_refresh_walker, new,
+                       new->lsa_refresh_interval, &new->t_lsa_refresher);
        new->lsa_refresher_started = monotime(NULL);
 
        new->ibuf = stream_new(OSPF_MAX_PACKET_SIZE + 1);
@@ -441,7 +441,7 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)
                return new;
        }
 
-       thread_add_read(master, ospf_read, new, new->fd, &new->t_read);
+       event_add_read(master, ospf_read, new, new->fd, &new->t_read);
 
        new->oi_running = 1;
        ospf_router_id_update(new);
@@ -1860,8 +1860,8 @@ int ospf_timers_refresh_set(struct ospf *ospf, int interval)
 
        if (time_left > interval) {
                THREAD_OFF(ospf->t_lsa_refresher);
-               thread_add_timer(master, ospf_lsa_refresh_walker, ospf,
-                                interval, &ospf->t_lsa_refresher);
+               event_add_timer(master, ospf_lsa_refresh_walker, ospf, interval,
+                               &ospf->t_lsa_refresher);
        }
        ospf->lsa_refresh_interval = interval;
 
@@ -1878,9 +1878,9 @@ int ospf_timers_refresh_unset(struct ospf *ospf)
        if (time_left > OSPF_LSA_REFRESH_INTERVAL_DEFAULT) {
                THREAD_OFF(ospf->t_lsa_refresher);
                ospf->t_lsa_refresher = NULL;
-               thread_add_timer(master, ospf_lsa_refresh_walker, ospf,
-                                OSPF_LSA_REFRESH_INTERVAL_DEFAULT,
-                                &ospf->t_lsa_refresher);
+               event_add_timer(master, ospf_lsa_refresh_walker, ospf,
+                               OSPF_LSA_REFRESH_INTERVAL_DEFAULT,
+                               &ospf->t_lsa_refresher);
        }
 
        ospf->lsa_refresh_interval = OSPF_LSA_REFRESH_INTERVAL_DEFAULT;
@@ -2247,8 +2247,8 @@ static int ospf_vrf_enable(struct vrf *vrf)
                        ret = ospf_sock_init(ospf);
                        if (ret < 0 || ospf->fd <= 0)
                                return 0;
-                       thread_add_read(master, ospf_read, ospf, ospf->fd,
-                                       &ospf->t_read);
+                       event_add_read(master, ospf_read, ospf, ospf->fd,
+                                      &ospf->t_read);
                        ospf->oi_running = 1;
                        ospf_router_id_update(ospf);
                }
index 79c11b820e23b3f96c9108322d3ab6102426eca6..dcb5a30e67a41402b3f976b300b21df880b72dab 100644 (file)
@@ -653,9 +653,11 @@ struct ospf_nbr_nbma {
 #define LSA_OPTIONS_NSSA_GET(area)                                             \
        (((area)->external_routing == OSPF_AREA_NSSA) ? OSPF_OPTION_NP : 0)
 
-#define OSPF_TIMER_ON(T,F,V) thread_add_timer (master,(F),ospf,(V),&(T))
-#define OSPF_AREA_TIMER_ON(T,F,V) thread_add_timer (master, (F), area, (V), &(T))
-#define OSPF_POLL_TIMER_ON(T,F,V) thread_add_timer (master, (F), nbr_nbma, (V), &(T))
+#define OSPF_TIMER_ON(T, F, V) event_add_timer(master, (F), ospf, (V), &(T))
+#define OSPF_AREA_TIMER_ON(T, F, V)                                            \
+       event_add_timer(master, (F), area, (V), &(T))
+#define OSPF_POLL_TIMER_ON(T, F, V)                                            \
+       event_add_timer(master, (F), nbr_nbma, (V), &(T))
 
 /* Extern variables. */
 extern struct ospf_master *om;
index 92ab5a63bd716bb62d774bb8826af12dd47282d8..7df3143129d46e06e35a6391e5f20478ee68a8bd 100644 (file)
@@ -319,8 +319,8 @@ int pcep_ctrl_send_error(struct frr_pthread *fpt, int pcc_id,
 
 int pcep_ctrl_halt_cb(struct frr_pthread *fpt, void **res)
 {
-       thread_add_event(fpt->master, pcep_thread_finish_event_handler,
-                        (void *)fpt, 0, NULL);
+       event_add_event(fpt->master, pcep_thread_finish_event_handler,
+                       (void *)fpt, 0, NULL);
        pthread_join(fpt->thread, res);
 
        return 0;
@@ -469,8 +469,8 @@ int pcep_thread_refine_path(struct ctrl_state *ctrl_state, int pcc_id,
        data->continue_lsp_update_handler = cb;
        data->payload = payload;
 
-       thread_add_event(ctrl_state->main, pcep_refine_path_event_cb,
-                        (void *)data, 0, NULL);
+       event_add_event(ctrl_state->main, pcep_refine_path_event_cb,
+                       (void *)data, 0, NULL);
        return 0;
 }
 
@@ -535,8 +535,8 @@ int schedule_thread_timer_with_cb(struct ctrl_state *ctrl_state, int pcc_id,
        data->pcc_id = pcc_id;
        data->payload = payload;
 
-       thread_add_timer(ctrl_state->self, timer_cb, (void *)data, delay,
-                        thread);
+       event_add_timer(ctrl_state->self, timer_cb, (void *)data, delay,
+                       thread);
 
        return 0;
 }
@@ -640,11 +640,11 @@ int schedule_thread_socket(struct ctrl_state *ctrl_state, int pcc_id,
        data->payload = payload;
 
        if (is_read) {
-               thread_add_read(ctrl_state->self, socket_cb, (void *)data, fd,
-                               thread);
+               event_add_read(ctrl_state->self, socket_cb, (void *)data, fd,
+                              thread);
        } else {
-               thread_add_write(ctrl_state->self, socket_cb, (void *)data, fd,
-                                thread);
+               event_add_write(ctrl_state->self, socket_cb, (void *)data, fd,
+                               thread);
        }
 
        return 0;
@@ -702,7 +702,7 @@ int send_to_thread_with_cb(struct ctrl_state *ctrl_state, int pcc_id,
        data->pcc_id = pcc_id;
        data->payload = payload;
 
-       thread_add_event(ctrl_state->self, event_cb, (void *)data, 0, NULL);
+       event_add_event(ctrl_state->self, event_cb, (void *)data, 0, NULL);
 
        return 0;
 }
@@ -964,8 +964,8 @@ int send_to_main(struct ctrl_state *ctrl_state, int pcc_id,
        data->pcc_id = pcc_id;
        data->payload = payload;
 
-       thread_add_event(ctrl_state->main, pcep_main_event_handler,
-                        (void *)data, 0, NULL);
+       event_add_event(ctrl_state->main, pcep_main_event_handler, (void *)data,
+                       0, NULL);
        return 0;
 }
 
index d39371041ff82c3bf3c51dea76acd272ad868ff1..0a2a74cb4298e5976d44ade8e3d2484bac33c751 100644 (file)
@@ -583,9 +583,9 @@ enum zclient_send_status path_ted_link_state_sync(void)
                PATH_TED_DEBUG("%s: PATHD-TED: Opaque asked for TED sync ",
                               __func__);
        }
-       thread_add_timer(ted_state_g.main, path_ted_timer_handler_sync,
-                        &ted_state_g, ted_state_g.link_state_delay_interval,
-                        &ted_state_g.t_link_state_sync);
+       event_add_timer(ted_state_g.main, path_ted_timer_handler_sync,
+                       &ted_state_g, ted_state_g.link_state_delay_interval,
+                       &ted_state_g.t_link_state_sync);
 
        return status;
 }
@@ -619,10 +619,9 @@ int path_ted_segment_list_refresh(void)
        int status = 0;
 
        path_ted_timer_refresh_cancel();
-       thread_add_timer(ted_state_g.main, path_ted_timer_handler_refresh,
-                        &ted_state_g,
-                        ted_state_g.segment_list_refresh_interval,
-                        &ted_state_g.t_segment_list_refresh);
+       event_add_timer(ted_state_g.main, path_ted_timer_handler_refresh,
+                       &ted_state_g, ted_state_g.segment_list_refresh_interval,
+                       &ted_state_g.t_segment_list_refresh);
 
        return status;
 }
index b11d90905aa8e11d71264106b0e1c129d1927fa4..0b7792a5cc6b433fb75e510ff535b9335de3ecd9 100644 (file)
@@ -1293,8 +1293,8 @@ void trigger_pathd_candidate_created(struct srte_candidate *candidate)
        from changing the candidate by hand with the console */
        if (candidate->hook_timer != NULL)
                return;
-       thread_add_timer(master, trigger_pathd_candidate_created_timer,
-                        (void *)candidate, HOOK_DELAY, &candidate->hook_timer);
+       event_add_timer(master, trigger_pathd_candidate_created_timer,
+                       (void *)candidate, HOOK_DELAY, &candidate->hook_timer);
 }
 
 void trigger_pathd_candidate_created_timer(struct event *thread)
@@ -1313,8 +1313,8 @@ void trigger_pathd_candidate_updated(struct srte_candidate *candidate)
        from changing the candidate by hand with the console */
        if (candidate->hook_timer != NULL)
                return;
-       thread_add_timer(master, trigger_pathd_candidate_updated_timer,
-                        (void *)candidate, HOOK_DELAY, &candidate->hook_timer);
+       event_add_timer(master, trigger_pathd_candidate_updated_timer,
+                       (void *)candidate, HOOK_DELAY, &candidate->hook_timer);
 }
 
 void trigger_pathd_candidate_updated_timer(struct event *thread)
index b0bcfcf5f0bceb525bad9b3f5aa6b8ec4090434b..98b311f6040571d38140f3964e7457e8a2cb6ff4 100644 (file)
@@ -1048,8 +1048,8 @@ static void gm_t_expire(struct event *t)
                                        log_ifp("next general expiry in %" PRId64 "ms"),
                                        remain_ms / 1000);
 
-                       thread_add_timer_tv(router->master, gm_t_expire, gm_ifp,
-                                           &remain, &gm_ifp->t_expire);
+                       event_add_timer_tv(router->master, gm_t_expire, gm_ifp,
+                                          &remain, &gm_ifp->t_expire);
                        return;
                }
 
@@ -1119,8 +1119,8 @@ static void gm_handle_q_general(struct gm_if *gm_ifp,
                        zlog_debug(
                                log_ifp("starting general timer @ 0: %pTVMu"),
                                &pend->expiry);
-               thread_add_timer_tv(router->master, gm_t_expire, gm_ifp,
-                                   &timers->expire_wait, &gm_ifp->t_expire);
+               event_add_timer_tv(router->master, gm_t_expire, gm_ifp,
+                                  &timers->expire_wait, &gm_ifp->t_expire);
        } else if (PIM_DEBUG_GM_TRACE)
                zlog_debug(log_ifp("appending general timer @ %u: %pTVMu"),
                           gm_ifp->n_pending, &pend->expiry);
@@ -1215,8 +1215,8 @@ static void gm_sg_timer_start(struct gm_if *gm_ifp, struct gm_sg *sg,
                THREAD_OFF(sg->t_sg_expire);
        }
 
-       thread_add_timer_tv(router->master, gm_t_sg_expire, sg, &expire_wait,
-                           &sg->t_sg_expire);
+       event_add_timer_tv(router->master, gm_t_sg_expire, sg, &expire_wait,
+                          &sg->t_sg_expire);
 }
 
 static void gm_handle_q_groupsrc(struct gm_if *gm_ifp,
@@ -1329,8 +1329,8 @@ static void gm_handle_q_group(struct gm_if *gm_ifp,
        }
 
        monotime(&pend->query);
-       thread_add_timer_tv(router->master, gm_t_grp_expire, pend,
-                           &timers->expire_wait, &pend->t_expire);
+       event_add_timer_tv(router->master, gm_t_grp_expire, pend,
+                          &timers->expire_wait, &pend->t_expire);
 
        if (PIM_DEBUG_GM_TRACE)
                zlog_debug(log_ifp("*,%pPAs S,G timer started: %pTHD"), &grp,
@@ -1470,9 +1470,8 @@ static void gm_handle_query(struct gm_if *gm_ifp,
                THREAD_OFF(gm_ifp->t_other_querier);
 
                other_ms = timers.qrv * timers.qqic_ms + timers.max_resp_ms / 2;
-               thread_add_timer_msec(router->master, gm_t_other_querier,
-                                     gm_ifp, other_ms,
-                                     &gm_ifp->t_other_querier);
+               event_add_timer_msec(router->master, gm_t_other_querier, gm_ifp,
+                                    other_ms, &gm_ifp->t_other_querier);
        }
 
        if (len == sizeof(struct mld_v1_pkt)) {
@@ -1607,8 +1606,8 @@ static void gm_t_recv(struct event *t)
        ssize_t nread;
        size_t pktlen;
 
-       thread_add_read(router->master, gm_t_recv, pim, pim->gm_socket,
-                       &pim->t_gm_recv);
+       event_add_read(router->master, gm_t_recv, pim, pim->gm_socket,
+                      &pim->t_gm_recv);
 
        iov->iov_base = rxbuf;
        iov->iov_len = sizeof(rxbuf);
@@ -1868,8 +1867,8 @@ static void gm_t_query(struct event *t)
                gm_ifp->n_startup--;
        }
 
-       thread_add_timer_msec(router->master, gm_t_query, gm_ifp, timer_ms,
-                             &gm_ifp->t_query);
+       event_add_timer_msec(router->master, gm_t_query, gm_ifp, timer_ms,
+                            &gm_ifp->t_query);
 
        gm_send_query(gm_ifp, PIMADDR_ANY, NULL, 0, false);
 }
@@ -1910,9 +1909,9 @@ static void gm_trigger_specific(struct gm_sg *sg)
 
        sg->n_query--;
        if (sg->n_query)
-               thread_add_timer_msec(router->master, gm_t_sg_query, sg,
-                                     gm_ifp->cur_query_intv_trig,
-                                     &sg->t_sg_query);
+               event_add_timer_msec(router->master, gm_t_sg_query, sg,
+                                    gm_ifp->cur_query_intv_trig,
+                                    &sg->t_sg_query);
 
        if (!IPV6_ADDR_SAME(&gm_ifp->querier, &pim_ifp->ll_lowest))
                return;
@@ -1938,9 +1937,8 @@ static void gm_trigger_specific(struct gm_sg *sg)
                pend_gsq->iface = gm_ifp;
                gm_gsq_pends_add(gm_ifp->gsq_pends, pend_gsq);
 
-               thread_add_timer_tv(router->master, gm_t_gsq_pend, pend_gsq,
-                                   &gm_ifp->cfg_timing_fuzz,
-                                   &pend_gsq->t_send);
+               event_add_timer_tv(router->master, gm_t_gsq_pend, pend_gsq,
+                                  &gm_ifp->cfg_timing_fuzz, &pend_gsq->t_send);
        }
 
        assert(pend_gsq->n_src < array_size(pend_gsq->srcs));
@@ -2046,8 +2044,8 @@ static void gm_vrf_socket_incref(struct pim_instance *pim)
                                vrf->name);
        }
 
-       thread_add_read(router->master, gm_t_recv, pim, pim->gm_socket,
-                       &pim->t_gm_recv);
+       event_add_read(router->master, gm_t_recv, pim, pim->gm_socket,
+                      &pim->t_gm_recv);
 }
 
 static void gm_vrf_socket_decref(struct pim_instance *pim)
index 9dfb6174ce532859aa9058847e75edcd8540d3fa..6478d539ae42f68f2f9a608372b01dca913262ce 100644 (file)
@@ -547,8 +547,8 @@ static void pim_assert_timer_set(struct pim_ifchannel *ch, int interval)
                           __func__, ch->sg_str, interval, ch->interface->name);
        }
 
-       thread_add_timer(router->master, on_assert_timer, ch, interval,
-                        &ch->t_ifassert_timer);
+       event_add_timer(router->master, on_assert_timer, ch, interval,
+                       &ch->t_ifassert_timer);
 }
 
 static void pim_assert_timer_reset(struct pim_ifchannel *ch)
index b9132f771e23cb10934cb4df817fdd6e40863590..ec2bfdcb2981f3e7edd271ea6421cc41402017c1 100644 (file)
@@ -204,8 +204,8 @@ static void pim_bs_timer_start(struct bsm_scope *scope, int bs_timeout)
                zlog_debug(
                        "%s : starting bs timer for scope %d with timeout %d secs",
                        __func__, scope->sz_id, bs_timeout);
-       thread_add_timer(router->master, pim_on_bs_timer, scope, bs_timeout,
-                        &scope->bs_timer);
+       event_add_timer(router->master, pim_on_bs_timer, scope, bs_timeout,
+                       &scope->bs_timer);
 }
 
 static inline void pim_bs_timer_restart(struct bsm_scope *scope, int bs_timeout)
@@ -338,8 +338,8 @@ static void pim_g2rp_timer_start(struct bsm_rpinfo *bsrp, int hold_time)
                        __func__, &bsrp->bsgrp_node->group, &bsrp->rp_address,
                        hold_time, bsrp->rp_holdtime);
 
-       thread_add_timer(router->master, pim_on_g2rp_timer, bsrp, hold_time,
-                        &bsrp->g2rp_timer);
+       event_add_timer(router->master, pim_on_g2rp_timer, bsrp, hold_time,
+                       &bsrp->g2rp_timer);
 }
 
 static inline void pim_g2rp_timer_restart(struct bsm_rpinfo *bsrp,
index bb457306f175b3b50024372216f3b4d4a2cb4c3e..80fc2879c5a28ff229258dc054a5bdaff548ed25 100644 (file)
@@ -980,8 +980,8 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr,
        }
 
        if (holdtime != 0xFFFF) {
-               thread_add_timer(router->master, on_ifjoin_expiry_timer, ch,
-                                holdtime, &ch->t_ifjoin_expiry_timer);
+               event_add_timer(router->master, on_ifjoin_expiry_timer, ch,
+                               holdtime, &ch->t_ifjoin_expiry_timer);
        }
 }
 
@@ -1032,13 +1032,13 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream,
 
                        THREAD_OFF(ch->t_ifjoin_prune_pending_timer);
                        THREAD_OFF(ch->t_ifjoin_expiry_timer);
-                       thread_add_timer_msec(
-                               router->master, on_ifjoin_prune_pending_timer,
-                               ch, jp_override_interval_msec,
-                               &ch->t_ifjoin_prune_pending_timer);
-                       thread_add_timer(router->master, on_ifjoin_expiry_timer,
-                                        ch, holdtime,
-                                        &ch->t_ifjoin_expiry_timer);
+                       event_add_timer_msec(router->master,
+                                            on_ifjoin_prune_pending_timer, ch,
+                                            jp_override_interval_msec,
+                                            &ch->t_ifjoin_prune_pending_timer);
+                       event_add_timer(router->master, on_ifjoin_expiry_timer,
+                                       ch, holdtime,
+                                       &ch->t_ifjoin_expiry_timer);
                        pim_upstream_update_join_desired(pim_ifp->pim,
                                                         ch->upstream);
                }
@@ -1069,10 +1069,10 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream,
                   be taken not to use "ch" afterwards since it would be
                   deleted. */
                THREAD_OFF(ch->t_ifjoin_prune_pending_timer);
-               thread_add_timer_msec(router->master,
-                                     on_ifjoin_prune_pending_timer, ch,
-                                     jp_override_interval_msec,
-                                     &ch->t_ifjoin_prune_pending_timer);
+               event_add_timer_msec(router->master,
+                                    on_ifjoin_prune_pending_timer, ch,
+                                    jp_override_interval_msec,
+                                    &ch->t_ifjoin_prune_pending_timer);
                break;
        case PIM_IFJOIN_PRUNE:
                if (source_flags & PIM_ENCODE_RPT_BIT) {
@@ -1095,27 +1095,27 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream,
                                THREAD_OFF(ch->t_ifjoin_expiry_timer);
                        }
 
-                       thread_add_timer(router->master, on_ifjoin_expiry_timer,
-                                        ch, holdtime,
-                                        &ch->t_ifjoin_expiry_timer);
+                       event_add_timer(router->master, on_ifjoin_expiry_timer,
+                                       ch, holdtime,
+                                       &ch->t_ifjoin_expiry_timer);
                }
                break;
        case PIM_IFJOIN_PRUNE_TMP:
                if (source_flags & PIM_ENCODE_RPT_BIT) {
                        ch->ifjoin_state = PIM_IFJOIN_PRUNE;
                        THREAD_OFF(ch->t_ifjoin_expiry_timer);
-                       thread_add_timer(router->master, on_ifjoin_expiry_timer,
-                                        ch, holdtime,
-                                        &ch->t_ifjoin_expiry_timer);
+                       event_add_timer(router->master, on_ifjoin_expiry_timer,
+                                       ch, holdtime,
+                                       &ch->t_ifjoin_expiry_timer);
                }
                break;
        case PIM_IFJOIN_PRUNE_PENDING_TMP:
                if (source_flags & PIM_ENCODE_RPT_BIT) {
                        ch->ifjoin_state = PIM_IFJOIN_PRUNE_PENDING;
                        THREAD_OFF(ch->t_ifjoin_expiry_timer);
-                       thread_add_timer(router->master, on_ifjoin_expiry_timer,
-                                        ch, holdtime,
-                                        &ch->t_ifjoin_expiry_timer);
+                       event_add_timer(router->master, on_ifjoin_expiry_timer,
+                                       ch, holdtime,
+                                       &ch->t_ifjoin_expiry_timer);
                }
                break;
        }
index 3c1b0959d849f0946ed239c8b792cc0439e1392d..a8c125df22e70c7f28e372d7b4bc71708584f462 100644 (file)
@@ -420,9 +420,9 @@ void pim_igmp_other_querier_timer_on(struct gm_sock *igmp)
                        other_querier_present_interval_msec % 1000);
        }
 
-       thread_add_timer_msec(router->master, pim_igmp_other_querier_expire,
-                             igmp, other_querier_present_interval_msec,
-                             &igmp->t_other_querier_timer);
+       event_add_timer_msec(router->master, pim_igmp_other_querier_expire,
+                            igmp, other_querier_present_interval_msec,
+                            &igmp->t_other_querier_timer);
 }
 
 void pim_igmp_other_querier_timer_off(struct gm_sock *igmp)
@@ -865,8 +865,8 @@ void pim_igmp_general_query_on(struct gm_sock *igmp)
                        ifaddr_str, query_interval,
                        startup_mode ? "startup" : "non-startup", igmp->fd);
        }
-       thread_add_timer(router->master, pim_igmp_general_query, igmp,
-                        query_interval, &igmp->t_igmp_query_timer);
+       event_add_timer(router->master, pim_igmp_general_query, igmp,
+                       query_interval, &igmp->t_igmp_query_timer);
 }
 
 void pim_igmp_general_query_off(struct gm_sock *igmp)
@@ -1243,8 +1243,8 @@ static void igmp_read_on(struct gm_sock *igmp)
                zlog_debug("Scheduling READ event on IGMP socket fd=%d",
                           igmp->fd);
        }
-       thread_add_read(router->master, pim_igmp_read, igmp, igmp->fd,
-                       &igmp->t_igmp_read);
+       event_add_read(router->master, pim_igmp_read, igmp, igmp->fd,
+                      &igmp->t_igmp_read);
 }
 
 struct gm_sock *pim_igmp_sock_add(struct list *igmp_sock_list,
@@ -1375,8 +1375,8 @@ void igmp_group_timer_on(struct gm_group *group, long interval_msec,
        */
        assert(group->group_filtermode_isexcl);
 
-       thread_add_timer_msec(router->master, igmp_group_timer, group,
-                             interval_msec, &group->t_group_timer);
+       event_add_timer_msec(router->master, igmp_group_timer, group,
+                            interval_msec, &group->t_group_timer);
 }
 
 struct gm_group *find_group_by_addr(struct gm_sock *igmp,
index 3c7b1fc827af68ce07806a5ffb13d28bfb858252..1906516a995b0c85a1156053830167f8d0eb1f01 100644 (file)
@@ -209,8 +209,8 @@ static void igmp_source_timer_on(struct gm_group *group,
                        source_str, group->interface->name);
        }
 
-       thread_add_timer_msec(router->master, igmp_source_timer, source,
-                             interval_msec, &source->t_source_timer);
+       event_add_timer_msec(router->master, igmp_source_timer, source,
+                            interval_msec, &source->t_source_timer);
 
        /*
          RFC 3376: 6.3. IGMPv3 Source-Specific Forwarding Rules
@@ -1281,9 +1281,8 @@ static void group_retransmit_timer_on(struct gm_group *group)
                        group->interface->name);
        }
 
-       thread_add_timer_msec(router->master, igmp_group_retransmit, group,
-                             lmqi_msec,
-                             &group->t_group_query_retransmit_timer);
+       event_add_timer_msec(router->master, igmp_group_retransmit, group,
+                            lmqi_msec, &group->t_group_query_retransmit_timer);
 }
 
 static long igmp_group_timer_remain_msec(struct gm_group *group)
index be42cc996add236772bbb548f3061a36f72df59a..5d72eb65813c7b7d1a5273b331e20a82a433c97e 100644 (file)
@@ -952,8 +952,8 @@ void pim_mlag_register(void)
 
        router->mlag_process_register = true;
 
-       thread_add_event(router->master, pim_mlag_register_handler, NULL, 0,
-                        NULL);
+       event_add_event(router->master, pim_mlag_register_handler, NULL, 0,
+                       NULL);
 }
 
 static void pim_mlag_deregister_handler(struct event *thread)
@@ -980,8 +980,8 @@ void pim_mlag_deregister(void)
 
        router->mlag_process_register = false;
 
-       thread_add_event(router->master, pim_mlag_deregister_handler, NULL, 0,
-                        NULL);
+       event_add_event(router->master, pim_mlag_deregister_handler, NULL, 0,
+                       NULL);
 }
 
 void pim_if_configure_mlag_dualactive(struct pim_interface *pim_ifp)
index 56d127eb4bb819651e91a032f287f8b851e78f8c..f3c6ef650c69007f863c44cabdf7a92dbd56c4af 100644 (file)
@@ -809,8 +809,8 @@ done:
 
 static void mroute_read_on(struct pim_instance *pim)
 {
-       thread_add_read(router->master, mroute_read, pim, pim->mroute_socket,
-                       &pim->thread);
+       event_add_read(router->master, mroute_read, pim, pim->mroute_socket,
+                      &pim->thread);
 }
 
 static void mroute_read_off(struct pim_instance *pim)
index bb9096b4535edd7bd6e16b270eedffa0dce0d2c0..57f2245f97b0b8f001ff035c90c78785f6a39637 100644 (file)
@@ -70,9 +70,9 @@ static void pim_msdp_sa_adv_timer_setup(struct pim_instance *pim, bool start)
 {
        THREAD_OFF(pim->msdp.sa_adv_timer);
        if (start) {
-               thread_add_timer(pim->msdp.master, pim_msdp_sa_adv_timer_cb,
-                                pim, PIM_MSDP_SA_ADVERTISMENT_TIME,
-                                &pim->msdp.sa_adv_timer);
+               event_add_timer(pim->msdp.master, pim_msdp_sa_adv_timer_cb, pim,
+                               PIM_MSDP_SA_ADVERTISMENT_TIME,
+                               &pim->msdp.sa_adv_timer);
        }
 }
 
@@ -94,9 +94,9 @@ static void pim_msdp_sa_state_timer_setup(struct pim_msdp_sa *sa, bool start)
 {
        THREAD_OFF(sa->sa_state_timer);
        if (start) {
-               thread_add_timer(sa->pim->msdp.master,
-                                pim_msdp_sa_state_timer_cb, sa,
-                                PIM_MSDP_SA_HOLD_TIME, &sa->sa_state_timer);
+               event_add_timer(sa->pim->msdp.master,
+                               pim_msdp_sa_state_timer_cb, sa,
+                               PIM_MSDP_SA_HOLD_TIME, &sa->sa_state_timer);
        }
 }
 
@@ -886,8 +886,8 @@ static void pim_msdp_peer_hold_timer_setup(struct pim_msdp_peer *mp, bool start)
        struct pim_instance *pim = mp->pim;
        THREAD_OFF(mp->hold_timer);
        if (start) {
-               thread_add_timer(pim->msdp.master, pim_msdp_peer_hold_timer_cb,
-                                mp, pim->msdp.hold_time, &mp->hold_timer);
+               event_add_timer(pim->msdp.master, pim_msdp_peer_hold_timer_cb,
+                               mp, pim->msdp.hold_time, &mp->hold_timer);
        }
 }
 
@@ -911,9 +911,8 @@ static void pim_msdp_peer_ka_timer_setup(struct pim_msdp_peer *mp, bool start)
 {
        THREAD_OFF(mp->ka_timer);
        if (start) {
-               thread_add_timer(mp->pim->msdp.master,
-                                pim_msdp_peer_ka_timer_cb, mp,
-                                mp->pim->msdp.keep_alive, &mp->ka_timer);
+               event_add_timer(mp->pim->msdp.master, pim_msdp_peer_ka_timer_cb,
+                               mp, mp->pim->msdp.keep_alive, &mp->ka_timer);
        }
 }
 
@@ -975,9 +974,9 @@ static void pim_msdp_peer_cr_timer_setup(struct pim_msdp_peer *mp, bool start)
 {
        THREAD_OFF(mp->cr_timer);
        if (start) {
-               thread_add_timer(mp->pim->msdp.master,
-                                pim_msdp_peer_cr_timer_cb, mp,
-                                mp->pim->msdp.connection_retry, &mp->cr_timer);
+               event_add_timer(mp->pim->msdp.master, pim_msdp_peer_cr_timer_cb,
+                               mp, mp->pim->msdp.connection_retry,
+                               &mp->cr_timer);
        }
 }
 
index a4f9de0ebb3bc63ce57317e6e7471ae524185128..cae7dd17b6109f130dc16d04c175da065c4a4a11 100644 (file)
@@ -204,12 +204,12 @@ struct pim_msdp {
 };
 
 #define PIM_MSDP_PEER_READ_ON(mp)                                              \
-       thread_add_read(mp->pim->msdp.master, pim_msdp_read, mp, mp->fd,       \
-                       &mp->t_read)
+       event_add_read(mp->pim->msdp.master, pim_msdp_read, mp, mp->fd,        \
+                      &mp->t_read)
 
 #define PIM_MSDP_PEER_WRITE_ON(mp)                                             \
-       thread_add_write(mp->pim->msdp.master, pim_msdp_write, mp, mp->fd,     \
-                        &mp->t_write)
+       event_add_write(mp->pim->msdp.master, pim_msdp_write, mp, mp->fd,      \
+                       &mp->t_write)
 
 #define PIM_MSDP_PEER_READ_OFF(mp) thread_cancel(&mp->t_read)
 #define PIM_MSDP_PEER_WRITE_OFF(mp) thread_cancel(&mp->t_write)
index 97552e2b8f80654750dfe312eb55c19029f93d07..ff70cb8ca73f5263b7b985f27f3aa8c18dc98847 100644 (file)
@@ -68,8 +68,8 @@ static void pim_msdp_sock_accept(struct event *thread)
                return;
        }
        pim->msdp.listener.thread = NULL;
-       thread_add_read(router->master, pim_msdp_sock_accept, pim, accept_sock,
-                       &pim->msdp.listener.thread);
+       event_add_read(router->master, pim_msdp_sock_accept, pim, accept_sock,
+                      &pim->msdp.listener.thread);
 
        /* accept client connection. */
        msdp_sock = sockunion_accept(accept_sock, &su);
@@ -192,8 +192,8 @@ int pim_msdp_sock_listen(struct pim_instance *pim)
        /* add accept thread */
        listener->fd = sock;
        memcpy(&listener->su, &sin, socklen);
-       thread_add_read(pim->msdp.master, pim_msdp_sock_accept, pim, sock,
-                       &listener->thread);
+       event_add_read(pim->msdp.master, pim_msdp_sock_accept, pim, sock,
+                      &listener->thread);
 
        pim->msdp.flags |= PIM_MSDPF_LISTENER;
        return 0;
index 19e3b78d65013488532530d582049de9f0db2ad9..dbe2cbaf93de78226cee667008a2e2f13bb9525e 100644 (file)
@@ -234,8 +234,8 @@ void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime)
                           __func__, neigh->holdtime, &neigh->source_addr,
                           neigh->interface->name);
 
-       thread_add_timer(router->master, on_neighbor_timer, neigh,
-                        neigh->holdtime, &neigh->t_expire_timer);
+       event_add_timer(router->master, on_neighbor_timer, neigh,
+                       neigh->holdtime, &neigh->t_expire_timer);
 }
 
 static void on_neighbor_jp_timer(struct event *t)
@@ -253,15 +253,15 @@ static void on_neighbor_jp_timer(struct event *t)
        rpf.rpf_addr = neigh->source_addr;
        pim_joinprune_send(&rpf, neigh->upstream_jp_agg);
 
-       thread_add_timer(router->master, on_neighbor_jp_timer, neigh,
-                        router->t_periodic, &neigh->jp_timer);
+       event_add_timer(router->master, on_neighbor_jp_timer, neigh,
+                       router->t_periodic, &neigh->jp_timer);
 }
 
 static void pim_neighbor_start_jp_timer(struct pim_neighbor *neigh)
 {
        THREAD_OFF(neigh->jp_timer);
-       thread_add_timer(router->master, on_neighbor_jp_timer, neigh,
-                        router->t_periodic, &neigh->jp_timer);
+       event_add_timer(router->master, on_neighbor_jp_timer, neigh,
+                       router->t_periodic, &neigh->jp_timer);
 }
 
 static struct pim_neighbor *
index 2c31344739708e7af85fb7f9e8b7df4f90a4b1c7..bbe00aae6e558632d70002620cfb87a562a82e2c 100644 (file)
@@ -431,8 +431,8 @@ static void pim_sock_read_on(struct interface *ifp)
                zlog_debug("Scheduling READ event on PIM socket fd=%d",
                           pim_ifp->pim_sock_fd);
        }
-       thread_add_read(router->master, pim_sock_read, ifp,
-                       pim_ifp->pim_sock_fd, &pim_ifp->t_pim_sock_read);
+       event_add_read(router->master, pim_sock_read, ifp, pim_ifp->pim_sock_fd,
+                      &pim_ifp->t_pim_sock_read);
 }
 
 static int pim_sock_open(struct interface *ifp)
@@ -822,9 +822,8 @@ static void hello_resched(struct interface *ifp)
                           pim_ifp->pim_hello_period, ifp->name);
        }
        THREAD_OFF(pim_ifp->t_pim_hello_timer);
-       thread_add_timer(router->master, on_pim_hello_send, ifp,
-                        pim_ifp->pim_hello_period,
-                        &pim_ifp->t_pim_hello_timer);
+       event_add_timer(router->master, on_pim_hello_send, ifp,
+                       pim_ifp->pim_hello_period, &pim_ifp->t_pim_hello_timer);
 }
 
 /*
@@ -935,8 +934,8 @@ void pim_hello_restart_triggered(struct interface *ifp)
                           random_msec, ifp->name);
        }
 
-       thread_add_timer_msec(router->master, on_pim_hello_send, ifp,
-                             random_msec, &pim_ifp->t_pim_hello_timer);
+       event_add_timer_msec(router->master, on_pim_hello_send, ifp,
+                            random_msec, &pim_ifp->t_pim_hello_timer);
 }
 
 int pim_sock_add(struct interface *ifp)
index 2947dd05f7451da57e688197d35f8245b8638834..2073b4cb0d73333a53766ab687f3db302d4847f3 100644 (file)
@@ -300,8 +300,8 @@ static void ssmpingd_sock_read(struct event *t)
 
 static void ssmpingd_read_on(struct ssmpingd_sock *ss)
 {
-       thread_add_read(router->master, ssmpingd_sock_read, ss, ss->sock_fd,
-                       &ss->t_sock_read);
+       event_add_read(router->master, ssmpingd_sock_read, ss, ss->sock_fd,
+                      &ss->t_sock_read);
 }
 
 static struct ssmpingd_sock *ssmpingd_new(struct pim_instance *pim,
index 94d7b3172abc73a8318f3e637ff083b145fc22cd..b08c363269a0733fee9f6c8fb59e2e33045b09d4 100644 (file)
@@ -354,8 +354,8 @@ void join_timer_start(struct pim_upstream *up)
                pim_jp_agg_add_group(nbr->upstream_jp_agg, up, 1, nbr);
        else {
                THREAD_OFF(up->t_join_timer);
-               thread_add_timer(router->master, on_join_timer, up,
-                                router->t_periodic, &up->t_join_timer);
+               event_add_timer(router->master, on_join_timer, up,
+                               router->t_periodic, &up->t_join_timer);
        }
        pim_jp_agg_upstream_verification(up, true);
 }
@@ -383,8 +383,8 @@ static void pim_upstream_join_timer_restart_msec(struct pim_upstream *up,
        }
 
        THREAD_OFF(up->t_join_timer);
-       thread_add_timer_msec(router->master, on_join_timer, up, interval_msec,
-                             &up->t_join_timer);
+       event_add_timer_msec(router->master, on_join_timer, up, interval_msec,
+                            &up->t_join_timer);
 }
 
 void pim_update_suppress_timers(uint32_t suppress_time)
@@ -1483,8 +1483,8 @@ void pim_upstream_keep_alive_timer_start(struct pim_upstream *up, uint32_t time)
                                   up->sg_str);
        }
        THREAD_OFF(up->t_ka_timer);
-       thread_add_timer(router->master, pim_upstream_keep_alive_timer, up,
-                        time, &up->t_ka_timer);
+       event_add_timer(router->master, pim_upstream_keep_alive_timer, up, time,
+                       &up->t_ka_timer);
 
        /* any time keepalive is started against a SG we will have to
         * re-evaluate our active source database */
@@ -1506,8 +1506,8 @@ static void pim_upstream_msdp_reg_timer(struct event *t)
 void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up)
 {
        THREAD_OFF(up->t_msdp_reg_timer);
-       thread_add_timer(router->master, pim_upstream_msdp_reg_timer, up,
-                        PIM_MSDP_REG_RXED_PERIOD, &up->t_msdp_reg_timer);
+       event_add_timer(router->master, pim_upstream_msdp_reg_timer, up,
+                       PIM_MSDP_REG_RXED_PERIOD, &up->t_msdp_reg_timer);
 
        pim_msdp_sa_local_update(up);
 }
@@ -1768,8 +1768,8 @@ void pim_upstream_start_register_stop_timer(struct pim_upstream *up,
                        "%s: (S,G)=%s Starting upstream register stop timer %d",
                        __func__, up->sg_str, time);
        }
-       thread_add_timer(router->master, pim_upstream_register_stop_timer, up,
-                        time, &up->t_rs_timer);
+       event_add_timer(router->master, pim_upstream_register_stop_timer, up,
+                       time, &up->t_rs_timer);
 }
 
 int pim_upstream_inherited_olist_decide(struct pim_instance *pim,
index 995c14edd1f2320be9079fdf2f128a7cf2148f3a..56a88babdade540a707a994e01db5894fa156d64 100644 (file)
@@ -180,8 +180,8 @@ static void pim_vxlan_work_timer_setup(bool start)
 {
        THREAD_OFF(vxlan_info.work_timer);
        if (start)
-               thread_add_timer(router->master, pim_vxlan_work_timer_cb, NULL,
-                       PIM_VXLAN_WORK_TIME, &vxlan_info.work_timer);
+               event_add_timer(router->master, pim_vxlan_work_timer_cb, NULL,
+                               PIM_VXLAN_WORK_TIME, &vxlan_info.work_timer);
 }
 
 /**************************** vxlan origination mroutes ***********************
index e201d506826fe4c074afb387387c84887e620488..502dd7c8e5b12ee2f8a2ff7c53b7a6cf2295b4c2 100644 (file)
@@ -417,9 +417,9 @@ void sched_rpf_cache_refresh(struct pim_instance *pim)
                           router->rpf_cache_refresh_delay_msec);
        }
 
-       thread_add_timer_msec(router->master, on_rpf_cache_refresh, pim,
-                             router->rpf_cache_refresh_delay_msec,
-                             &pim->rpf_cache_refresher);
+       event_add_timer_msec(router->master, on_rpf_cache_refresh, pim,
+                            router->rpf_cache_refresh_delay_msec,
+                            &pim->rpf_cache_refresher);
 }
 
 static void pim_zebra_connected(struct zclient *zclient)
index 56d5ae8c6fff7a7147b0b40f6fb2e0640304b2d6..fa5cbac47f2df8da28b94c38561def1ad9c8050e 100644 (file)
@@ -65,15 +65,15 @@ static void zclient_lookup_connect(struct event *t)
                return;
        }
 
-       thread_add_timer(router->master, zclient_lookup_read_pipe, zlookup, 60,
-                        &zlookup_read);
+       event_add_timer(router->master, zclient_lookup_read_pipe, zlookup, 60,
+                       &zlookup_read);
 }
 
 /* Schedule connection with delay. */
 static void zclient_lookup_sched(struct zclient *zlookup, int delay)
 {
-       thread_add_timer(router->master, zclient_lookup_connect, zlookup, delay,
-                        &zlookup->t_connect);
+       event_add_timer(router->master, zclient_lookup_connect, zlookup, delay,
+                       &zlookup->t_connect);
 
        zlog_notice("%s: zclient lookup connection scheduled for %d seconds",
                    __func__, delay);
@@ -82,8 +82,8 @@ static void zclient_lookup_sched(struct zclient *zlookup, int delay)
 /* Schedule connection for now. */
 static void zclient_lookup_sched_now(struct zclient *zlookup)
 {
-       thread_add_event(router->master, zclient_lookup_connect, zlookup, 0,
-                        &zlookup->t_connect);
+       event_add_event(router->master, zclient_lookup_connect, zlookup, 0,
+                       &zlookup->t_connect);
 
        zlog_notice("%s: zclient lookup immediate connection scheduled",
                    __func__);
@@ -378,8 +378,8 @@ void zclient_lookup_read_pipe(struct event *thread)
        }
 
        zclient_lookup_nexthop_once(pim, nexthop_tab, 10, l);
-       thread_add_timer(router->master, zclient_lookup_read_pipe, zlookup, 60,
-                        &zlookup_read);
+       event_add_timer(router->master, zclient_lookup_read_pipe, zlookup, 60,
+                       &zlookup_read);
 }
 
 int zclient_lookup_nexthop(struct pim_instance *pim,
index afa7896633cbefecc58b1bd2360b1081596454dd..d6b2621ff4b6fb4a2d35fa64e71f6c3ecfb81c54 100644 (file)
@@ -209,8 +209,8 @@ int pim_mlag_signal_zpthread(void)
                if (PIM_DEBUG_MLAG)
                        zlog_debug(":%s: Scheduling PIM MLAG write Thread",
                                   __func__);
-               thread_add_event(router->master, pim_mlag_zthread_handler, NULL,
-                                0, &router->zpthread_mlag_write);
+               event_add_event(router->master, pim_mlag_zthread_handler, NULL,
+                               0, &router->zpthread_mlag_write);
        }
        return (0);
 }
index a32913766c60fb9a2630378f7319deeac58fb35f..a085bc3f968bb3597b1c6529eb788352c0ee1be0 100644 (file)
@@ -885,8 +885,8 @@ void rip_enable_apply(struct interface *ifp)
                        zlog_debug("turn on %s", ifp->name);
 
                /* Add interface wake up thread. */
-               thread_add_timer(master, rip_interface_wakeup, ifp, 1,
-                                &ri->t_wakeup);
+               event_add_timer(master, rip_interface_wakeup, ifp, 1,
+                               &ri->t_wakeup);
                rip_connect_set(ifp, 1);
        } else if (ri->running) {
                /* Might as well clean up the route table as well
index 88094e98367b6f185652a9c00dbb1162dc834cb1..99338f4e8ad039f06f33839859ae245409af7ab7 100644 (file)
@@ -78,8 +78,8 @@ static struct rip_peer *rip_peer_get(struct rip *rip, struct in_addr *addr)
        }
 
        /* Update timeout thread. */
-       thread_add_timer(master, rip_peer_timeout, peer, RIP_PEER_TIMER_DEFAULT,
-                        &peer->t_timeout);
+       event_add_timer(master, rip_peer_timeout, peer, RIP_PEER_TIMER_DEFAULT,
+                       &peer->t_timeout);
 
        /* Last update time set. */
        time(&peer->uptime);
index 8cc339e7c6ae9a68040edaf212f62e977743dade..70bcfef4e480676e6175b7ccc232bf90dab2f036 100644 (file)
@@ -299,8 +299,8 @@ static void rip_timeout_update(struct rip *rip, struct rip_info *rinfo)
 {
        if (rinfo->metric != RIP_METRIC_INFINITY) {
                THREAD_OFF(rinfo->t_timeout);
-               thread_add_timer(master, rip_timeout, rinfo, rip->timeout_time,
-                                &rinfo->t_timeout);
+               event_add_timer(master, rip_timeout, rinfo, rip->timeout_time,
+                               &rinfo->t_timeout);
        }
 }
 
@@ -2558,8 +2558,8 @@ static void rip_triggered_update(struct event *t)
         update is triggered when the timer expires. */
        interval = (frr_weak_random() % 5) + 1;
 
-       thread_add_timer(master, rip_triggered_interval, rip, interval,
-                        &rip->t_triggered_interval);
+       event_add_timer(master, rip_triggered_interval, rip, interval,
+                       &rip->t_triggered_interval);
 }
 
 /* Withdraw redistributed route. */
@@ -2766,21 +2766,21 @@ void rip_event(struct rip *rip, enum rip_event event, int sock)
 
        switch (event) {
        case RIP_READ:
-               thread_add_read(master, rip_read, rip, sock, &rip->t_read);
+               event_add_read(master, rip_read, rip, sock, &rip->t_read);
                break;
        case RIP_UPDATE_EVENT:
                THREAD_OFF(rip->t_update);
                jitter = rip_update_jitter(rip->update_time);
-               thread_add_timer(master, rip_update, rip,
-                                sock ? 2 : rip->update_time + jitter,
-                                &rip->t_update);
+               event_add_timer(master, rip_update, rip,
+                               sock ? 2 : rip->update_time + jitter,
+                               &rip->t_update);
                break;
        case RIP_TRIGGERED_UPDATE:
                if (rip->t_triggered_interval)
                        rip->trigger = 1;
                else
-                       thread_add_event(master, rip_triggered_update, rip, 0,
-                                        &rip->t_triggered_update);
+                       event_add_event(master, rip_triggered_update, rip, 0,
+                                       &rip->t_triggered_update);
                break;
        default:
                break;
index b987ee1a4299dfd3cf566c6154d55ed33cfa036c..4ae13e0d19eba7bd09d7be4e1528a6c427853771 100644 (file)
@@ -387,7 +387,7 @@ enum rip_event {
 };
 
 /* Macro for timer turn on. */
-#define RIP_TIMER_ON(T,F,V) thread_add_timer (master, (F), rinfo, (V), &(T))
+#define RIP_TIMER_ON(T, F, V) event_add_timer(master, (F), rinfo, (V), &(T))
 
 #define RIP_OFFSET_LIST_IN  0
 #define RIP_OFFSET_LIST_OUT 1
index 139afca7d26fdd01dcd476ded183323ac2ce9e9e..e88936cdaaa218ac51f78f0984dc792c00f39ce5 100644 (file)
@@ -698,8 +698,8 @@ void ripng_enable_apply(struct interface *ifp)
                zlog_info("RIPng INTERFACE ON %s", ifp->name);
 
                /* Add interface wake up thread. */
-               thread_add_timer(master, ripng_interface_wakeup, ifp, 1,
-                                &ri->t_wakeup);
+               event_add_timer(master, ripng_interface_wakeup, ifp, 1,
+                               &ri->t_wakeup);
 
                ripng_connect_set(ifp, 1);
        } else {
index dda10d1ce9a9f7b54ac862de1baec9f0680b20a9..a40f4b1eb6180afa5f1032b34eff91acded45436 100644 (file)
@@ -87,8 +87,8 @@ static struct ripng_peer *ripng_peer_get(struct ripng *ripng,
        }
 
        /* Update timeout thread. */
-       thread_add_timer(master, ripng_peer_timeout, peer,
-                        RIPNG_PEER_TIMER_DEFAULT, &peer->t_timeout);
+       event_add_timer(master, ripng_peer_timeout, peer,
+                       RIPNG_PEER_TIMER_DEFAULT, &peer->t_timeout);
 
        /* Last update time set. */
        time(&peer->uptime);
index 3bf0e3021e286c56d8c418df59a9add634b92379..00d0414b7efb31ac817d8d05a9126b5100b74735 100644 (file)
@@ -597,8 +597,8 @@ static void ripng_timeout_update(struct ripng *ripng, struct ripng_info *rinfo)
 {
        if (rinfo->metric != RIPNG_METRIC_INFINITY) {
                THREAD_OFF(rinfo->t_timeout);
-               thread_add_timer(master, ripng_timeout, rinfo,
-                                ripng->timeout_time, &rinfo->t_timeout);
+               event_add_timer(master, ripng_timeout, rinfo,
+                               ripng->timeout_time, &rinfo->t_timeout);
        }
 }
 
@@ -1493,8 +1493,8 @@ void ripng_triggered_update(struct event *t)
           update is triggered when the timer expires. */
        interval = (frr_weak_random() % 5) + 1;
 
-       thread_add_timer(master, ripng_triggered_interval, ripng, interval,
-                        &ripng->t_triggered_interval);
+       event_add_timer(master, ripng_triggered_interval, ripng, interval,
+                       &ripng->t_triggered_interval);
 }
 
 /* Write routing table entry to the stream and return next index of
@@ -1898,8 +1898,7 @@ void ripng_event(struct ripng *ripng, enum ripng_event event, int sock)
 
        switch (event) {
        case RIPNG_READ:
-               thread_add_read(master, ripng_read, ripng, sock,
-                               &ripng->t_read);
+               event_add_read(master, ripng_read, ripng, sock, &ripng->t_read);
                break;
        case RIPNG_UPDATE_EVENT:
                THREAD_OFF(ripng->t_update);
@@ -1907,16 +1906,16 @@ void ripng_event(struct ripng *ripng, enum ripng_event event, int sock)
                /* Update timer jitter. */
                jitter = ripng_update_jitter(ripng->update_time);
 
-               thread_add_timer(master, ripng_update, ripng,
-                                sock ? 2 : ripng->update_time + jitter,
-                                &ripng->t_update);
+               event_add_timer(master, ripng_update, ripng,
+                               sock ? 2 : ripng->update_time + jitter,
+                               &ripng->t_update);
                break;
        case RIPNG_TRIGGERED_UPDATE:
                if (ripng->t_triggered_interval)
                        ripng->trigger = 1;
                else
-                       thread_add_event(master, ripng_triggered_update, ripng,
-                                        0, &ripng->t_triggered_update);
+                       event_add_event(master, ripng_triggered_update, ripng,
+                                       0, &ripng->t_triggered_update);
                break;
        case RIPNG_ZEBRA:
        case RIPNG_REQUEST_EVENT:
index d5cdfe674aa30c92d0582fc6c7a4734d014d2a13..a80517b436fe94b3887a298a0a178e67781fca6e 100644 (file)
@@ -295,7 +295,7 @@ enum ripng_event {
 };
 
 /* RIPng timer on/off macro. */
-#define RIPNG_TIMER_ON(T,F,V) thread_add_timer (master, (F), rinfo, (V), &(T))
+#define RIPNG_TIMER_ON(T, F, V) event_add_timer(master, (F), rinfo, (V), &(T))
 
 #define RIPNG_OFFSET_LIST_IN  0
 #define RIPNG_OFFSET_LIST_OUT 1
index 175aca308a948c05dc37c267f2e5388fc306fc3d..a4a932e3cf36649618797f301408feaa1d1fe068 100644 (file)
@@ -105,7 +105,7 @@ static void *logpump_run(void *arg)
        getrusage(RUSAGE_SELF, &lp_rusage);
 #endif
 
-       thread_add_timer_msec(master, logpump_done, NULL, 0, NULL);
+       event_add_timer_msec(master, logpump_done, NULL, 0, NULL);
        return NULL;
 }
 
index ae089398e4bf939d49b835981ec43a7ffcddd146..937a445209a429a8d35196e182362a6b28cfc375 100644 (file)
@@ -38,12 +38,12 @@ static void test_timer(struct event *thread)
        int *count = THREAD_ARG(thread);
 
        printf("run %d of timer\n", (*count)++);
-       thread_add_timer(master, test_timer, count, 5, NULL);
+       event_add_timer(master, test_timer, count, 5, NULL);
 }
 
 static void test_timer_init(void)
 {
-       thread_add_timer(master, test_timer, &timer_count, 10, NULL);
+       event_add_timer(master, test_timer, &timer_count, 10, NULL);
 }
 
 static void test_vty_init(void)
index b274c3d3a5ca520a4602fab8e3a5616557b7939a..9a0e2406323e5b13c95b99be8fd09f05c2c6fadf 100644 (file)
@@ -479,7 +479,7 @@ void *grpc_client_test_start(void *arg)
 
        // Signal FRR event loop to stop
        test_debug("client: pthread: adding event to stop us");
-       thread_add_event(master, grpc_thread_stop, NULL, 0, NULL);
+       event_add_event(master, grpc_thread_stop, NULL, 0, NULL);
 
        test_debug("client: pthread: DONE (returning)");
 
@@ -542,7 +542,7 @@ int main(int argc, char **argv)
 
        static_startup();
 
-       thread_add_event(master, grpc_thread_start, NULL, 0, NULL);
+       event_add_event(master, grpc_thread_start, NULL, 0, NULL);
 
        /* Event Loop */
        struct event thread;
index 59da82b2f45ed8bb78f00526d8a3ff690212c265..9084bf55eb258ef63ecabf1d4872455a9621aaab 100644 (file)
@@ -68,8 +68,8 @@ static void clear_something(struct event *thread)
                slow_func(ws->vty, ws->str, ws->i);
                ws->i++;
                if (thread_should_yield(thread)) {
-                       thread_add_timer_msec(master, clear_something, ws, 0,
-                                             NULL);
+                       event_add_timer_msec(master, clear_something, ws, 0,
+                                            NULL);
                        return;
                }
        }
@@ -102,7 +102,7 @@ DEFUN (clear_foo,
        ws->vty = vty;
        ws->i = ITERS_FIRST;
 
-       thread_add_timer_msec(master, clear_something, ws, 0, NULL);
+       event_add_timer_msec(master, clear_something, ws, 0, NULL);
 
        return CMD_SUCCESS;
 }
index b2e3d8de695b170dc8e2ed18a26c68ae4ef76391..b54dbe775d8042380362aa3ab4579d0ca16de4a8 100644 (file)
@@ -119,8 +119,8 @@ int main(int argc, char **argv)
                /* Schedule timers to expire in 0..5 seconds */
                interval_msec = prng_rand(prng) % 5000;
                arg = XMALLOC(MTYPE_TMP, TIMESTR_LEN + 1);
-               thread_add_timer_msec(master, timer_func, arg, interval_msec,
-                                     &timers[i]);
+               event_add_timer_msec(master, timer_func, arg, interval_msec,
+                                    &timers[i]);
                ret = snprintf(arg, TIMESTR_LEN + 1, "%lld.%06lld",
                               (long long)timers[i]->u.sands.tv_sec,
                               (long long)timers[i]->u.sands.tv_usec);
index d4cd6538024c880d68ed0891071d9bab6c6d0c81..ba2aacc8bd4e53a244ed100be8cd72d7c02f79fd 100644 (file)
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
        /* create thread structures so they won't be allocated during the
         * time measurement */
        for (i = 0; i < SCHEDULE_TIMERS; i++) {
-               thread_add_timer_msec(master, dummy_func, NULL, 0, &timers[i]);
+               event_add_timer_msec(master, dummy_func, NULL, 0, &timers[i]);
        }
        for (i = 0; i < SCHEDULE_TIMERS; i++)
                thread_cancel(&timers[i]);
@@ -52,8 +52,8 @@ int main(int argc, char **argv)
                long interval_msec;
 
                interval_msec = prng_rand(prng) % (100 * SCHEDULE_TIMERS);
-               thread_add_timer_msec(master, dummy_func, NULL, interval_msec,
-                                     &timers[i]);
+               event_add_timer_msec(master, dummy_func, NULL, interval_msec,
+                                    &timers[i]);
        }
 
        monotime(&tv_lap);
index 836819c5464aeb91acf6c95f22dae2defd67bc26..58169a077873dde755ae05327048c1778454d346 100644 (file)
@@ -212,8 +212,8 @@ static void serverpartfn(void *arg, void *zmqsock, zmq_msg_t *msg,
        printf("server recv: %s\n", buf);
        fflush(stdout);
 
-       frrzmq_thread_add_write_msg(master, serverwritefn, NULL, msg_id,
-                                   zmqsock, &cb);
+       frrzmq_event_add_write_msg(master, serverwritefn, NULL, msg_id, zmqsock,
+                                  &cb);
 }
 
 static void serverfn(void *arg, void *zmqsock)
@@ -242,8 +242,8 @@ static void serverfn(void *arg, void *zmqsock)
        frrzmq_thread_cancel(&cb, &cb->read);
        frrzmq_thread_cancel(&cb, &cb->write);
 
-       frrzmq_thread_add_read_part(master, serverpartfn, NULL, NULL, zmqsock,
-                                   &cb);
+       frrzmq_event_add_read_part(master, serverpartfn, NULL, NULL, zmqsock,
+                                  &cb);
 }
 
 static void sigchld(void)
@@ -276,7 +276,7 @@ static void run_server(int syncfd)
                exit(1);
        }
 
-       frrzmq_thread_add_read_msg(master, serverfn, NULL, NULL, zmqsock, &cb);
+       frrzmq_event_add_read_msg(master, serverfn, NULL, NULL, zmqsock, &cb);
 
        write(syncfd, &dummy, sizeof(dummy));
        while (thread_fetch(master, &t))
index 51e8fb7b7ec1be0fd085ccf823ed0fdb1dcd54f7..634474fe492b273d40d8d7235723de539d9da491 100644 (file)
@@ -271,11 +271,11 @@ static bool is_thread_sched(const char *name, size_t len)
 {
 #define thread_prefix "_"
        static const char *const names[] = {
-               thread_prefix "thread_add_read_write",
-               thread_prefix "thread_add_timer",
-               thread_prefix "thread_add_timer_msec",
-               thread_prefix "thread_add_timer_tv",
-               thread_prefix "thread_add_event",
+               thread_prefix "event_add_read_write",
+               thread_prefix "event_add_timer",
+               thread_prefix "event_add_timer_msec",
+               thread_prefix "event_add_timer_tv",
+               thread_prefix "event_add_event",
                thread_prefix "thread_execute",
        };
        size_t i;
index 19d53c1a191c90adbf383298ce0ceec5a19dd3b5..0bccdce36a3d7599fcb9a5229342ff293e039ab3 100644 (file)
@@ -901,10 +901,10 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
                if (pkt->hdr.priority == 0) {
                        vrrp_send_advertisement(r);
                        THREAD_OFF(r->t_adver_timer);
-                       thread_add_timer_msec(
-                               master, vrrp_adver_timer_expire, r,
-                               r->vr->advertisement_interval * CS2MS,
-                               &r->t_adver_timer);
+                       event_add_timer_msec(master, vrrp_adver_timer_expire, r,
+                                            r->vr->advertisement_interval *
+                                                    CS2MS,
+                                            &r->t_adver_timer);
                } else if (pkt->hdr.priority > r->priority
                           || ((pkt->hdr.priority == r->priority)
                               && addrcmp > 0)) {
@@ -920,10 +920,10 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
                        }
                        vrrp_recalculate_timers(r);
                        THREAD_OFF(r->t_master_down_timer);
-                       thread_add_timer_msec(master,
-                                             vrrp_master_down_timer_expire, r,
-                                             r->master_down_interval * CS2MS,
-                                             &r->t_master_down_timer);
+                       event_add_timer_msec(master,
+                                            vrrp_master_down_timer_expire, r,
+                                            r->master_down_interval * CS2MS,
+                                            &r->t_master_down_timer);
                        vrrp_change_state(r, VRRP_STATE_BACKUP);
                } else {
                        /* Discard advertisement */
@@ -937,7 +937,7 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
        case VRRP_STATE_BACKUP:
                if (pkt->hdr.priority == 0) {
                        THREAD_OFF(r->t_master_down_timer);
-                       thread_add_timer_msec(
+                       event_add_timer_msec(
                                master, vrrp_master_down_timer_expire, r,
                                r->skew_time * CS2MS, &r->t_master_down_timer);
                } else if (!r->vr->preempt_mode
@@ -948,10 +948,10 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
                        }
                        vrrp_recalculate_timers(r);
                        THREAD_OFF(r->t_master_down_timer);
-                       thread_add_timer_msec(master,
-                                             vrrp_master_down_timer_expire, r,
-                                             r->master_down_interval * CS2MS,
-                                             &r->t_master_down_timer);
+                       event_add_timer_msec(master,
+                                            vrrp_master_down_timer_expire, r,
+                                            r->master_down_interval * CS2MS,
+                                            &r->t_master_down_timer);
                } else if (r->vr->preempt_mode
                           && pkt->hdr.priority < r->priority) {
                        /* Discard advertisement */
@@ -1039,7 +1039,7 @@ done:
        memset(r->ibuf, 0x00, sizeof(r->ibuf));
 
        if (resched)
-               thread_add_read(master, vrrp_read, r, r->sock_rx, &r->t_read);
+               event_add_read(master, vrrp_read, r, r->sock_rx, &r->t_read);
 }
 
 /*
@@ -1487,9 +1487,9 @@ static void vrrp_adver_timer_expire(struct event *thread)
                vrrp_send_advertisement(r);
 
                /* Reset the Adver_Timer to Advertisement_Interval */
-               thread_add_timer_msec(master, vrrp_adver_timer_expire, r,
-                                     r->vr->advertisement_interval * CS2MS,
-                                     &r->t_adver_timer);
+               event_add_timer_msec(master, vrrp_adver_timer_expire, r,
+                                    r->vr->advertisement_interval * CS2MS,
+                                    &r->t_adver_timer);
        } else {
                zlog_err(VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
                         "Adver_Timer expired in state '%s'; this is a bug",
@@ -1509,9 +1509,9 @@ static void vrrp_master_down_timer_expire(struct event *thread)
                  "Master_Down_Timer expired",
                  r->vr->vrid, family2str(r->family));
 
-       thread_add_timer_msec(master, vrrp_adver_timer_expire, r,
-                             r->vr->advertisement_interval * CS2MS,
-                             &r->t_adver_timer);
+       event_add_timer_msec(master, vrrp_adver_timer_expire, r,
+                            r->vr->advertisement_interval * CS2MS,
+                            &r->t_adver_timer);
        vrrp_change_state(r, VRRP_STATE_MASTER);
 }
 
@@ -1561,7 +1561,7 @@ static int vrrp_startup(struct vrrp_router *r)
        }
 
        /* Schedule listener */
-       thread_add_read(master, vrrp_read, r, r->sock_rx, &r->t_read);
+       event_add_read(master, vrrp_read, r, r->sock_rx, &r->t_read);
 
        /* Configure effective priority */
        assert(listhead(r->addrs));
@@ -1583,16 +1583,16 @@ static int vrrp_startup(struct vrrp_router *r)
        }
 
        if (r->priority == VRRP_PRIO_MASTER) {
-               thread_add_timer_msec(master, vrrp_adver_timer_expire, r,
-                                     r->vr->advertisement_interval * CS2MS,
-                                     &r->t_adver_timer);
+               event_add_timer_msec(master, vrrp_adver_timer_expire, r,
+                                    r->vr->advertisement_interval * CS2MS,
+                                    &r->t_adver_timer);
                vrrp_change_state(r, VRRP_STATE_MASTER);
        } else {
                r->master_adver_interval = r->vr->advertisement_interval;
                vrrp_recalculate_timers(r);
-               thread_add_timer_msec(master, vrrp_master_down_timer_expire, r,
-                                     r->master_down_interval * CS2MS,
-                                     &r->t_master_down_timer);
+               event_add_timer_msec(master, vrrp_master_down_timer_expire, r,
+                                    r->master_down_interval * CS2MS,
+                                    &r->t_master_down_timer);
                vrrp_change_state(r, VRRP_STATE_BACKUP);
        }
 
index dd737dd0a50a1e9eff5deb12c5163ec14305353c..8fb57872ebba9a8d5f8881fb251f1ed7b170c171 100644 (file)
@@ -3738,8 +3738,8 @@ static void vtysh_log_read(struct event *thread)
        const char *text;
        ssize_t ret;
 
-       thread_add_read(master, vtysh_log_read, vclient, vclient->log_fd,
-                       &vclient->log_reader);
+       event_add_read(master, vtysh_log_read, vclient, vclient->log_fd,
+                      &vclient->log_reader);
 
        ret = recv(vclient->log_fd, &buf, sizeof(buf), 0);
 
@@ -3835,9 +3835,9 @@ DEFPY (vtysh_terminal_monitor,
                        if (fd != -1) {
                                set_nonblocking(fd);
                                vclient->log_fd = fd;
-                               thread_add_read(master, vtysh_log_read, vclient,
-                                               vclient->log_fd,
-                                               &vclient->log_reader);
+                               event_add_read(master, vtysh_log_read, vclient,
+                                              vclient->log_fd,
+                                              &vclient->log_reader);
                        }
                        if (ret != CMD_SUCCESS) {
                                vty_out(vty, "%% failed to enable logs on %s\n",
index 8019555493acd89c53fe640b60304e86baf13a29..a1463c1296e2fa9f6faa391c57d33b27bd585cc2 100644 (file)
@@ -218,8 +218,8 @@ static struct event *vtysh_rl_read_thread;
 
 static void vtysh_rl_read(struct event *thread)
 {
-       thread_add_read(master, vtysh_rl_read, NULL, STDIN_FILENO,
-                       &vtysh_rl_read_thread);
+       event_add_read(master, vtysh_rl_read, NULL, STDIN_FILENO,
+                      &vtysh_rl_read_thread);
        rl_callback_read_char();
 }
 
@@ -231,8 +231,8 @@ static void vtysh_rl_run(void)
        master = thread_master_create(NULL);
 
        rl_callback_handler_install(vtysh_prompt(), vtysh_rl_callback);
-       thread_add_read(master, vtysh_rl_read, NULL, STDIN_FILENO,
-                       &vtysh_rl_read_thread);
+       event_add_read(master, vtysh_rl_read, NULL, STDIN_FILENO,
+                      &vtysh_rl_read_thread);
 
        while (!vtysh_loop_exited && thread_fetch(master, &thread))
                thread_call(&thread);
index 4ded379efbbc15cb9a20455fa195a7da72cdf93f..b3852f86bc826886057418f43e5cd71d45c8d1c4 100644 (file)
@@ -358,8 +358,8 @@ static void restart_kill(struct event *t_kill)
                zlog_err(
                        "%s %s child process appears to still be reading configuration, delaying for another %lu time",
                        restart->what, restart->name, gs.restart_timeout);
-               thread_add_timer(master, restart_kill, restart,
-                                gs.restart_timeout, &restart->t_kill);
+               event_add_timer(master, restart_kill, restart,
+                               gs.restart_timeout, &restart->t_kill);
                return;
        }
 
@@ -369,8 +369,8 @@ static void restart_kill(struct event *t_kill)
                (long)delay.tv_sec, (restart->kills ? SIGKILL : SIGTERM));
        kill(-restart->pid, (restart->kills ? SIGKILL : SIGTERM));
        restart->kills++;
-       thread_add_timer(master, restart_kill, restart, gs.restart_timeout,
-                        &restart->t_kill);
+       event_add_timer(master, restart_kill, restart, gs.restart_timeout,
+                       &restart->t_kill);
 }
 
 static struct restart_info *find_child(pid_t child)
@@ -505,8 +505,8 @@ static int run_job(struct restart_info *restart, const char *cmdtype,
                snprintf(cmd, sizeof(cmd), command, restart->name);
 #pragma GCC diagnostic pop
                if ((restart->pid = run_background(cmd)) > 0) {
-                       thread_add_timer(master, restart_kill, restart,
-                                        gs.restart_timeout, &restart->t_kill);
+                       event_add_timer(master, restart_kill, restart,
+                                       gs.restart_timeout, &restart->t_kill);
                        restart->what = cmdtype;
                        gs.numpids++;
                } else
@@ -529,29 +529,29 @@ static int run_job(struct restart_info *restart, const char *cmdtype,
 #define SET_READ_HANDLER(DMN)                                                  \
        do {                                                                   \
                (DMN)->t_read = NULL;                                          \
-               thread_add_read(master, handle_read, (DMN), (DMN)->fd,         \
-                               &(DMN)->t_read);                               \
+               event_add_read(master, handle_read, (DMN), (DMN)->fd,          \
+                              &(DMN)->t_read);                                \
        } while (0);
 
 #define SET_WAKEUP_DOWN(DMN)                                                   \
        do {                                                                   \
                (DMN)->t_wakeup = NULL;                                        \
-               thread_add_timer_msec(master, wakeup_down, (DMN),              \
-                                     FUZZY(gs.period), &(DMN)->t_wakeup);     \
+               event_add_timer_msec(master, wakeup_down, (DMN),               \
+                                    FUZZY(gs.period), &(DMN)->t_wakeup);      \
        } while (0);
 
 #define SET_WAKEUP_UNRESPONSIVE(DMN)                                           \
        do {                                                                   \
                (DMN)->t_wakeup = NULL;                                        \
-               thread_add_timer_msec(master, wakeup_unresponsive, (DMN),      \
-                                     FUZZY(gs.period), &(DMN)->t_wakeup);     \
+               event_add_timer_msec(master, wakeup_unresponsive, (DMN),       \
+                                    FUZZY(gs.period), &(DMN)->t_wakeup);      \
        } while (0);
 
 #define SET_WAKEUP_ECHO(DMN)                                                   \
        do {                                                                   \
                (DMN)->t_wakeup = NULL;                                        \
-               thread_add_timer_msec(master, wakeup_send_echo, (DMN),         \
-                                     FUZZY(gs.period), &(DMN)->t_wakeup);     \
+               event_add_timer_msec(master, wakeup_send_echo, (DMN),          \
+                                    FUZZY(gs.period), &(DMN)->t_wakeup);      \
        } while (0);
 
 static void wakeup_down(struct event *t_wakeup)
@@ -742,8 +742,8 @@ static void daemon_up(struct daemon *dmn, const char *why)
 
                THREAD_OFF(gs.t_operational);
 
-               thread_add_timer(master, daemon_restarting_operational, NULL,
-                                gs.operational_timeout, &gs.t_operational);
+               event_add_timer(master, daemon_restarting_operational, NULL,
+                               gs.operational_timeout, &gs.t_operational);
        }
 
        SET_WAKEUP_ECHO(dmn);
@@ -848,10 +848,10 @@ static int try_connect(struct daemon *dmn)
                        zlog_debug("%s: connection in progress", dmn->name);
                dmn->state = DAEMON_CONNECTING;
                dmn->fd = sock;
-               thread_add_write(master, check_connect, dmn, dmn->fd,
-                                &dmn->t_write);
-               thread_add_timer(master, wakeup_connect_hanging, dmn,
-                                gs.timeout, &dmn->t_wakeup);
+               event_add_write(master, check_connect, dmn, dmn->fd,
+                               &dmn->t_write);
+               event_add_timer(master, wakeup_connect_hanging, dmn, gs.timeout,
+                               &dmn->t_wakeup);
                SET_READ_HANDLER(dmn);
                return 0;
        }
@@ -876,8 +876,8 @@ static void set_phase(enum restart_phase new_phase)
        gs.phase = new_phase;
        thread_cancel(&gs.t_phase_hanging);
 
-       thread_add_timer(master, phase_hanging, NULL, PHASE_TIMEOUT,
-                        &gs.t_phase_hanging);
+       event_add_timer(master, phase_hanging, NULL, PHASE_TIMEOUT,
+                       &gs.t_phase_hanging);
 }
 
 static void phase_check(void)
@@ -1031,8 +1031,8 @@ static void wakeup_send_echo(struct event *t_wakeup)
                daemon_down(dmn, why);
        } else {
                gettimeofday(&dmn->echo_sent, NULL);
-               thread_add_timer(master, wakeup_no_answer, dmn, gs.timeout,
-                                &dmn->t_wakeup);
+               event_add_timer(master, wakeup_no_answer, dmn, gs.timeout,
+                               &dmn->t_wakeup);
        }
 }
 
@@ -1282,8 +1282,8 @@ static void watchfrr_init(int argc, char **argv)
        struct daemon *dmn, **add = &gs.daemons;
        char alldaemons[512] = "", *p = alldaemons;
 
-       thread_add_timer_msec(master, startup_timeout, NULL, STARTUP_TIMEOUT,
-                             &gs.t_startup_timeout);
+       event_add_timer_msec(master, startup_timeout, NULL, STARTUP_TIMEOUT,
+                            &gs.t_startup_timeout);
 
        for (i = optind; i < argc; i++) {
                dmn = XCALLOC(MTYPE_WATCHFRR_DAEMON, sizeof(*dmn));
@@ -1293,8 +1293,8 @@ static void watchfrr_init(int argc, char **argv)
                gs.numdaemons++;
                gs.numdown++;
                dmn->fd = -1;
-               thread_add_timer_msec(master, wakeup_init, dmn, 0,
-                                     &dmn->t_wakeup);
+               event_add_timer_msec(master, wakeup_init, dmn, 0,
+                                    &dmn->t_wakeup);
                dmn->restart.interval = gs.min_restart_interval;
                *add = dmn;
                add = &dmn->next;
index 697c448b8895d9870c1c0d80f713954e2e88a2d4..1cfcac858912b4028e146773205f5ff0b1b9c8c8 100644 (file)
@@ -156,12 +156,12 @@ enum fpm_nl_events {
 };
 
 #define FPM_RECONNECT(fnc)                                                     \
-       thread_add_event((fnc)->fthread->master, fpm_process_event, (fnc),     \
-                        FNE_INTERNAL_RECONNECT, &(fnc)->t_event)
+       event_add_event((fnc)->fthread->master, fpm_process_event, (fnc),      \
+                       FNE_INTERNAL_RECONNECT, &(fnc)->t_event)
 
 #define WALK_FINISH(fnc, ev)                                                   \
-       thread_add_event((fnc)->fthread->master, fpm_process_event, (fnc),     \
-                        (ev), NULL)
+       event_add_event((fnc)->fthread->master, fpm_process_event, (fnc),      \
+                       (ev), NULL)
 
 /*
  * Prototypes.
@@ -231,8 +231,8 @@ DEFUN(fpm_set_address, fpm_set_address_cmd,
        memcpy(&sin6->sin6_addr, naddr, sizeof(sin6->sin6_addr));
 
 ask_reconnect:
-       thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
-                        FNE_RECONNECT, &gfnc->t_event);
+       event_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
+                       FNE_RECONNECT, &gfnc->t_event);
        return CMD_SUCCESS;
 }
 
@@ -246,8 +246,8 @@ DEFUN(no_fpm_set_address, no_fpm_set_address_cmd,
       "FPM remote listening server port\n"
       "Remote FPM server port\n")
 {
-       thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
-                        FNE_DISABLE, &gfnc->t_event);
+       event_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
+                       FNE_DISABLE, &gfnc->t_event);
        return CMD_SUCCESS;
 }
 
@@ -260,8 +260,8 @@ DEFUN(fpm_use_nhg, fpm_use_nhg_cmd,
        if (gfnc->use_nhg)
                return CMD_SUCCESS;
 
-       thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
-                        FNE_TOGGLE_NHG, &gfnc->t_nhg);
+       event_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
+                       FNE_TOGGLE_NHG, &gfnc->t_nhg);
 
        return CMD_SUCCESS;
 }
@@ -276,8 +276,8 @@ DEFUN(no_fpm_use_nhg, no_fpm_use_nhg_cmd,
        if (!gfnc->use_nhg)
                return CMD_SUCCESS;
 
-       thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
-                        FNE_TOGGLE_NHG, &gfnc->t_nhg);
+       event_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
+                       FNE_TOGGLE_NHG, &gfnc->t_nhg);
 
        return CMD_SUCCESS;
 }
@@ -288,8 +288,8 @@ DEFUN(fpm_reset_counters, fpm_reset_counters_cmd,
       FPM_STR
       "FPM statistic counters\n")
 {
-       thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
-                        FNE_RESET_COUNTERS, &gfnc->t_event);
+       event_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
+                       FNE_RESET_COUNTERS, &gfnc->t_event);
        return CMD_SUCCESS;
 }
 
@@ -444,8 +444,8 @@ static void fpm_reconnect(struct fpm_nl_ctx *fnc)
        if (fnc->disabled)
                return;
 
-       thread_add_timer(fnc->fthread->master, fpm_connect, fnc, 3,
-                        &fnc->t_connect);
+       event_add_timer(fnc->fthread->master, fpm_connect, fnc, 3,
+                       &fnc->t_connect);
 }
 
 static void fpm_read(struct event *t)
@@ -482,8 +482,8 @@ static void fpm_read(struct event *t)
        }
 
        /* Schedule the next read */
-       thread_add_read(fnc->fthread->master, fpm_read, fnc, fnc->socket,
-                       &fnc->t_read);
+       event_add_read(fnc->fthread->master, fpm_read, fnc, fnc->socket,
+                      &fnc->t_read);
 
        /* We've got an interruption. */
        if (rv == -2)
@@ -646,12 +646,12 @@ static void fpm_write(struct event *t)
                 * Starting with LSPs walk all FPM objects, marking them
                 * as unsent and then replaying them.
                 */
-               thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
-                                &fnc->t_lspreset);
+               event_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
+                               &fnc->t_lspreset);
 
                /* Permit receiving messages now. */
-               thread_add_read(fnc->fthread->master, fpm_read, fnc,
-                               fnc->socket, &fnc->t_read);
+               event_add_read(fnc->fthread->master, fpm_read, fnc, fnc->socket,
+                              &fnc->t_read);
        }
 
        frr_mutex_lock_autounlock(&fnc->obuf_mutex);
@@ -708,8 +708,8 @@ static void fpm_write(struct event *t)
        /* Stream is not empty yet, we must schedule more writes. */
        if (STREAM_READABLE(fnc->obuf)) {
                stream_pulldown(fnc->obuf);
-               thread_add_write(fnc->fthread->master, fpm_write, fnc,
-                                fnc->socket, &fnc->t_write);
+               event_add_write(fnc->fthread->master, fpm_write, fnc,
+                               fnc->socket, &fnc->t_write);
                return;
        }
 }
@@ -727,8 +727,8 @@ static void fpm_connect(struct event *t)
        if (sock == -1) {
                zlog_err("%s: fpm socket failed: %s", __func__,
                         strerror(errno));
-               thread_add_timer(fnc->fthread->master, fpm_connect, fnc, 3,
-                                &fnc->t_connect);
+               event_add_timer(fnc->fthread->master, fpm_connect, fnc, 3,
+                               &fnc->t_connect);
                return;
        }
 
@@ -753,18 +753,18 @@ static void fpm_connect(struct event *t)
                close(sock);
                zlog_warn("%s: fpm connection failed: %s", __func__,
                          strerror(errno));
-               thread_add_timer(fnc->fthread->master, fpm_connect, fnc, 3,
-                                &fnc->t_connect);
+               event_add_timer(fnc->fthread->master, fpm_connect, fnc, 3,
+                               &fnc->t_connect);
                return;
        }
 
        fnc->connecting = (errno == EINPROGRESS);
        fnc->socket = sock;
        if (!fnc->connecting)
-               thread_add_read(fnc->fthread->master, fpm_read, fnc, sock,
-                               &fnc->t_read);
-       thread_add_write(fnc->fthread->master, fpm_write, fnc, sock,
-                        &fnc->t_write);
+               event_add_read(fnc->fthread->master, fpm_read, fnc, sock,
+                              &fnc->t_read);
+       event_add_write(fnc->fthread->master, fpm_write, fnc, sock,
+                       &fnc->t_write);
 
        /*
         * Starting with LSPs walk all FPM objects, marking them
@@ -773,8 +773,8 @@ static void fpm_connect(struct event *t)
         * If we are not connected, then delay the objects reset/send.
         */
        if (!fnc->connecting)
-               thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
-                                &fnc->t_lspreset);
+               event_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
+                               &fnc->t_lspreset);
 }
 
 /**
@@ -983,8 +983,8 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
                                      memory_order_relaxed);
 
        /* Tell the thread to start writing. */
-       thread_add_write(fnc->fthread->master, fpm_write, fnc, fnc->socket,
-                        &fnc->t_write);
+       event_add_write(fnc->fthread->master, fpm_write, fnc, fnc->socket,
+                       &fnc->t_write);
 
        return 0;
 }
@@ -1038,12 +1038,12 @@ static void fpm_lsp_send(struct event *t)
                WALK_FINISH(fnc, FNE_LSP_FINISHED);
 
                /* Now move onto routes */
-               thread_add_timer(zrouter.master, fpm_nhg_reset, fnc, 0,
-                                &fnc->t_nhgreset);
+               event_add_timer(zrouter.master, fpm_nhg_reset, fnc, 0,
+                               &fnc->t_nhgreset);
        } else {
                /* Didn't finish - reschedule LSP walk */
-               thread_add_timer(zrouter.master, fpm_lsp_send, fnc, 0,
-                                &fnc->t_lspwalk);
+               event_add_timer(zrouter.master, fpm_lsp_send, fnc, 0,
+                               &fnc->t_lspwalk);
        }
 }
 
@@ -1099,11 +1099,11 @@ static void fpm_nhg_send(struct event *t)
        /* We are done sending next hops, lets install the routes now. */
        if (fna.complete) {
                WALK_FINISH(fnc, FNE_NHG_FINISHED);
-               thread_add_timer(zrouter.master, fpm_rib_reset, fnc, 0,
-                                &fnc->t_ribreset);
+               event_add_timer(zrouter.master, fpm_rib_reset, fnc, 0,
+                               &fnc->t_ribreset);
        } else /* Otherwise reschedule next hop group again. */
-               thread_add_timer(zrouter.master, fpm_nhg_send, fnc, 0,
-                                &fnc->t_nhgwalk);
+               event_add_timer(zrouter.master, fpm_nhg_send, fnc, 0,
+                               &fnc->t_nhgwalk);
 }
 
 /**
@@ -1141,8 +1141,8 @@ static void fpm_rib_send(struct event *t)
                                /* Free the temporary allocated context. */
                                dplane_ctx_fini(&ctx);
 
-                               thread_add_timer(zrouter.master, fpm_rib_send,
-                                                fnc, 1, &fnc->t_ribwalk);
+                               event_add_timer(zrouter.master, fpm_rib_send,
+                                               fnc, 1, &fnc->t_ribwalk);
                                return;
                        }
 
@@ -1158,8 +1158,8 @@ static void fpm_rib_send(struct event *t)
        WALK_FINISH(fnc, FNE_RIB_FINISHED);
 
        /* Schedule next event: RMAC reset. */
-       thread_add_event(zrouter.master, fpm_rmac_reset, fnc, 0,
-                        &fnc->t_rmacreset);
+       event_add_event(zrouter.master, fpm_rmac_reset, fnc, 0,
+                       &fnc->t_rmacreset);
 }
 
 /*
@@ -1199,8 +1199,8 @@ static void fpm_enqueue_rmac_table(struct hash_bucket *bucket, void *arg)
                        zrmac->fwd_info.r_vtep_ip, sticky, 0 /*nhg*/,
                        0 /*update_flags*/);
        if (fpm_nl_enqueue(fra->fnc, fra->ctx) == -1) {
-               thread_add_timer(zrouter.master, fpm_rmac_send,
-                                fra->fnc, 1, &fra->fnc->t_rmacwalk);
+               event_add_timer(zrouter.master, fpm_rmac_send, fra->fnc, 1,
+                               &fra->fnc->t_rmacwalk);
                fra->complete = false;
        }
 }
@@ -1247,7 +1247,7 @@ static void fpm_nhg_reset(struct event *t)
        hash_iterate(zrouter.nhgs_id, fpm_nhg_reset_cb, NULL);
 
        /* Schedule next step: send next hop groups. */
-       thread_add_event(zrouter.master, fpm_nhg_send, fnc, 0, &fnc->t_nhgwalk);
+       event_add_event(zrouter.master, fpm_nhg_send, fnc, 0, &fnc->t_nhgwalk);
 }
 
 /*
@@ -1268,7 +1268,7 @@ static void fpm_lsp_reset(struct event *t)
        hash_iterate(zvrf->lsp_table, fpm_lsp_reset_cb, NULL);
 
        /* Schedule next step: send LSPs */
-       thread_add_event(zrouter.master, fpm_lsp_send, fnc, 0, &fnc->t_lspwalk);
+       event_add_event(zrouter.master, fpm_lsp_send, fnc, 0, &fnc->t_lspwalk);
 }
 
 /**
@@ -1295,7 +1295,7 @@ static void fpm_rib_reset(struct event *t)
        }
 
        /* Schedule next step: send RIB routes. */
-       thread_add_event(zrouter.master, fpm_rib_send, fnc, 0, &fnc->t_ribwalk);
+       event_add_event(zrouter.master, fpm_rib_send, fnc, 0, &fnc->t_ribwalk);
 }
 
 /*
@@ -1322,8 +1322,8 @@ static void fpm_rmac_reset(struct event *t)
        hash_iterate(zrouter.l3vni_table, fpm_unset_l3vni_table, NULL);
 
        /* Schedule next event: send RMAC entries. */
-       thread_add_event(zrouter.master, fpm_rmac_send, fnc, 0,
-                        &fnc->t_rmacwalk);
+       event_add_event(zrouter.master, fpm_rmac_send, fnc, 0,
+                       &fnc->t_rmacwalk);
 }
 
 static void fpm_process_queue(struct event *t)
@@ -1371,8 +1371,8 @@ static void fpm_process_queue(struct event *t)
 
        /* Re-schedule if we ran out of buffer space */
        if (no_bufs)
-               thread_add_timer(fnc->fthread->master, fpm_process_queue,
-                                fnc, 0, &fnc->t_dequeue);
+               event_add_timer(fnc->fthread->master, fpm_process_queue, fnc, 0,
+                               &fnc->t_dequeue);
 
        /*
         * Let the dataplane thread know if there are items in the
@@ -1575,8 +1575,8 @@ static int fpm_nl_process(struct zebra_dplane_provider *prov)
        if (atomic_load_explicit(&fnc->counters.ctxqueue_len,
                                 memory_order_relaxed)
            > 0)
-               thread_add_timer(fnc->fthread->master, fpm_process_queue,
-                                fnc, 0, &fnc->t_dequeue);
+               event_add_timer(fnc->fthread->master, fpm_process_queue, fnc, 0,
+                               &fnc->t_dequeue);
 
        /* Ensure dataplane thread is rescheduled if we hit the work limit */
        if (counter >= limit)
index fdc538bf0fe519d588f1546e6b2710662baea8d2..8e4d15aa8450e2ee2046fea7c75c55e8713d1c51 100644 (file)
@@ -96,8 +96,8 @@ static void if_zebra_speed_update(struct event *thread)
                        return;
 
                zif->speed_update_count++;
-               thread_add_timer(zrouter.master, if_zebra_speed_update, ifp,
-                                SPEED_UPDATE_SLEEP_TIME, &zif->speed_update);
+               event_add_timer(zrouter.master, if_zebra_speed_update, ifp,
+                               SPEED_UPDATE_SLEEP_TIME, &zif->speed_update);
                thread_ignore_late_timer(zif->speed_update);
        }
 }
@@ -161,8 +161,8 @@ static int if_zebra_new_hook(struct interface *ifp)
         * down upon startup.
         */
        zebra_if->speed_update_count = 0;
-       thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 15,
-                        &zebra_if->speed_update);
+       event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 15,
+                       &zebra_if->speed_update);
        thread_ignore_late_timer(zebra_if->speed_update);
 
        return 0;
@@ -1038,8 +1038,8 @@ void if_up(struct interface *ifp, bool install_connected)
        if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK)
                zebra_evpn_mh_uplink_oper_update(zif);
 
-       thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0,
-                        &zif->speed_update);
+       event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0,
+                       &zif->speed_update);
        thread_ignore_late_timer(zif->speed_update);
 }
 
index 28d6b89ed4e13e7b0bc24e41cd01e2b598567745..ca46a4bf8a01678b869358f288acd07508d78729 100644 (file)
@@ -272,8 +272,8 @@ static void irdp_if_start(struct interface *ifp, int multicast,
                           timer);
 
        irdp->t_advertise = NULL;
-       thread_add_timer(zrouter.master, irdp_send_thread, ifp, timer,
-                        &irdp->t_advertise);
+       event_add_timer(zrouter.master, irdp_send_thread, ifp, timer,
+                       &irdp->t_advertise);
 }
 
 static void irdp_if_stop(struct interface *ifp)
index 4d9aad5cee39e7e4d6834334024b04353a0bf39d..2d90afaeda4ad4f1465cf2486b9f7e78c30b63b8 100644 (file)
@@ -97,7 +97,7 @@ int irdp_sock_init(void)
                return ret;
        };
 
-       thread_add_read(zrouter.master, irdp_read_raw, NULL, sock, &t_irdp_raw);
+       event_add_read(zrouter.master, irdp_read_raw, NULL, sock, &t_irdp_raw);
 
        return sock;
 }
@@ -229,8 +229,8 @@ void irdp_send_thread(struct event *t_advert)
                           timer);
 
        irdp->t_advertise = NULL;
-       thread_add_timer(zrouter.master, irdp_send_thread, ifp, timer,
-                        &irdp->t_advertise);
+       event_add_timer(zrouter.master, irdp_send_thread, ifp, timer,
+                       &irdp->t_advertise);
 }
 
 void irdp_advert_off(struct interface *ifp)
@@ -285,8 +285,8 @@ void process_solicit(struct interface *ifp)
        timer = (frr_weak_random() % MAX_RESPONSE_DELAY) + 1;
 
        irdp->t_advertise = NULL;
-       thread_add_timer(zrouter.master, irdp_send_thread, ifp, timer,
-                        &irdp->t_advertise);
+       event_add_timer(zrouter.master, irdp_send_thread, ifp, timer,
+                       &irdp->t_advertise);
 }
 
 static int irdp_finish(void)
index aee59a78fc6ca6e133ded3fe5825adc1be1d11b8..e821d375efb1425e6ce47d3f11ea7dcba0d0d84e 100644 (file)
@@ -218,8 +218,8 @@ void irdp_read_raw(struct event *r)
        int ret, ifindex = 0;
 
        int irdp_sock = THREAD_FD(r);
-       thread_add_read(zrouter.master, irdp_read_raw, NULL, irdp_sock,
-                       &t_irdp_raw);
+       event_add_read(zrouter.master, irdp_read_raw, NULL, irdp_sock,
+                      &t_irdp_raw);
 
        ret = irdp_recvmsg(irdp_sock, (uint8_t *)buf, IRDP_RX_BUF, &ifindex);
 
index a779533e34c6f07a2c2a4814d5f6852010d7fe18..4bdf268c4127a352b08c57e4aa70532823441d48 100644 (file)
@@ -493,8 +493,8 @@ static void kernel_read(struct event *thread)
        netlink_parse_info(netlink_information_fetch, &zns->netlink, &dp_info,
                           5, false);
 
-       thread_add_read(zrouter.master, kernel_read, zns, zns->netlink.sock,
-                       &zns->t_netlink);
+       event_add_read(zrouter.master, kernel_read, zns, zns->netlink.sock,
+                      &zns->t_netlink);
 }
 
 /*
@@ -1939,8 +1939,8 @@ void kernel_init(struct zebra_ns *zns)
 
        zns->t_netlink = NULL;
 
-       thread_add_read(zrouter.master, kernel_read, zns,
-                       zns->netlink.sock, &zns->t_netlink);
+       event_add_read(zrouter.master, kernel_read, zns, zns->netlink.sock,
+                      &zns->t_netlink);
 
        rt_netlink_init();
 }
index 8f00297b66e2791720da3554827344dd61376b57..6a32f523d7825b83aec0cf8da0b6325df8c8c98c 100644 (file)
@@ -1338,8 +1338,8 @@ static void kernel_read(struct event *thread)
                         * shortage and is not harmful for consistency of
                         * reading the routing socket.  Ignore it.
                         */
-                       thread_add_read(zrouter.master, kernel_read, NULL, sock,
-                                       NULL);
+                       event_add_read(zrouter.master, kernel_read, NULL, sock,
+                                      NULL);
                        return;
 #else
                        flog_err(EC_ZEBRA_RECVMSG_OVERRUN,
@@ -1362,7 +1362,7 @@ static void kernel_read(struct event *thread)
        if (nbytes == 0)
                return;
 
-       thread_add_read(zrouter.master, kernel_read, NULL, sock, NULL);
+       event_add_read(zrouter.master, kernel_read, NULL, sock, NULL);
 
        if (IS_ZEBRA_DEBUG_KERNEL)
                rtmsg_debug(&buf.r.rtm);
@@ -1465,7 +1465,7 @@ static void routing_socket(struct zebra_ns *zns)
        }
 
        /* kernel_read needs rewrite. */
-       thread_add_read(zrouter.master, kernel_read, NULL, routing_sock, NULL);
+       event_add_read(zrouter.master, kernel_read, NULL, routing_sock, NULL);
 }
 
 /* Exported interface function.  This function simply calls
index 25480f41d4a36b227d690dc0e98259450a5a5fb6..d3447a8cae7edaa23d86460e198e71f3299c26d4 100644 (file)
@@ -435,8 +435,8 @@ int main(int argc, char **argv)
        * we have to have route_read() called before.
        */
        zrouter.startup_time = monotime(NULL);
-       thread_add_timer(zrouter.master, rib_sweep_route, NULL,
-                        graceful_restart, &zrouter.sweeper);
+       event_add_timer(zrouter.master, rib_sweep_route, NULL, graceful_restart,
+                       &zrouter.sweeper);
 
        /* Needed for BSD routing socket. */
        pid = getpid();
index c1c4e1f2a6072166d9de2737cab8ce149429d48e..4fece96f62db5d673bc0dedecafc2587c228a636 100644 (file)
@@ -2800,26 +2800,26 @@ static void rtadv_event(struct zebra_vrf *zvrf, enum rtadv_event event, int val)
 
        switch (event) {
        case RTADV_START:
-               thread_add_read(zrouter.master, rtadv_read, zvrf, rtadv->sock,
-                               &rtadv->ra_read);
-               thread_add_event(zrouter.master, rtadv_timer, zvrf, 0,
-                                &rtadv->ra_timer);
+               event_add_read(zrouter.master, rtadv_read, zvrf, rtadv->sock,
+                              &rtadv->ra_read);
+               event_add_event(zrouter.master, rtadv_timer, zvrf, 0,
+                               &rtadv->ra_timer);
                break;
        case RTADV_STOP:
                THREAD_OFF(rtadv->ra_timer);
                THREAD_OFF(rtadv->ra_read);
                break;
        case RTADV_TIMER:
-               thread_add_timer(zrouter.master, rtadv_timer, zvrf, val,
-                                &rtadv->ra_timer);
+               event_add_timer(zrouter.master, rtadv_timer, zvrf, val,
+                               &rtadv->ra_timer);
                break;
        case RTADV_TIMER_MSEC:
-               thread_add_timer_msec(zrouter.master, rtadv_timer, zvrf, val,
-                                     &rtadv->ra_timer);
+               event_add_timer_msec(zrouter.master, rtadv_timer, zvrf, val,
+                                    &rtadv->ra_timer);
                break;
        case RTADV_READ:
-               thread_add_read(zrouter.master, rtadv_read, zvrf, rtadv->sock,
-                               &rtadv->ra_read);
+               event_add_read(zrouter.master, rtadv_read, zvrf, rtadv->sock,
+                              &rtadv->ra_read);
                break;
        default:
                break;
index 4b38a4b8592af07418027aeefd02aae86a734b70..adfabd0b091c3787582aa8376ee361f557b367be 100644 (file)
@@ -5780,8 +5780,8 @@ static void dplane_incoming_read(struct event *event)
        kernel_dplane_read(&zi->info);
 
        /* Re-start read task */
-       thread_add_read(zdplane_info.dg_master, dplane_incoming_read, zi,
-                       zi->info.sock, &zi->t_read);
+       event_add_read(zdplane_info.dg_master, dplane_incoming_read, zi,
+                      zi->info.sock, &zi->t_read);
 }
 
 /*
@@ -5793,8 +5793,8 @@ static void dplane_incoming_request(struct event *event)
        struct dplane_zns_info *zi = THREAD_ARG(event);
 
        /* Start read task */
-       thread_add_read(zdplane_info.dg_master, dplane_incoming_read, zi,
-                       zi->info.sock, &zi->t_read);
+       event_add_read(zdplane_info.dg_master, dplane_incoming_read, zi,
+                      zi->info.sock, &zi->t_read);
 
        /* Send requests */
        netlink_request_netconf(zi->info.sock);
@@ -5812,9 +5812,8 @@ static void dplane_kernel_info_request(struct dplane_zns_info *zi)
         * pthread is running, we'll initiate this later on.
         */
        if (zdplane_info.dg_master)
-               thread_add_event(zdplane_info.dg_master,
-                                dplane_incoming_request, zi, 0,
-                                &zi->t_request);
+               event_add_event(zdplane_info.dg_master, dplane_incoming_request,
+                               zi, 0, &zi->t_request);
 }
 
 #endif /* HAVE_NETLINK */
@@ -5898,9 +5897,8 @@ int dplane_provider_work_ready(void)
         * available.
         */
        if (zdplane_info.dg_run) {
-               thread_add_event(zdplane_info.dg_master,
-                                dplane_thread_loop, NULL, 0,
-                                &zdplane_info.dg_t_update);
+               event_add_event(zdplane_info.dg_master, dplane_thread_loop,
+                               NULL, 0, &zdplane_info.dg_t_update);
        }
 
        return AOK;
@@ -6618,10 +6616,9 @@ static void dplane_check_shutdown_status(struct event *event)
 
        if (dplane_work_pending()) {
                /* Reschedule dplane check on a short timer */
-               thread_add_timer_msec(zdplane_info.dg_master,
-                                     dplane_check_shutdown_status,
-                                     NULL, 100,
-                                     &zdplane_info.dg_t_shutdown_check);
+               event_add_timer_msec(zdplane_info.dg_master,
+                                    dplane_check_shutdown_status, NULL, 100,
+                                    &zdplane_info.dg_t_shutdown_check);
 
                /* TODO - give up and stop waiting after a short time? */
 
@@ -6629,7 +6626,7 @@ static void dplane_check_shutdown_status(struct event *event)
                /* We appear to be done - schedule a final callback event
                 * for the zebra main pthread.
                 */
-               thread_add_event(zrouter.master, zebra_finalize, NULL, 0, NULL);
+               event_add_event(zrouter.master, zebra_finalize, NULL, 0, NULL);
        }
 }
 
@@ -6648,9 +6645,8 @@ void zebra_dplane_finish(void)
        if (IS_ZEBRA_DEBUG_DPLANE)
                zlog_debug("Zebra dataplane fini called");
 
-       thread_add_event(zdplane_info.dg_master,
-                        dplane_check_shutdown_status, NULL, 0,
-                        &zdplane_info.dg_t_shutdown_check);
+       event_add_event(zdplane_info.dg_master, dplane_check_shutdown_status,
+                       NULL, 0, &zdplane_info.dg_t_shutdown_check);
 }
 
 /*
@@ -6929,14 +6925,14 @@ void zebra_dplane_start(void)
        zdplane_info.dg_run = true;
 
        /* Enqueue an initial event for the dataplane pthread */
-       thread_add_event(zdplane_info.dg_master, dplane_thread_loop, NULL, 0,
-                        &zdplane_info.dg_t_update);
+       event_add_event(zdplane_info.dg_master, dplane_thread_loop, NULL, 0,
+                       &zdplane_info.dg_t_update);
 
        /* Enqueue requests and reads if necessary */
        frr_each (zns_info_list, &zdplane_info.dg_zns_list, zi) {
 #if defined(HAVE_NETLINK)
-               thread_add_read(zdplane_info.dg_master, dplane_incoming_read,
-                               zi, zi->info.sock, &zi->t_read);
+               event_add_read(zdplane_info.dg_master, dplane_incoming_read, zi,
+                              zi->info.sock, &zi->t_read);
                dplane_kernel_info_request(zi);
 #endif
        }
index 2c55a54c70996b205353aa7c4bd47816e109d552..c12bfe5bc01b3f3a68d352c86849745d93898895 100644 (file)
@@ -588,10 +588,10 @@ static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf,
                                        zvrf->dad_freeze_time);
                        }
 
-                       thread_add_timer(zrouter.master,
-                                        zebra_evpn_dad_mac_auto_recovery_exp,
-                                        mac, zvrf->dad_freeze_time,
-                                        &mac->dad_mac_auto_recovery_timer);
+                       event_add_timer(zrouter.master,
+                                       zebra_evpn_dad_mac_auto_recovery_exp,
+                                       mac, zvrf->dad_freeze_time,
+                                       &mac->dad_mac_auto_recovery_timer);
                }
 
                /* In case of local update, do not inform to client (BGPd),
@@ -1561,8 +1561,8 @@ static inline void zebra_evpn_mac_start_hold_timer(struct zebra_mac *mac)
                        zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
                                                       sizeof(mac_buf)));
        }
-       thread_add_timer(zrouter.master, zebra_evpn_mac_hold_exp_cb, mac,
-                        zmh_info->mac_hold_time, &mac->hold_timer);
+       event_add_timer(zrouter.master, zebra_evpn_mac_hold_exp_cb, mac,
+                       zmh_info->mac_hold_time, &mac->hold_timer);
 }
 
 void zebra_evpn_mac_stop_hold_timer(struct zebra_mac *mac)
index 85a96fe4f587734a3e7cba9bfd0c0db38f2b0e6a..c5d5046dfc1b8751bfdc9de47991bf1e2aa4c4e4 100644 (file)
@@ -2269,9 +2269,9 @@ static void zebra_evpn_es_local_info_set(struct zebra_evpn_es *es,
 
        /* Start the DF delay timer on the local ES */
        if (!es->df_delay_timer)
-               thread_add_timer(zrouter.master, zebra_evpn_es_df_delay_exp_cb,
-                                es, ZEBRA_EVPN_MH_DF_DELAY_TIME,
-                                &es->df_delay_timer);
+               event_add_timer(zrouter.master, zebra_evpn_es_df_delay_exp_cb,
+                               es, ZEBRA_EVPN_MH_DF_DELAY_TIME,
+                               &es->df_delay_timer);
 
        /* See if the local VTEP can function as DF on the ES */
        if (!zebra_evpn_es_run_df_election(es, __func__)) {
@@ -3939,10 +3939,10 @@ static void zebra_evpn_mh_startup_delay_timer_start(const char *rc)
                        zlog_debug(
                                "startup-delay timer started for %d sec on %s",
                                zmh_info->startup_delay_time, rc);
-               thread_add_timer(zrouter.master,
-                                zebra_evpn_mh_startup_delay_exp_cb, NULL,
-                                zmh_info->startup_delay_time,
-                                &zmh_info->startup_delay_timer);
+               event_add_timer(zrouter.master,
+                               zebra_evpn_mh_startup_delay_exp_cb, NULL,
+                               zmh_info->startup_delay_time,
+                               &zmh_info->startup_delay_timer);
                zebra_evpn_mh_update_protodown(
                        ZEBRA_PROTODOWN_EVPN_STARTUP_DELAY, true /* set */);
        } else {
index b27ddb5e6104b364135850d5c47653cf53d0eaeb..11ceae4b5d152c88d5bc58912b25e503b36037a1 100644 (file)
@@ -444,8 +444,8 @@ static inline void zebra_evpn_neigh_start_hold_timer(struct zebra_neigh *n)
        if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
                zlog_debug("sync-neigh vni %u ip %pIA mac %pEA 0x%x hold start",
                           n->zevpn->vni, &n->ip, &n->emac, n->flags);
-       thread_add_timer(zrouter.master, zebra_evpn_neigh_hold_exp_cb, n,
-                        zmh_info->neigh_hold_time, &n->hold_timer);
+       event_add_timer(zrouter.master, zebra_evpn_neigh_hold_exp_cb, n,
+                       zmh_info->neigh_hold_time, &n->hold_timer);
 }
 
 static void zebra_evpn_local_neigh_deref_mac(struct zebra_neigh *n,
@@ -1231,10 +1231,10 @@ static void zebra_evpn_dup_addr_detect_for_neigh(
                                        __func__, &nbr->emac, &nbr->ip,
                                        nbr->flags, zvrf->dad_freeze_time);
 
-                       thread_add_timer(zrouter.master,
-                                        zebra_evpn_dad_ip_auto_recovery_exp,
-                                        nbr, zvrf->dad_freeze_time,
-                                        &nbr->dad_ip_auto_recovery_timer);
+                       event_add_timer(zrouter.master,
+                                       zebra_evpn_dad_ip_auto_recovery_exp,
+                                       nbr, zvrf->dad_freeze_time,
+                                       &nbr->dad_ip_auto_recovery_timer);
                }
                if (zvrf->dad_freeze)
                        *is_dup_detect = true;
index 0795d122632c114b1c106ce64e01b9bbc5d9cc97..a97873c3848344dd6e6b6fa416d7841d81d6f764 100644 (file)
@@ -460,8 +460,8 @@ static inline void zfpm_read_on(void)
        assert(!zfpm_g->t_read);
        assert(zfpm_g->sock >= 0);
 
-       thread_add_read(zfpm_g->master, zfpm_read_cb, 0, zfpm_g->sock,
-                       &zfpm_g->t_read);
+       event_add_read(zfpm_g->master, zfpm_read_cb, 0, zfpm_g->sock,
+                      &zfpm_g->t_read);
 }
 
 /*
@@ -472,8 +472,8 @@ static inline void zfpm_write_on(void)
        assert(!zfpm_g->t_write);
        assert(zfpm_g->sock >= 0);
 
-       thread_add_write(zfpm_g->master, zfpm_write_cb, 0, zfpm_g->sock,
-                        &zfpm_g->t_write);
+       event_add_write(zfpm_g->master, zfpm_write_cb, 0, zfpm_g->sock,
+                       &zfpm_g->t_write);
 }
 
 /*
@@ -542,8 +542,8 @@ static void zfpm_conn_up_thread_cb(struct event *thread)
 
                zfpm_g->stats.t_conn_up_yields++;
                zfpm_rnodes_iter_pause(iter);
-               thread_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb,
-                                     NULL, 0, &zfpm_g->t_conn_up);
+               event_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb,
+                                    NULL, 0, &zfpm_g->t_conn_up);
                return;
        }
 
@@ -575,8 +575,8 @@ static void zfpm_connection_up(const char *detail)
 
        zfpm_debug("Starting conn_up thread");
 
-       thread_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb, NULL, 0,
-                             &zfpm_g->t_conn_up);
+       event_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb, NULL, 0,
+                            &zfpm_g->t_conn_up);
        zfpm_g->stats.t_conn_up_starts++;
 }
 
@@ -668,8 +668,8 @@ static void zfpm_conn_down_thread_cb(struct event *thread)
                zfpm_g->stats.t_conn_down_yields++;
                zfpm_rnodes_iter_pause(iter);
                zfpm_g->t_conn_down = NULL;
-               thread_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb,
-                                     NULL, 0, &zfpm_g->t_conn_down);
+               event_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb,
+                                    NULL, 0, &zfpm_g->t_conn_down);
                return;
        }
 
@@ -713,8 +713,8 @@ static void zfpm_connection_down(const char *detail)
        assert(!zfpm_g->t_conn_down);
        zfpm_rnodes_iter_init(&zfpm_g->t_conn_down_state.iter);
        zfpm_g->t_conn_down = NULL;
-       thread_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb, NULL, 0,
-                             &zfpm_g->t_conn_down);
+       event_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb, NULL, 0,
+                            &zfpm_g->t_conn_down);
        zfpm_g->stats.t_conn_down_starts++;
 
        zfpm_set_state(ZFPM_STATE_IDLE, detail);
@@ -1388,8 +1388,8 @@ static void zfpm_start_connect_timer(const char *reason)
        delay_secs = zfpm_calc_connect_delay();
        zfpm_debug("scheduling connect in %ld seconds", delay_secs);
 
-       thread_add_timer(zfpm_g->master, zfpm_connect_cb, 0, delay_secs,
-                        &zfpm_g->t_connect);
+       event_add_timer(zfpm_g->master, zfpm_connect_cb, 0, delay_secs,
+                       &zfpm_g->t_connect);
        zfpm_set_state(ZFPM_STATE_ACTIVE, reason);
 }
 
@@ -1707,8 +1707,8 @@ void zfpm_start_stats_timer(void)
 {
        assert(!zfpm_g->t_stats);
 
-       thread_add_timer(zfpm_g->master, zfpm_stats_timer_cb, 0,
-                        ZFPM_STATS_IVL_SECS, &zfpm_g->t_stats);
+       event_add_timer(zfpm_g->master, zfpm_stats_timer_cb, 0,
+                       ZFPM_STATS_IVL_SECS, &zfpm_g->t_stats);
 }
 
 /*
index 8aee7f0d732ce1336267764185eb6a699c7c5255..e055eae7e1d9511fe4e46e0049d585f3c0132831 100644 (file)
@@ -159,7 +159,7 @@ int32_t zebra_gr_client_disconnect(struct zserv *client)
                    && (info->t_stale_removal == NULL)) {
                        struct vrf *vrf = vrf_lookup_by_id(info->vrf_id);
 
-                       thread_add_timer(
+                       event_add_timer(
                                zrouter.master,
                                zebra_gr_route_stale_delete_timer_expiry, info,
                                info->stale_removal_time,
@@ -482,10 +482,10 @@ static void zebra_gr_route_stale_delete_timer_expiry(struct event *thread)
                       __func__, zebra_route_string(client->proto),
                       VRF_LOGNAME(vrf), info->vrf_id, cnt);
 
-               thread_add_timer(zrouter.master,
-                                zebra_gr_route_stale_delete_timer_expiry, info,
-                                ZEBRA_DEFAULT_STALE_UPDATE_DELAY,
-                                &info->t_stale_removal);
+               event_add_timer(zrouter.master,
+                               zebra_gr_route_stale_delete_timer_expiry, info,
+                               ZEBRA_DEFAULT_STALE_UPDATE_DELAY,
+                               &info->t_stale_removal);
        } else {
                /* No routes to delete for the VRF */
                LOG_GR("%s: Client %s vrf %s(%u) all stale routes processed",
index ad128f8af64cf762b0b3889829938a32d77808ab..18bbd2fd47a66271fb22fd3ead521d3a12fdeb7d 100644 (file)
@@ -114,8 +114,8 @@ void zebra_mlag_process_mlag_data(uint8_t *data, uint32_t len)
         * additional four bytes are for message type
         */
        stream_putl_at(s, 0, msg_type);
-       thread_add_event(zrouter.master, zebra_mlag_post_data_from_main_thread,
-                        s, 0, NULL);
+       event_add_event(zrouter.master, zebra_mlag_post_data_from_main_thread,
+                       s, 0, NULL);
 }
 
 /**********************End of MLAG Interaction********************************/
@@ -173,9 +173,9 @@ static void zebra_mlag_client_msg_handler(struct event *event)
                         * main thread.
                         */
                        if (msg_type == MLAG_DEREGISTER) {
-                               thread_add_event(zrouter.master,
-                                                zebra_mlag_terminate_pthread,
-                                                NULL, 0, NULL);
+                               event_add_event(zrouter.master,
+                                               zebra_mlag_terminate_pthread,
+                                               NULL, 0, NULL);
                        }
                }
 
@@ -237,9 +237,9 @@ static int zebra_mlag_signal_write_thread(void)
         * during Zebra Init/after MLAG thread is destroyed.
         * so it is safe to use without any locking
         */
-       thread_add_event(zrouter.mlag_info.th_master,
-                        zebra_mlag_client_msg_handler, NULL, 0,
-                        &zrouter.mlag_info.t_write);
+       event_add_event(zrouter.mlag_info.th_master,
+                       zebra_mlag_client_msg_handler, NULL, 0,
+                       &zrouter.mlag_info.t_write);
        return 0;
 }
 
@@ -279,8 +279,8 @@ static void zebra_mlag_publish_process_state(struct zserv *client,
        s = stream_new(ZEBRA_HEADER_SIZE + ZEBRA_MLAG_METADATA_LEN);
        stream_putl(s, ZEBRA_MLAG_MSG_BCAST);
        zclient_create_header(s, msg_type, VRF_DEFAULT);
-       thread_add_event(zrouter.master, zebra_mlag_post_data_from_main_thread,
-                        s, 0, NULL);
+       event_add_event(zrouter.master, zebra_mlag_post_data_from_main_thread,
+                       s, 0, NULL);
 }
 
 /**************************End of Multi-entrant Apis**************************/
index ba66dc464a974696b6c6cc42bcda12f6228a2bda..727f2a9ca88734d511ff8ebb026b20b43e3f5c69 100644 (file)
@@ -55,8 +55,8 @@ static int zebra_mlag_private_write_data(uint8_t *data, uint32_t len)
 
 static void zebra_mlag_sched_read(void)
 {
-       thread_add_read(zmlag_master, zebra_mlag_read, NULL, mlag_socket,
-                       &zrouter.mlag_info.t_read);
+       event_add_read(zmlag_master, zebra_mlag_read, NULL, mlag_socket,
+                      &zrouter.mlag_info.t_read);
 }
 
 static void zebra_mlag_read(struct event *thread)
@@ -173,8 +173,8 @@ static void zebra_mlag_connect(struct event *thread)
                                svr.sun_path);
                close(mlag_socket);
                zrouter.mlag_info.timer_running = true;
-               thread_add_timer(zmlag_master, zebra_mlag_connect, NULL, 10,
-                                &zrouter.mlag_info.t_read);
+               event_add_timer(zmlag_master, zebra_mlag_connect, NULL, 10,
+                               &zrouter.mlag_info.t_read);
                return;
        }
 
@@ -184,8 +184,8 @@ static void zebra_mlag_connect(struct event *thread)
                zlog_debug("%s: Connection with MLAG is established ",
                           __func__);
 
-       thread_add_read(zmlag_master, zebra_mlag_read, NULL, mlag_socket,
-                       &zrouter.mlag_info.t_read);
+       event_add_read(zmlag_master, zebra_mlag_read, NULL, mlag_socket,
+                      &zrouter.mlag_info.t_read);
        /*
         * Connection is established with MLAGD, post to clients
         */
@@ -197,8 +197,8 @@ static void zebra_mlag_connect(struct event *thread)
  */
 static int zebra_mlag_private_monitor_state(void)
 {
-       thread_add_event(zmlag_master, zebra_mlag_connect, NULL, 0,
-                        &zrouter.mlag_info.t_read);
+       event_add_event(zmlag_master, zebra_mlag_connect, NULL, 0,
+                       &zrouter.mlag_info.t_read);
        return 0;
 }
 
@@ -225,8 +225,8 @@ static int zebra_mlag_private_open_channel(void)
                /*
                 * Connect only if any clients are showing interest
                 */
-               thread_add_event(zmlag_master, zebra_mlag_connect, NULL, 0,
-                                &zrouter.mlag_info.t_read);
+               event_add_event(zmlag_master, zebra_mlag_connect, NULL, 0,
+                               &zrouter.mlag_info.t_read);
        }
        return 0;
 }
index 205c10ce256bee4a138a5766e6522087810001af..9ceecb5e97fa686ffbc44086c00df483c4134b2c 100644 (file)
@@ -133,9 +133,9 @@ static int zebra_ns_continue_read(struct zebra_netns_info *zns_info,
                XFREE(MTYPE_NETNS_MISC, zns_info);
                return 0;
        }
-       thread_add_timer_msec(zrouter.master, zebra_ns_ready_read,
-                             (void *)zns_info, ZEBRA_NS_POLLING_INTERVAL_MSEC,
-                             NULL);
+       event_add_timer_msec(zrouter.master, zebra_ns_ready_read,
+                            (void *)zns_info, ZEBRA_NS_POLLING_INTERVAL_MSEC,
+                            NULL);
        return 0;
 }
 
@@ -288,8 +288,8 @@ static void zebra_ns_notify_read(struct event *t)
        ssize_t len;
        char event_name[NAME_MAX + 1];
 
-       thread_add_read(zrouter.master, zebra_ns_notify_read, NULL, fd_monitor,
-                       &zebra_netns_notify_current);
+       event_add_read(zrouter.master, zebra_ns_notify_read, NULL, fd_monitor,
+                      &zebra_netns_notify_current);
        len = read(fd_monitor, buf, sizeof(buf));
        if (len < 0) {
                flog_err_sys(EC_ZEBRA_NS_NOTIFY_READ,
@@ -361,8 +361,8 @@ static void zebra_ns_notify_read(struct event *t)
                                    sizeof(struct zebra_netns_info));
                netnsinfo->retries = ZEBRA_NS_POLLING_MAX_RETRIES;
                netnsinfo->netnspath = netnspath;
-               thread_add_timer_msec(zrouter.master, zebra_ns_ready_read,
-                                     (void *)netnsinfo, 0, NULL);
+               event_add_timer_msec(zrouter.master, zebra_ns_ready_read,
+                                    (void *)netnsinfo, 0, NULL);
        }
 }
 
@@ -427,8 +427,8 @@ void zebra_ns_notify_init(void)
                             "NS notify watch: failed to add watch (%s)",
                             safe_strerror(errno));
        }
-       thread_add_read(zrouter.master, zebra_ns_notify_read, NULL, fd_monitor,
-                       &zebra_netns_notify_current);
+       event_add_read(zrouter.master, zebra_ns_notify_read, NULL, fd_monitor,
+                      &zebra_netns_notify_current);
 }
 
 void zebra_ns_notify_close(void)
index f42c7a42d2e445569e519430729cbb206e9a9150..7eed209a1d0d0cd72805e6ebc24c2ee4a6a5c5af 100644 (file)
@@ -1707,8 +1707,8 @@ void zebra_nhg_decrement_ref(struct nhg_hash_entry *nhe)
            !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND)) {
                nhe->refcnt = 1;
                SET_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND);
-               thread_add_timer(zrouter.master, zebra_nhg_timer, nhe,
-                                zrouter.nhg_keep, &nhe->timer);
+               event_add_timer(zrouter.master, zebra_nhg_timer, nhe,
+                               zrouter.nhg_keep, &nhe->timer);
                return;
        }
 
index 491ea45d9808f0893381887ebb528413008fd06f..b5f52089db279de1b7fe7829932f47bdb3973c75 100644 (file)
@@ -148,8 +148,8 @@ void zebra_opaque_start(void)
        atomic_store_explicit(&zo_info.run, 1, memory_order_relaxed);
 
        /* Enqueue an initial event for the pthread */
-       thread_add_event(zo_info.master, process_messages, NULL, 0,
-                        &zo_info.t_msgs);
+       event_add_event(zo_info.master, process_messages, NULL, 0,
+                       &zo_info.t_msgs);
 
        /* And start the pthread */
        frr_pthread_run(zo_info.pthread, NULL);
@@ -248,8 +248,8 @@ uint32_t zebra_opaque_enqueue_batch(struct stream_fifo *batch)
                if (IS_ZEBRA_DEBUG_RECV && IS_ZEBRA_DEBUG_DETAIL)
                        zlog_debug("%s: received %u messages",
                                   __func__, counter);
-               thread_add_event(zo_info.master, process_messages, NULL, 0,
-                                &zo_info.t_msgs);
+               event_add_event(zo_info.master, process_messages, NULL, 0,
+                               &zo_info.t_msgs);
        }
 
        return counter;
@@ -317,8 +317,8 @@ done:
        if (need_resched) {
                atomic_fetch_add_explicit(&zo_info.yields, 1,
                                          memory_order_relaxed);
-               thread_add_event(zo_info.master, process_messages, NULL, 0,
-                                &zo_info.t_msgs);
+               event_add_event(zo_info.master, process_messages, NULL, 0,
+                               &zo_info.t_msgs);
        }
 
        /* This will also free any leftover messages, in the shutdown case */
index 301f1c3f748b9108ed82fd9a7ee338ef430c44a3..e77dcedd9e106232bddda245713fe2ca1dc9f05e 100644 (file)
@@ -169,13 +169,13 @@ static void zebra_ptm_flush_messages(struct event *thread)
                ptm_cb.ptm_sock = -1;
                zebra_ptm_reset_status(0);
                ptm_cb.t_timer = NULL;
-               thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
-                                ptm_cb.reconnect_time, &ptm_cb.t_timer);
+               event_add_timer(zrouter.master, zebra_ptm_connect, NULL,
+                               ptm_cb.reconnect_time, &ptm_cb.t_timer);
                return;
        case BUFFER_PENDING:
                ptm_cb.t_write = NULL;
-               thread_add_write(zrouter.master, zebra_ptm_flush_messages, NULL,
-                                ptm_cb.ptm_sock, &ptm_cb.t_write);
+               event_add_write(zrouter.master, zebra_ptm_flush_messages, NULL,
+                               ptm_cb.ptm_sock, &ptm_cb.t_write);
                break;
        case BUFFER_EMPTY:
                break;
@@ -193,15 +193,15 @@ static int zebra_ptm_send_message(char *data, int size)
                ptm_cb.ptm_sock = -1;
                zebra_ptm_reset_status(0);
                ptm_cb.t_timer = NULL;
-               thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
-                                ptm_cb.reconnect_time, &ptm_cb.t_timer);
+               event_add_timer(zrouter.master, zebra_ptm_connect, NULL,
+                               ptm_cb.reconnect_time, &ptm_cb.t_timer);
                return -1;
        case BUFFER_EMPTY:
                THREAD_OFF(ptm_cb.t_write);
                break;
        case BUFFER_PENDING:
-               thread_add_write(zrouter.master, zebra_ptm_flush_messages, NULL,
-                                ptm_cb.ptm_sock, &ptm_cb.t_write);
+               event_add_write(zrouter.master, zebra_ptm_flush_messages, NULL,
+                               ptm_cb.ptm_sock, &ptm_cb.t_write);
                break;
        }
 
@@ -220,8 +220,8 @@ void zebra_ptm_connect(struct event *t)
        if (ptm_cb.ptm_sock != -1) {
                if (init) {
                        ptm_cb.t_read = NULL;
-                       thread_add_read(zrouter.master, zebra_ptm_sock_read,
-                                       NULL, ptm_cb.ptm_sock, &ptm_cb.t_read);
+                       event_add_read(zrouter.master, zebra_ptm_sock_read,
+                                      NULL, ptm_cb.ptm_sock, &ptm_cb.t_read);
                        zebra_bfd_peer_replay_req();
                }
                zebra_ptm_send_status_req();
@@ -232,8 +232,8 @@ void zebra_ptm_connect(struct event *t)
                        ptm_cb.reconnect_time = ZEBRA_PTM_RECONNECT_TIME_MAX;
 
                ptm_cb.t_timer = NULL;
-               thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
-                                ptm_cb.reconnect_time, &ptm_cb.t_timer);
+               event_add_timer(zrouter.master, zebra_ptm_connect, NULL,
+                               ptm_cb.reconnect_time, &ptm_cb.t_timer);
        } else if (ptm_cb.reconnect_time >= ZEBRA_PTM_RECONNECT_TIME_MAX) {
                ptm_cb.reconnect_time = ZEBRA_PTM_RECONNECT_TIME_INITIAL;
        }
@@ -656,15 +656,14 @@ void zebra_ptm_sock_read(struct event *thread)
                ptm_cb.ptm_sock = -1;
                zebra_ptm_reset_status(0);
                ptm_cb.t_timer = NULL;
-               thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
-                                ptm_cb.reconnect_time,
-                                &ptm_cb.t_timer);
+               event_add_timer(zrouter.master, zebra_ptm_connect, NULL,
+                               ptm_cb.reconnect_time, &ptm_cb.t_timer);
                return;
        }
 
        ptm_cb.t_read = NULL;
-       thread_add_read(zrouter.master, zebra_ptm_sock_read, NULL,
-                       ptm_cb.ptm_sock, &ptm_cb.t_read);
+       event_add_read(zrouter.master, zebra_ptm_sock_read, NULL,
+                      ptm_cb.ptm_sock, &ptm_cb.t_read);
 }
 
 /* BFD peer/dst register/update */
@@ -698,8 +697,8 @@ void zebra_ptm_bfd_dst_register(ZAPI_HANDLER_ARGS)
 
        if (ptm_cb.ptm_sock == -1) {
                ptm_cb.t_timer = NULL;
-               thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
-                                ptm_cb.reconnect_time, &ptm_cb.t_timer);
+               event_add_timer(zrouter.master, zebra_ptm_connect, NULL,
+                               ptm_cb.reconnect_time, &ptm_cb.t_timer);
                return;
        }
 
@@ -857,8 +856,8 @@ void zebra_ptm_bfd_dst_deregister(ZAPI_HANDLER_ARGS)
 
        if (ptm_cb.ptm_sock == -1) {
                ptm_cb.t_timer = NULL;
-               thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
-                                ptm_cb.reconnect_time, &ptm_cb.t_timer);
+               event_add_timer(zrouter.master, zebra_ptm_connect, NULL,
+                               ptm_cb.reconnect_time, &ptm_cb.t_timer);
                return;
        }
 
@@ -985,8 +984,8 @@ void zebra_ptm_bfd_client_register(ZAPI_HANDLER_ARGS)
 
        if (ptm_cb.ptm_sock == -1) {
                ptm_cb.t_timer = NULL;
-               thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
-                                ptm_cb.reconnect_time, &ptm_cb.t_timer);
+               event_add_timer(zrouter.master, zebra_ptm_connect, NULL,
+                               ptm_cb.reconnect_time, &ptm_cb.t_timer);
                return;
        }
 
@@ -1044,8 +1043,8 @@ int zebra_ptm_bfd_client_deregister(struct zserv *client)
 
        if (ptm_cb.ptm_sock == -1) {
                ptm_cb.t_timer = NULL;
-               thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
-                                ptm_cb.reconnect_time, &ptm_cb.t_timer);
+               event_add_timer(zrouter.master, zebra_ptm_connect, NULL,
+                               ptm_cb.reconnect_time, &ptm_cb.t_timer);
                return 0;
        }
 
index 243ce309591b9ff747b94afccdf4488f01fd6714..edcb97ddec64bfbb1bf81d1571b23a917f27e4fe 100644 (file)
@@ -208,8 +208,8 @@ void zebra_pw_install_failure(struct zebra_pw *pw, int pwstatus)
 
        /* schedule to retry later */
        THREAD_OFF(pw->install_retry_timer);
-       thread_add_timer(zrouter.master, zebra_pw_install_retry, pw,
-                        PW_INSTALL_RETRY_INTERVAL, &pw->install_retry_timer);
+       event_add_timer(zrouter.master, zebra_pw_install_retry, pw,
+                       PW_INSTALL_RETRY_INTERVAL, &pw->install_retry_timer);
 
        zebra_pw_update_status(pw, pwstatus);
 }
index 082afbe0f75a83ee01d8dc12e84269ad014f6869..2864b92310faad86be718be03889440cf036f3d2 100644 (file)
@@ -4420,8 +4420,8 @@ void rib_update(enum rib_update_event event)
 
        ctx = rib_update_ctx_init(0, event);
 
-       thread_add_event(zrouter.master, rib_update_handler, ctx, 0,
-                        &t_rib_update_threads[event]);
+       event_add_event(zrouter.master, rib_update_handler, ctx, 0,
+                       &t_rib_update_threads[event]);
 
        if (IS_ZEBRA_DEBUG_EVENT)
                zlog_debug("%s: Scheduled VRF (ALL), event %s", __func__,
@@ -4793,8 +4793,8 @@ static int rib_dplane_results(struct dplane_ctx_list_head *ctxlist)
        }
 
        /* Ensure event is signalled to zebra main pthread */
-       thread_add_event(zrouter.master, rib_process_dplane_results, NULL, 0,
-                        &t_dplane);
+       event_add_event(zrouter.master, rib_process_dplane_results, NULL, 0,
+                       &t_dplane);
 
        return 0;
 }
index 8558d0f963cd3328db48c4ac75e4e46830634d21..b55d152ef5d3a2f9b2abc7012ba964220eeb5606 100644 (file)
@@ -1876,8 +1876,8 @@ static void zebra_route_map_mark_update(const char *rmap_name)
        if (zebra_rmap_update_timer)
                THREAD_OFF(zebra_t_rmap_update);
 
-       thread_add_timer(zrouter.master, zebra_route_map_update_timer,
-                        NULL, zebra_rmap_update_timer, &zebra_t_rmap_update);
+       event_add_timer(zrouter.master, zebra_route_map_update_timer, NULL,
+                       zebra_rmap_update_timer, &zebra_t_rmap_update);
 }
 
 static void zebra_route_map_add(const char *rmap_name)
index ba05e860a918d25b317b65dce20e2d314ef03ce4..c3ef1557b741d3f697d87a6c8bbd4b994754b977 100644 (file)
@@ -100,7 +100,7 @@ enum zserv_event {
 /*
  * Zebra server event driver for all client threads.
  *
- * This is essentially a wrapper around thread_add_event() that centralizes
+ * This is essentially a wrapper around event_add_event() that centralizes
  * those scheduling calls into one place.
  *
  * All calls to this function schedule an event on the pthread running the
@@ -118,7 +118,7 @@ static void zserv_client_event(struct zserv *client,
 /*
  * Zebra server event driver for the main thread.
  *
- * This is essentially a wrapper around thread_add_event() that centralizes
+ * This is essentially a wrapper around event_add_event() that centralizes
  * those scheduling calls into one place.
  *
  * All calls to this function schedule an event on Zebra's main pthread.
@@ -462,12 +462,12 @@ static void zserv_client_event(struct zserv *client,
 {
        switch (event) {
        case ZSERV_CLIENT_READ:
-               thread_add_read(client->pthread->master, zserv_read, client,
-                               client->sock, &client->t_read);
+               event_add_read(client->pthread->master, zserv_read, client,
+                              client->sock, &client->t_read);
                break;
        case ZSERV_CLIENT_WRITE:
-               thread_add_write(client->pthread->master, zserv_write, client,
-                                client->sock, &client->t_write);
+               event_add_write(client->pthread->master, zserv_write, client,
+                               client->sock, &client->t_write);
                break;
        }
 }
@@ -831,9 +831,9 @@ void zserv_release_client(struct zserv *client)
                         * main pthread.
                         */
                        if (client->is_closed)
-                               thread_add_event(zrouter.master,
-                                                zserv_handle_client_fail,
-                                                client, 0, &client->t_cleanup);
+                               event_add_event(zrouter.master,
+                                               zserv_handle_client_fail,
+                                               client, 0, &client->t_cleanup);
                }
        }
 
@@ -953,16 +953,15 @@ void zserv_event(struct zserv *client, enum zserv_event event)
 {
        switch (event) {
        case ZSERV_ACCEPT:
-               thread_add_read(zrouter.master, zserv_accept, NULL, zsock,
-                               NULL);
+               event_add_read(zrouter.master, zserv_accept, NULL, zsock, NULL);
                break;
        case ZSERV_PROCESS_MESSAGES:
-               thread_add_event(zrouter.master, zserv_process_messages, client,
-                                0, &client->t_process);
+               event_add_event(zrouter.master, zserv_process_messages, client,
+                               0, &client->t_process);
                break;
        case ZSERV_HANDLE_CLIENT_FAIL:
-               thread_add_event(zrouter.master, zserv_handle_client_fail,
-                                client, 0, &client->t_cleanup);
+               event_add_event(zrouter.master, zserv_handle_client_fail,
+                               client, 0, &client->t_cleanup);
        }
 }