*: Rename struct thread to struct event

Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2022-03-01 16:18:12 -05:00
parent cb37cb336a
commit e6685141aa
299 changed files with 1244 additions and 1249 deletions

View file

@ -37,11 +37,11 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
DEFINE_MGROUP(BABELD, "babeld"); DEFINE_MGROUP(BABELD, "babeld");
DEFINE_MTYPE_STATIC(BABELD, BABEL, "Babel Structure"); DEFINE_MTYPE_STATIC(BABELD, BABEL, "Babel Structure");
static void babel_init_routing_process(struct thread *thread); static void babel_init_routing_process(struct event *thread);
static void babel_get_myid(void); static void babel_get_myid(void);
static void babel_initial_noise(void); static void babel_initial_noise(void);
static void babel_read_protocol(struct thread *thread); static void babel_read_protocol(struct event *thread);
static void babel_main_loop(struct thread *thread); static void babel_main_loop(struct event *thread);
static void babel_set_timer(struct timeval *timeout); static void babel_set_timer(struct timeval *timeout);
static void babel_fill_with_next_timeout(struct timeval *tv); static void babel_fill_with_next_timeout(struct timeval *tv);
static void static void
@ -163,7 +163,7 @@ fail:
} }
/* thread reading entries form others babel daemons */ /* thread reading entries form others babel daemons */
static void babel_read_protocol(struct thread *thread) static void babel_read_protocol(struct event *thread)
{ {
int rc; int rc;
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT); struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
@ -199,7 +199,7 @@ static void babel_read_protocol(struct thread *thread)
/* Zebra will give some information, especially about interfaces. This function /* Zebra will give some information, especially about interfaces. This function
must be call with a litte timeout wich may give zebra the time to do his job, must be call with a litte timeout wich may give zebra the time to do his job,
making these inits have sense. */ making these inits have sense. */
static void babel_init_routing_process(struct thread *thread) static void babel_init_routing_process(struct event *thread)
{ {
myseqno = (frr_weak_random() & 0xFFFF); myseqno = (frr_weak_random() & 0xFFFF);
babel_get_myid(); babel_get_myid();
@ -311,7 +311,7 @@ babel_clean_routing_process(void)
} }
/* Function used with timeout. */ /* Function used with timeout. */
static void babel_main_loop(struct thread *thread) static void babel_main_loop(struct event *thread)
{ {
struct timeval tv; struct timeval tv;
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT); struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);

View file

@ -84,8 +84,8 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
struct babel struct babel
{ {
/* Babel threads. */ /* Babel threads. */
struct thread *t_read; /* on Babel protocol's socket */ struct event *t_read; /* on Babel protocol's socket */
struct thread *t_update; /* timers */ struct event *t_update; /* timers */
/* distribute_ctx */ /* distribute_ctx */
struct distribute_ctx *distribute_ctx; struct distribute_ctx *distribute_ctx;
}; };

View file

@ -618,14 +618,14 @@ struct bfd_session *ptm_bfd_sess_find(struct bfd_pkt *cp,
return bfd_key_lookup(key); return bfd_key_lookup(key);
} }
void bfd_xmt_cb(struct thread *t) void bfd_xmt_cb(struct event *t)
{ {
struct bfd_session *bs = THREAD_ARG(t); struct bfd_session *bs = THREAD_ARG(t);
ptm_bfd_xmt_TO(bs, 0); ptm_bfd_xmt_TO(bs, 0);
} }
void bfd_echo_xmt_cb(struct thread *t) void bfd_echo_xmt_cb(struct event *t)
{ {
struct bfd_session *bs = THREAD_ARG(t); struct bfd_session *bs = THREAD_ARG(t);
@ -634,7 +634,7 @@ void bfd_echo_xmt_cb(struct thread *t)
} }
/* Was ptm_bfd_detect_TO() */ /* Was ptm_bfd_detect_TO() */
void bfd_recvtimer_cb(struct thread *t) void bfd_recvtimer_cb(struct event *t)
{ {
struct bfd_session *bs = THREAD_ARG(t); struct bfd_session *bs = THREAD_ARG(t);
@ -647,7 +647,7 @@ void bfd_recvtimer_cb(struct thread *t)
} }
/* Was ptm_bfd_echo_detect_TO() */ /* Was ptm_bfd_echo_detect_TO() */
void bfd_echo_recvtimer_cb(struct thread *t) void bfd_echo_recvtimer_cb(struct event *t)
{ {
struct bfd_session *bs = THREAD_ARG(t); struct bfd_session *bs = THREAD_ARG(t);

View file

@ -265,12 +265,12 @@ struct bfd_session {
struct bfd_config_timers timers; struct bfd_config_timers timers;
struct bfd_timers cur_timers; struct bfd_timers cur_timers;
uint64_t detect_TO; uint64_t detect_TO;
struct thread *echo_recvtimer_ev; struct event *echo_recvtimer_ev;
struct thread *recvtimer_ev; struct event *recvtimer_ev;
uint64_t xmt_TO; uint64_t xmt_TO;
uint64_t echo_xmt_TO; uint64_t echo_xmt_TO;
struct thread *xmttimer_ev; struct event *xmttimer_ev;
struct thread *echo_xmttimer_ev; struct event *echo_xmttimer_ev;
uint64_t echo_detect_TO; uint64_t echo_detect_TO;
/* software object state */ /* software object state */
@ -401,8 +401,8 @@ struct bfd_control_socket {
TAILQ_ENTRY(bfd_control_socket) bcs_entry; TAILQ_ENTRY(bfd_control_socket) bcs_entry;
int bcs_sd; int bcs_sd;
struct thread *bcs_ev; struct event *bcs_ev;
struct thread *bcs_outev; struct event *bcs_outev;
struct bcqueue bcs_bcqueue; struct bcqueue bcs_bcqueue;
/* Notification data */ /* Notification data */
@ -422,7 +422,7 @@ int control_init(const char *path);
void control_shutdown(void); void control_shutdown(void);
int control_notify(struct bfd_session *bs, uint8_t notify_state); int control_notify(struct bfd_session *bs, uint8_t notify_state);
int control_notify_config(const char *op, struct bfd_session *bs); int control_notify_config(const char *op, struct bfd_session *bs);
void control_accept(struct thread *t); void control_accept(struct event *t);
/* /*
@ -439,7 +439,7 @@ struct bfd_vrf_global {
int bg_echov6; int bg_echov6;
struct vrf *vrf; struct vrf *vrf;
struct thread *bg_ev[6]; struct event *bg_ev[6];
}; };
/* Forward declaration of data plane context struct. */ /* Forward declaration of data plane context struct. */
@ -448,7 +448,7 @@ TAILQ_HEAD(dplane_queue, bfd_dplane_ctx);
struct bfd_global { struct bfd_global {
int bg_csock; int bg_csock;
struct thread *bg_csockev; struct event *bg_csockev;
struct bcslist bg_bcslist; struct bcslist bg_bcslist;
struct pllist bg_pllist; struct pllist bg_pllist;
@ -466,7 +466,7 @@ struct bfd_global {
/* Distributed BFD items. */ /* Distributed BFD items. */
bool bg_use_dplane; bool bg_use_dplane;
int bg_dplane_sock; int bg_dplane_sock;
struct thread *bg_dplane_sockev; struct event *bg_dplane_sockev;
struct dplane_queue bg_dplaneq; struct dplane_queue bg_dplaneq;
/* Debug options. */ /* Debug options. */
@ -553,7 +553,7 @@ void ptm_bfd_snd(struct bfd_session *bfd, int fbit);
void ptm_bfd_echo_snd(struct bfd_session *bfd); void ptm_bfd_echo_snd(struct bfd_session *bfd);
void ptm_bfd_echo_fp_snd(struct bfd_session *bfd); void ptm_bfd_echo_fp_snd(struct bfd_session *bfd);
void bfd_recv_cb(struct thread *t); void bfd_recv_cb(struct event *t);
/* /*
@ -561,7 +561,7 @@ void bfd_recv_cb(struct thread *t);
* *
* Contains the code related with event loop. * Contains the code related with event loop.
*/ */
typedef void (*bfd_ev_cb)(struct thread *t); typedef void (*bfd_ev_cb)(struct event *t);
void bfd_recvtimer_update(struct bfd_session *bs); void bfd_recvtimer_update(struct bfd_session *bs);
void bfd_echo_recvtimer_update(struct bfd_session *bs); void bfd_echo_recvtimer_update(struct bfd_session *bs);
@ -688,10 +688,10 @@ unsigned long bfd_get_session_count(void);
/* Export callback functions for `event.c`. */ /* Export callback functions for `event.c`. */
extern struct thread_master *master; extern struct thread_master *master;
void bfd_recvtimer_cb(struct thread *t); void bfd_recvtimer_cb(struct event *t);
void bfd_echo_recvtimer_cb(struct thread *t); void bfd_echo_recvtimer_cb(struct event *t);
void bfd_xmt_cb(struct thread *t); void bfd_xmt_cb(struct event *t);
void bfd_echo_xmt_cb(struct thread *t); void bfd_echo_xmt_cb(struct event *t);
extern struct in6_addr zero_addr; extern struct in6_addr zero_addr;

View file

@ -768,7 +768,7 @@ static void cp_debug(bool mhop, struct sockaddr_any *peer,
mhop ? "yes" : "no", peerstr, localstr, portstr, vrfstr); mhop ? "yes" : "no", peerstr, localstr, portstr, vrfstr);
} }
void bfd_recv_cb(struct thread *t) void bfd_recv_cb(struct event *t)
{ {
int sd = THREAD_FD(t); int sd = THREAD_FD(t);
struct bfd_session *bfd; struct bfd_session *bfd;

View file

@ -39,8 +39,8 @@ struct bfd_notify_peer *control_notifypeer_find(struct bfd_control_socket *bcs,
struct bfd_control_socket *control_new(int sd); struct bfd_control_socket *control_new(int sd);
static void control_free(struct bfd_control_socket *bcs); static void control_free(struct bfd_control_socket *bcs);
static void control_reset_buf(struct bfd_control_buffer *bcb); static void control_reset_buf(struct bfd_control_buffer *bcb);
static void control_read(struct thread *t); static void control_read(struct event *t);
static void control_write(struct thread *t); static void control_write(struct event *t);
static void control_handle_request_add(struct bfd_control_socket *bcs, static void control_handle_request_add(struct bfd_control_socket *bcs,
struct bfd_control_msg *bcm); struct bfd_control_msg *bcm);
@ -142,7 +142,7 @@ void control_shutdown(void)
} }
} }
void control_accept(struct thread *t) void control_accept(struct event *t)
{ {
int csock, sd = THREAD_FD(t); int csock, sd = THREAD_FD(t);
@ -379,7 +379,7 @@ static void control_reset_buf(struct bfd_control_buffer *bcb)
bcb->bcb_left = 0; bcb->bcb_left = 0;
} }
static void control_read(struct thread *t) static void control_read(struct event *t)
{ {
struct bfd_control_socket *bcs = THREAD_ARG(t); struct bfd_control_socket *bcs = THREAD_ARG(t);
struct bfd_control_buffer *bcb = &bcs->bcs_bin; struct bfd_control_buffer *bcb = &bcs->bcs_bin;
@ -514,7 +514,7 @@ schedule_next_read:
thread_add_read(master, control_read, bcs, sd, &bcs->bcs_ev); thread_add_read(master, control_read, bcs, sd, &bcs->bcs_ev);
} }
static void control_write(struct thread *t) static void control_write(struct event *t)
{ {
struct bfd_control_socket *bcs = THREAD_ARG(t); struct bfd_control_socket *bcs = THREAD_ARG(t);
struct bfd_control_buffer *bcb = bcs->bcs_bout; struct bfd_control_buffer *bcb = bcs->bcs_bout;

View file

@ -63,11 +63,11 @@ struct bfd_dplane_ctx {
/** Output buffer data. */ /** Output buffer data. */
struct stream *outbuf; struct stream *outbuf;
/** Input event data. */ /** Input event data. */
struct thread *inbufev; struct event *inbufev;
/** Output event data. */ /** Output event data. */
struct thread *outbufev; struct event *outbufev;
/** Connection event. */ /** Connection event. */
struct thread *connectev; struct event *connectev;
/** Amount of bytes read. */ /** Amount of bytes read. */
uint64_t in_bytes; uint64_t in_bytes;
@ -94,7 +94,7 @@ struct bfd_dplane_ctx {
*/ */
typedef void (*bfd_dplane_expect_cb)(struct bfddp_message *msg, void *arg); typedef void (*bfd_dplane_expect_cb)(struct bfddp_message *msg, void *arg);
static void bfd_dplane_client_connect(struct thread *t); static void bfd_dplane_client_connect(struct event *t);
static bool bfd_dplane_client_connecting(struct bfd_dplane_ctx *bdc); static bool bfd_dplane_client_connecting(struct bfd_dplane_ctx *bdc);
static void bfd_dplane_ctx_free(struct bfd_dplane_ctx *bdc); static void bfd_dplane_ctx_free(struct bfd_dplane_ctx *bdc);
static int _bfd_dplane_add_session(struct bfd_dplane_ctx *bdc, static int _bfd_dplane_add_session(struct bfd_dplane_ctx *bdc,
@ -312,7 +312,7 @@ static ssize_t bfd_dplane_flush(struct bfd_dplane_ctx *bdc)
return total; return total;
} }
static void bfd_dplane_write(struct thread *t) static void bfd_dplane_write(struct event *t)
{ {
struct bfd_dplane_ctx *bdc = THREAD_ARG(t); struct bfd_dplane_ctx *bdc = THREAD_ARG(t);
@ -599,7 +599,7 @@ skip_read:
return 0; return 0;
} }
static void bfd_dplane_read(struct thread *t) static void bfd_dplane_read(struct event *t)
{ {
struct bfd_dplane_ctx *bdc = THREAD_ARG(t); struct bfd_dplane_ctx *bdc = THREAD_ARG(t);
int rv; int rv;
@ -819,7 +819,7 @@ static uint16_t bfd_dplane_request_counters(const struct bfd_session *bs)
/* /*
* Data plane listening socket. * Data plane listening socket.
*/ */
static void bfd_dplane_accept(struct thread *t) static void bfd_dplane_accept(struct event *t)
{ {
struct bfd_global *bg = THREAD_ARG(t); struct bfd_global *bg = THREAD_ARG(t);
struct bfd_dplane_ctx *bdc; struct bfd_dplane_ctx *bdc;
@ -899,7 +899,7 @@ static bool bfd_dplane_client_connecting(struct bfd_dplane_ctx *bdc)
} }
} }
static void bfd_dplane_client_connect(struct thread *t) static void bfd_dplane_client_connect(struct event *t)
{ {
struct bfd_dplane_ctx *bdc = THREAD_ARG(t); struct bfd_dplane_ctx *bdc = THREAD_ARG(t);
int rv, sock; int rv, sock;

View file

@ -1335,7 +1335,7 @@ static void bmp_stat_put_u32(struct stream *s, size_t *cnt, uint16_t type,
(*cnt)++; (*cnt)++;
} }
static void bmp_stats(struct thread *thread) static void bmp_stats(struct event *thread)
{ {
struct bmp_targets *bt = THREAD_ARG(thread); struct bmp_targets *bt = THREAD_ARG(thread);
struct stream *s; struct stream *s;
@ -1388,7 +1388,7 @@ static void bmp_stats(struct thread *thread)
} }
/* read from the BMP socket to detect session termination */ /* read from the BMP socket to detect session termination */
static void bmp_read(struct thread *t) static void bmp_read(struct event *t)
{ {
struct bmp *bmp = THREAD_ARG(t); struct bmp *bmp = THREAD_ARG(t);
char buf[1024]; char buf[1024];
@ -1492,7 +1492,7 @@ static struct bmp *bmp_open(struct bmp_targets *bt, int bmp_sock)
} }
/* Accept BMP connection. */ /* Accept BMP connection. */
static void bmp_accept(struct thread *thread) static void bmp_accept(struct event *thread)
{ {
union sockunion su; union sockunion su;
struct bmp_listener *bl = THREAD_ARG(thread); struct bmp_listener *bl = THREAD_ARG(thread);
@ -1902,7 +1902,7 @@ static void bmp_active_resolved(struct resolver_query *resq, const char *errstr,
bmp_active_connect(ba); bmp_active_connect(ba);
} }
static void bmp_active_thread(struct thread *t) static void bmp_active_thread(struct event *t)
{ {
struct bmp_active *ba = THREAD_ARG(t); struct bmp_active *ba = THREAD_ARG(t);
socklen_t slen; socklen_t slen;

View file

@ -112,7 +112,7 @@ struct bmp {
int socket; int socket;
char remote[SU_ADDRSTRLEN + 6]; char remote[SU_ADDRSTRLEN + 6];
struct thread *t_read; struct event *t_read;
struct pullwr *pullwr; struct pullwr *pullwr;
@ -176,7 +176,7 @@ struct bmp_active {
union sockunion addrs[8]; union sockunion addrs[8];
int socket; int socket;
const char *last_err; const char *last_err;
struct thread *t_timer, *t_read, *t_write; struct event *t_timer, *t_read, *t_write;
}; };
/* config & state for passive / listening sockets */ /* config & state for passive / listening sockets */
@ -190,7 +190,7 @@ struct bmp_listener {
union sockunion addr; union sockunion addr;
int port; int port;
struct thread *t_accept; struct event *t_accept;
int sock; int sock;
}; };
@ -226,7 +226,7 @@ struct bmp_targets {
struct bmp_actives_head actives; struct bmp_actives_head actives;
struct thread *t_stats; struct event *t_stats;
struct bmp_session_head sessions; struct bmp_session_head sessions;
struct bmp_qhash_head updhash; struct bmp_qhash_head updhash;

View file

@ -150,7 +150,7 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi,
/* Handler of conditional advertisement timer event. /* Handler of conditional advertisement timer event.
* Each route in the condition-map is evaluated. * Each route in the condition-map is evaluated.
*/ */
static void bgp_conditional_adv_timer(struct thread *t) static void bgp_conditional_adv_timer(struct event *t)
{ {
afi_t afi; afi_t afi;
safi_t safi; safi_t safi;

View file

@ -98,7 +98,7 @@ int bgp_damp_decay(time_t tdiff, int penalty, struct bgp_damp_config *bdc)
/* Handler of reuse timer event. Each route in the current reuse-list /* Handler of reuse timer event. Each route in the current reuse-list
is evaluated. RFC2439 Section 4.8.7. */ is evaluated. RFC2439 Section 4.8.7. */
static void bgp_reuse_timer(struct thread *t) static void bgp_reuse_timer(struct event *t)
{ {
struct bgp_damp_info *bdi; struct bgp_damp_info *bdi;
struct bgp_damp_info *next; struct bgp_damp_info *next;

View file

@ -92,7 +92,7 @@ struct bgp_damp_config {
struct bgp_damp_info *no_reuse_list; struct bgp_damp_info *no_reuse_list;
/* Reuse timer thread per-set base. */ /* Reuse timer thread per-set base. */
struct thread *t_reuse; struct event *t_reuse;
afi_t afi; afi_t afi;
safi_t safi; safi_t safi;

View file

@ -69,11 +69,11 @@ struct bgp_dump {
char *interval_str; char *interval_str;
struct thread *t_interval; struct event *t_interval;
}; };
static int bgp_dump_unset(struct bgp_dump *bgp_dump); static int bgp_dump_unset(struct bgp_dump *bgp_dump);
static void bgp_dump_interval_func(struct thread *); static void bgp_dump_interval_func(struct event *);
/* BGP packet dump output buffer. */ /* BGP packet dump output buffer. */
struct stream *bgp_dump_obuf; struct stream *bgp_dump_obuf;
@ -428,7 +428,7 @@ static unsigned int bgp_dump_routes_func(int afi, int first_run,
return seq; return seq;
} }
static void bgp_dump_interval_func(struct thread *t) static void bgp_dump_interval_func(struct event *t)
{ {
struct bgp_dump *bgp_dump; struct bgp_dump *bgp_dump;
bgp_dump = THREAD_ARG(t); bgp_dump = THREAD_ARG(t);

View file

@ -65,7 +65,7 @@ static void bgp_evpn_mac_update_on_es_local_chg(struct bgp_evpn_es *es,
bool is_local); bool is_local);
esi_t zero_esi_buf, *zero_esi = &zero_esi_buf; esi_t zero_esi_buf, *zero_esi = &zero_esi_buf;
static void bgp_evpn_run_consistency_checks(struct thread *t); static void bgp_evpn_run_consistency_checks(struct event *t);
static void bgp_evpn_path_nh_info_free(struct bgp_path_evpn_nh_info *nh_info); static void bgp_evpn_path_nh_info_free(struct bgp_path_evpn_nh_info *nh_info);
static void bgp_evpn_path_nh_unlink(struct bgp_path_evpn_nh_info *nh_info); static void bgp_evpn_path_nh_unlink(struct bgp_path_evpn_nh_info *nh_info);
@ -4360,7 +4360,7 @@ static uint32_t bgp_evpn_es_run_consistency_checks(struct bgp_evpn_es *es)
return proc_cnt; return proc_cnt;
} }
static void bgp_evpn_run_consistency_checks(struct thread *t) static void bgp_evpn_run_consistency_checks(struct event *t)
{ {
int proc_cnt = 0; int proc_cnt = 0;
struct listnode *node; struct listnode *node;

View file

@ -299,7 +299,7 @@ struct bgp_evpn_mh_info {
/* List of ESs with pending/periodic processing */ /* List of ESs with pending/periodic processing */
struct list *pend_es_list; struct list *pend_es_list;
/* periodic timer for running background consistency checks */ /* periodic timer for running background consistency checks */
struct thread *t_cons_check; struct event *t_cons_check;
/* config knobs for optimizing or interop */ /* config knobs for optimizing or interop */
/* Generate EAD-EVI routes even if the ES is oper-down. This can be /* Generate EAD-EVI routes even if the ES is oper-down. This can be

View file

@ -82,13 +82,13 @@ static const char *const bgp_event_str[] = {
function. */ function. */
/* BGP event function. */ /* BGP event function. */
void bgp_event(struct thread *); void bgp_event(struct event *event);
/* BGP thread functions. */ /* BGP thread functions. */
static void bgp_start_timer(struct thread *); static void bgp_start_timer(struct event *event);
static void bgp_connect_timer(struct thread *); static void bgp_connect_timer(struct event *event);
static void bgp_holdtime_timer(struct thread *); static void bgp_holdtime_timer(struct event *event);
static void bgp_delayopen_timer(struct thread *); static void bgp_delayopen_timer(struct event *event);
/* BGP FSM functions. */ /* BGP FSM functions. */
static enum bgp_fsm_state_progress bgp_start(struct peer *); static enum bgp_fsm_state_progress bgp_start(struct peer *);
@ -502,7 +502,7 @@ void bgp_timer_set(struct peer *peer)
/* BGP start timer. This function set BGP_Start event to thread value /* BGP start timer. This function set BGP_Start event to thread value
and process event. */ and process event. */
static void bgp_start_timer(struct thread *thread) static void bgp_start_timer(struct event *thread)
{ {
struct peer *peer; struct peer *peer;
@ -516,7 +516,7 @@ static void bgp_start_timer(struct thread *thread)
} }
/* BGP connect retry timer. */ /* BGP connect retry timer. */
static void bgp_connect_timer(struct thread *thread) static void bgp_connect_timer(struct event *thread)
{ {
struct peer *peer; struct peer *peer;
@ -540,7 +540,7 @@ static void bgp_connect_timer(struct thread *thread)
} }
/* BGP holdtime timer. */ /* BGP holdtime timer. */
static void bgp_holdtime_timer(struct thread *thread) static void bgp_holdtime_timer(struct event *thread)
{ {
atomic_size_t inq_count; atomic_size_t inq_count;
struct peer *peer; struct peer *peer;
@ -571,7 +571,7 @@ static void bgp_holdtime_timer(struct thread *thread)
bgp_event(thread); /* bgp_event unlocks peer */ bgp_event(thread); /* bgp_event unlocks peer */
} }
void bgp_routeadv_timer(struct thread *thread) void bgp_routeadv_timer(struct event *thread)
{ {
struct peer *peer; struct peer *peer;
@ -592,7 +592,7 @@ void bgp_routeadv_timer(struct thread *thread)
} }
/* RFC 4271 DelayOpenTimer */ /* RFC 4271 DelayOpenTimer */
void bgp_delayopen_timer(struct thread *thread) void bgp_delayopen_timer(struct event *thread)
{ {
struct peer *peer; struct peer *peer;
@ -668,7 +668,7 @@ static void bgp_graceful_restart_timer_off(struct peer *peer)
bgp_timer_set(peer); bgp_timer_set(peer);
} }
static void bgp_llgr_stale_timer_expire(struct thread *thread) static void bgp_llgr_stale_timer_expire(struct event *thread)
{ {
struct peer_af *paf; struct peer_af *paf;
struct peer *peer; struct peer *peer;
@ -770,7 +770,7 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi)
} }
} }
static void bgp_graceful_restart_timer_expire(struct thread *thread) static void bgp_graceful_restart_timer_expire(struct event *thread)
{ {
struct peer *peer, *tmp_peer; struct peer *peer, *tmp_peer;
struct listnode *node, *nnode; struct listnode *node, *nnode;
@ -836,7 +836,7 @@ static void bgp_graceful_restart_timer_expire(struct thread *thread)
bgp_graceful_restart_timer_off(peer); bgp_graceful_restart_timer_off(peer);
} }
static void bgp_graceful_stale_timer_expire(struct thread *thread) static void bgp_graceful_stale_timer_expire(struct event *thread)
{ {
struct peer *peer; struct peer *peer;
afi_t afi; afi_t afi;
@ -855,7 +855,7 @@ static void bgp_graceful_stale_timer_expire(struct thread *thread)
} }
/* Selection deferral timer processing function */ /* Selection deferral timer processing function */
static void bgp_graceful_deferral_timer_expire(struct thread *thread) static void bgp_graceful_deferral_timer_expire(struct event *thread)
{ {
struct afi_safi_info *info; struct afi_safi_info *info;
afi_t afi; afi_t afi;
@ -1125,7 +1125,7 @@ int bgp_fsm_error_subcode(int status)
} }
/* The maxmed onstartup timer expiry callback. */ /* The maxmed onstartup timer expiry callback. */
static void bgp_maxmed_onstartup_timer(struct thread *thread) static void bgp_maxmed_onstartup_timer(struct event *thread)
{ {
struct bgp *bgp; struct bgp *bgp;
@ -1167,7 +1167,7 @@ static void bgp_maxmed_onstartup_process_status_change(struct peer *peer)
} }
/* The update delay timer expiry callback. */ /* The update delay timer expiry callback. */
static void bgp_update_delay_timer(struct thread *thread) static void bgp_update_delay_timer(struct event *thread)
{ {
struct bgp *bgp; struct bgp *bgp;
@ -1179,7 +1179,7 @@ static void bgp_update_delay_timer(struct thread *thread)
} }
/* The establish wait timer expiry callback. */ /* The establish wait timer expiry callback. */
static void bgp_establish_wait_timer(struct thread *thread) static void bgp_establish_wait_timer(struct event *thread)
{ {
struct bgp *bgp; struct bgp *bgp;
@ -1654,7 +1654,7 @@ bgp_stop_with_notify(struct peer *peer, uint8_t code, uint8_t sub_code)
* when the connection is established. A read event is triggered when the * when the connection is established. A read event is triggered when the
* connection is closed. Thus we need to cancel whichever one did not occur. * connection is closed. Thus we need to cancel whichever one did not occur.
*/ */
static void bgp_connect_check(struct thread *thread) static void bgp_connect_check(struct event *thread)
{ {
int status; int status;
socklen_t slen; socklen_t slen;
@ -2572,7 +2572,7 @@ static const struct {
}; };
/* Execute event process. */ /* Execute event process. */
void bgp_event(struct thread *thread) void bgp_event(struct event *thread)
{ {
enum bgp_fsm_events event; enum bgp_fsm_events event;
struct peer *peer; struct peer *peer;

View file

@ -105,11 +105,11 @@
* Update FSM for peer based on whether we have valid nexthops or not. * Update FSM for peer based on whether we have valid nexthops or not.
*/ */
extern void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops); extern void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops);
extern void bgp_event(struct thread *); extern void bgp_event(struct event *event);
extern int bgp_event_update(struct peer *, enum bgp_fsm_events event); extern int bgp_event_update(struct peer *, enum bgp_fsm_events event);
extern int bgp_stop(struct peer *peer); extern int bgp_stop(struct peer *peer);
extern void bgp_timer_set(struct peer *); extern void bgp_timer_set(struct peer *);
extern void bgp_routeadv_timer(struct thread *); extern void bgp_routeadv_timer(struct event *event);
extern void bgp_fsm_change_status(struct peer *peer, extern void bgp_fsm_change_status(struct peer *peer,
enum bgp_fsm_status status); enum bgp_fsm_status status);
extern const char *const peer_down_str[]; extern const char *const peer_down_str[];

View file

@ -31,8 +31,8 @@
/* forward declarations */ /* forward declarations */
static uint16_t bgp_write(struct peer *); static uint16_t bgp_write(struct peer *);
static uint16_t bgp_read(struct peer *peer, int *code_p); static uint16_t bgp_read(struct peer *peer, int *code_p);
static void bgp_process_writes(struct thread *); static void bgp_process_writes(struct event *event);
static void bgp_process_reads(struct thread *); static void bgp_process_reads(struct event *event);
static bool validate_header(struct peer *); static bool validate_header(struct peer *);
/* generic i/o status codes */ /* generic i/o status codes */
@ -108,7 +108,7 @@ void bgp_reads_off(struct peer *peer)
/* /*
* Called from I/O pthread when a file descriptor has become ready for writing. * Called from I/O pthread when a file descriptor has become ready for writing.
*/ */
static void bgp_process_writes(struct thread *thread) static void bgp_process_writes(struct event *thread)
{ {
static struct peer *peer; static struct peer *peer;
peer = THREAD_ARG(thread); peer = THREAD_ARG(thread);
@ -210,7 +210,7 @@ static int read_ibuf_work(struct peer *peer)
* We read as much data as possible, process as many packets as we can and * We read as much data as possible, process as many packets as we can and
* place them on peer->ibuf for secondary processing by the main thread. * place them on peer->ibuf for secondary processing by the main thread.
*/ */
static void bgp_process_reads(struct thread *thread) static void bgp_process_reads(struct event *thread)
{ {
/* clang-format off */ /* clang-format off */
static struct peer *peer; /* peer to read from */ static struct peer *peer; /* peer to read from */

View file

@ -1091,7 +1091,7 @@ struct lp_test {
struct timeval starttime; struct timeval starttime;
struct skiplist *timestamps_alloc; struct skiplist *timestamps_alloc;
struct skiplist *timestamps_dealloc; struct skiplist *timestamps_dealloc;
struct thread *event_thread; struct event *event_thread;
unsigned int counter[LPT_STAT_MAX]; unsigned int counter[LPT_STAT_MAX];
}; };
@ -1150,7 +1150,7 @@ static int test_cb(mpls_label_t label, void *labelid, bool allocated)
return 0; return 0;
} }
static void labelpool_test_event_handler(struct thread *thread) static void labelpool_test_event_handler(struct event *thread)
{ {
struct lp_test *tcb; struct lp_test *tcb;

View file

@ -338,7 +338,7 @@ static void bgp_socket_set_buffer_size(const int fd)
} }
/* Accept bgp connection. */ /* Accept bgp connection. */
static void bgp_accept(struct thread *thread) static void bgp_accept(struct event *thread)
{ {
int bgp_sock; int bgp_sock;
int accept_sock; int accept_sock;

View file

@ -11,7 +11,7 @@
struct bgp_listener { struct bgp_listener {
int fd; int fd;
union sockunion su; union sockunion su;
struct thread *thread; struct event *thread;
struct bgp *bgp; struct bgp *bgp;
char *name; char *name;
}; };

View file

@ -37,7 +37,7 @@ extern struct zclient *zclient;
static void register_zebra_rnh(struct bgp_nexthop_cache *bnc); static void register_zebra_rnh(struct bgp_nexthop_cache *bnc);
static void unregister_zebra_rnh(struct bgp_nexthop_cache *bnc); static void unregister_zebra_rnh(struct bgp_nexthop_cache *bnc);
static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p); static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p);
static void bgp_nht_ifp_initial(struct thread *thread); static void bgp_nht_ifp_initial(struct event *thread);
static int bgp_isvalid_nexthop(struct bgp_nexthop_cache *bnc) static int bgp_isvalid_nexthop(struct bgp_nexthop_cache *bnc)
{ {
@ -756,7 +756,7 @@ void bgp_nht_ifp_down(struct interface *ifp)
bgp_nht_ifp_handle(ifp, false); bgp_nht_ifp_handle(ifp, false);
} }
static void bgp_nht_ifp_initial(struct thread *thread) static void bgp_nht_ifp_initial(struct event *thread)
{ {
ifindex_t ifindex = THREAD_VAL(thread); ifindex_t ifindex = THREAD_VAL(thread);
struct bgp *bgp = THREAD_ARG(thread); struct bgp *bgp = THREAD_ARG(thread);

View file

@ -442,7 +442,7 @@ static void bgp_write_proceed_actions(struct peer *peer)
* update group a peer belongs to, encode this information into packets, and * update group a peer belongs to, encode this information into packets, and
* enqueue the packets onto the peer's output buffer. * enqueue the packets onto the peer's output buffer.
*/ */
void bgp_generate_updgrp_packets(struct thread *thread) void bgp_generate_updgrp_packets(struct event *thread)
{ {
struct peer *peer = THREAD_ARG(thread); struct peer *peer = THREAD_ARG(thread);
@ -1792,7 +1792,7 @@ static int bgp_keepalive_receive(struct peer *peer, bgp_size_t size)
return Receive_KEEPALIVE_message; return Receive_KEEPALIVE_message;
} }
static void bgp_refresh_stalepath_timer_expire(struct thread *thread) static void bgp_refresh_stalepath_timer_expire(struct event *thread)
{ {
struct peer_af *paf; struct peer_af *paf;
@ -2867,7 +2867,7 @@ int bgp_capability_receive(struct peer *peer, bgp_size_t size)
* @param thread * @param thread
* @return 0 * @return 0
*/ */
void bgp_process_packet(struct thread *thread) void bgp_process_packet(struct event *thread)
{ {
/* Yes first of all get peer pointer. */ /* Yes first of all get peer pointer. */
struct peer *peer; // peer struct peer *peer; // peer
@ -3044,7 +3044,7 @@ void bgp_send_delayed_eor(struct bgp *bgp)
* having the io pthread try to enqueue fsm events or mess with the peer * having the io pthread try to enqueue fsm events or mess with the peer
* struct. * struct.
*/ */
void bgp_packet_process_error(struct thread *thread) void bgp_packet_process_error(struct event *thread)
{ {
struct peer *peer; struct peer *peer;
int code; int code;

View file

@ -66,13 +66,13 @@ extern void bgp_check_update_delay(struct bgp *);
extern int bgp_packet_set_marker(struct stream *s, uint8_t type); extern int bgp_packet_set_marker(struct stream *s, uint8_t type);
extern void bgp_packet_set_size(struct stream *s); extern void bgp_packet_set_size(struct stream *s);
extern void bgp_generate_updgrp_packets(struct thread *); extern void bgp_generate_updgrp_packets(struct event *event);
extern void bgp_process_packet(struct thread *); extern void bgp_process_packet(struct event *event);
extern void bgp_send_delayed_eor(struct bgp *bgp); extern void bgp_send_delayed_eor(struct bgp *bgp);
/* Task callback to handle socket error encountered in the io pthread */ /* Task callback to handle socket error encountered in the io pthread */
void bgp_packet_process_error(struct thread *thread); void bgp_packet_process_error(struct event *thread);
extern struct bgp_notify extern struct bgp_notify
bgp_notify_decapsulate_hard_reset(struct bgp_notify *notify); bgp_notify_decapsulate_hard_reset(struct bgp_notify *notify);
extern bool bgp_has_graceful_restart_notification(struct peer *peer); extern bool bgp_has_graceful_restart_notification(struct peer *peer);

View file

@ -2618,7 +2618,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
return true; return true;
} }
static void bgp_route_select_timer_expire(struct thread *thread) static void bgp_route_select_timer_expire(struct event *thread)
{ {
struct afi_safi_info *info; struct afi_safi_info *info;
afi_t afi; afi_t afi;
@ -3381,7 +3381,7 @@ void bgp_best_path_select_defer(struct bgp *bgp, afi_t afi, safi_t safi)
struct afi_safi_info *thread_info; struct afi_safi_info *thread_info;
if (bgp->gr_info[afi][safi].t_route_select) { if (bgp->gr_info[afi][safi].t_route_select) {
struct thread *t = bgp->gr_info[afi][safi].t_route_select; struct event *t = bgp->gr_info[afi][safi].t_route_select;
thread_info = THREAD_ARG(t); thread_info = THREAD_ARG(t);
XFREE(MTYPE_TMP, thread_info); XFREE(MTYPE_TMP, thread_info);
@ -3585,7 +3585,7 @@ void bgp_add_eoiu_mark(struct bgp *bgp)
work_queue_add(bgp->process_queue, pqnode); work_queue_add(bgp->process_queue, pqnode);
} }
static void bgp_maximum_prefix_restart_timer(struct thread *thread) static void bgp_maximum_prefix_restart_timer(struct event *thread)
{ {
struct peer *peer; struct peer *peer;
@ -5055,7 +5055,7 @@ void bgp_stop_announce_route_timer(struct peer_af *paf)
* Callback that is invoked when the route announcement timer for a * Callback that is invoked when the route announcement timer for a
* peer_af expires. * peer_af expires.
*/ */
static void bgp_announce_route_timer_expired(struct thread *t) static void bgp_announce_route_timer_expired(struct event *t)
{ {
struct peer_af *paf; struct peer_af *paf;
struct peer *peer; struct peer *peer;
@ -5215,7 +5215,7 @@ static void bgp_soft_reconfig_table(struct peer *peer, afi_t afi, safi_t safi,
* Without splitting the full job into several part, * Without splitting the full job into several part,
* vtysh waits for the job to finish before responding to a BGP command * vtysh waits for the job to finish before responding to a BGP command
*/ */
static void bgp_soft_reconfig_table_task(struct thread *thread) static void bgp_soft_reconfig_table_task(struct event *thread)
{ {
uint32_t iter, max_iter; uint32_t iter, max_iter;
struct bgp_dest *dest; struct bgp_dest *dest;
@ -13342,7 +13342,7 @@ static void bgp_table_stats_rn(struct bgp_dest *dest, struct bgp_dest *top,
} }
} }
static void bgp_table_stats_walker(struct thread *t) static void bgp_table_stats_walker(struct event *t)
{ {
struct bgp_dest *dest, *ndest; struct bgp_dest *dest, *ndest;
struct bgp_dest *top; struct bgp_dest *top;
@ -13739,7 +13739,7 @@ static void bgp_peer_count_proc(struct bgp_dest *rn, struct peer_pcounts *pc)
} }
} }
static void bgp_peer_count_walker(struct thread *t) static void bgp_peer_count_walker(struct event *t)
{ {
struct bgp_dest *rn, *rm; struct bgp_dest *rn, *rm;
const struct bgp_table *table; const struct bgp_table *table;

View file

@ -182,7 +182,7 @@ struct bgp_path_info_extra {
} export; } export;
struct { struct {
struct thread *timer; struct event *timer;
void *hme; /* encap monitor, if this is a VPN route */ void *hme; /* encap monitor, if this is a VPN route */
struct prefix_rd struct prefix_rd
rd; /* import: route's route-distinguisher */ rd; /* import: route's route-distinguisher */

View file

@ -4344,7 +4344,7 @@ static void bgp_route_map_process_update_cb(char *rmap_name)
vpn_policy_routemap_event(rmap_name); vpn_policy_routemap_event(rmap_name);
} }
void bgp_route_map_update_timer(struct thread *thread) void bgp_route_map_update_timer(struct event *thread)
{ {
route_map_walk_update_list(bgp_route_map_process_update_cb); route_map_walk_update_list(bgp_route_map_process_update_cb);
} }

View file

@ -53,7 +53,7 @@ DEFINE_MTYPE_STATIC(BGPD, BGP_RPKI_REVALIDATE, "BGP RPKI Revalidation");
#define RETRY_INTERVAL_DEFAULT 600 #define RETRY_INTERVAL_DEFAULT 600
#define BGP_RPKI_CACHE_SERVER_SYNC_RETRY_TIMEOUT 3 #define BGP_RPKI_CACHE_SERVER_SYNC_RETRY_TIMEOUT 3
static struct thread *t_rpki_sync; static struct event *t_rpki_sync;
#define RPKI_DEBUG(...) \ #define RPKI_DEBUG(...) \
if (rpki_debug) { \ if (rpki_debug) { \
@ -381,7 +381,7 @@ struct rpki_revalidate_prefix {
safi_t safi; safi_t safi;
}; };
static void rpki_revalidate_prefix(struct thread *thread) static void rpki_revalidate_prefix(struct event *thread)
{ {
struct rpki_revalidate_prefix *rrp = THREAD_ARG(thread); struct rpki_revalidate_prefix *rrp = THREAD_ARG(thread);
struct bgp_dest *match, *node; struct bgp_dest *match, *node;
@ -402,7 +402,7 @@ static void rpki_revalidate_prefix(struct thread *thread)
XFREE(MTYPE_BGP_RPKI_REVALIDATE, rrp); XFREE(MTYPE_BGP_RPKI_REVALIDATE, rrp);
} }
static void bgpd_sync_callback(struct thread *thread) static void bgpd_sync_callback(struct event *thread)
{ {
struct bgp *bgp; struct bgp *bgp;
struct listnode *node; struct listnode *node;
@ -489,7 +489,7 @@ struct rpki_revalidate_peer {
struct peer *peer; struct peer *peer;
}; };
static void bgp_rpki_revalidate_peer(struct thread *thread) static void bgp_rpki_revalidate_peer(struct event *thread)
{ {
struct rpki_revalidate_peer *rvp = THREAD_ARG(thread); struct rpki_revalidate_peer *rvp = THREAD_ARG(thread);
@ -631,7 +631,7 @@ static int bgp_rpki_module_init(void)
return 0; return 0;
} }
static void sync_expired(struct thread *thread) static void sync_expired(struct event *thread)
{ {
if (!rtr_mgr_conf_in_sync(rtr_config)) { if (!rtr_mgr_conf_in_sync(rtr_config)) {
RPKI_DEBUG("rtr_mgr is not synced, retrying."); RPKI_DEBUG("rtr_mgr is not synced, retrying.");

View file

@ -29,7 +29,7 @@ struct bgp_table {
/* soft_reconfig_table in progress */ /* soft_reconfig_table in progress */
bool soft_reconfig_init; bool soft_reconfig_init;
struct thread *soft_reconfig_thread; struct event *soft_reconfig_thread;
/* list of peers on which soft_reconfig_table has to run */ /* list of peers on which soft_reconfig_table has to run */
struct list *soft_reconfig_peers; struct list *soft_reconfig_peers;

View file

@ -1418,7 +1418,7 @@ bool update_subgroup_check_merge(struct update_subgroup *subgrp,
/* /*
* update_subgroup_merge_check_thread_cb * update_subgroup_merge_check_thread_cb
*/ */
static void update_subgroup_merge_check_thread_cb(struct thread *thread) static void update_subgroup_merge_check_thread_cb(struct event *thread)
{ {
struct update_subgroup *subgrp; struct update_subgroup *subgrp;
@ -2107,7 +2107,7 @@ update_group_default_originate_route_map_walkcb(struct update_group *updgrp,
return UPDWALK_CONTINUE; return UPDWALK_CONTINUE;
} }
void update_group_refresh_default_originate_route_map(struct thread *thread) void update_group_refresh_default_originate_route_map(struct event *thread)
{ {
struct bgp *bgp; struct bgp *bgp;
char reason[] = "refresh default-originate route-map"; char reason[] = "refresh default-originate route-map";

View file

@ -197,10 +197,10 @@ struct update_subgroup {
/* announcement attribute hash */ /* announcement attribute hash */
struct hash *hash; struct hash *hash;
struct thread *t_coalesce; struct event *t_coalesce;
uint32_t v_coalesce; uint32_t v_coalesce;
struct thread *t_merge_check; struct event *t_merge_check;
/* table version that the subgroup has caught up to. */ /* table version that the subgroup has caught up to. */
uint64_t version; uint64_t version;
@ -373,7 +373,7 @@ extern void update_group_af_walk(struct bgp *bgp, afi_t afi, safi_t safi,
extern void update_group_walk(struct bgp *bgp, updgrp_walkcb cb, void *ctx); extern void update_group_walk(struct bgp *bgp, updgrp_walkcb cb, void *ctx);
extern void update_group_periodic_merge(struct bgp *bgp); extern void update_group_periodic_merge(struct bgp *bgp);
extern void extern void
update_group_refresh_default_originate_route_map(struct thread *thread); update_group_refresh_default_originate_route_map(struct event *thread);
extern void update_group_start_advtimer(struct bgp *bgp); extern void update_group_start_advtimer(struct bgp *bgp);
extern void update_subgroup_inherit_info(struct update_subgroup *to, extern void update_subgroup_inherit_info(struct update_subgroup *to,

View file

@ -298,7 +298,7 @@ static void updgrp_show_adj(struct bgp *bgp, afi_t afi, safi_t safi,
update_group_af_walk(bgp, afi, safi, updgrp_show_adj_walkcb, &ctx); update_group_af_walk(bgp, afi, safi, updgrp_show_adj_walkcb, &ctx);
} }
static void subgroup_coalesce_timer(struct thread *thread) static void subgroup_coalesce_timer(struct event *thread)
{ {
struct update_subgroup *subgrp; struct update_subgroup *subgrp;
struct bgp *bgp; struct bgp *bgp;

View file

@ -18764,14 +18764,14 @@ static const struct cmd_variable_handler bgp_var_peergroup[] = {
DEFINE_HOOK(bgp_config_end, (struct bgp *bgp), (bgp)); DEFINE_HOOK(bgp_config_end, (struct bgp *bgp), (bgp));
static struct thread *t_bgp_cfg; static struct event *t_bgp_cfg;
bool bgp_config_inprocess(void) bool bgp_config_inprocess(void)
{ {
return thread_is_scheduled(t_bgp_cfg); return thread_is_scheduled(t_bgp_cfg);
} }
static void bgp_config_finish(struct thread *t) static void bgp_config_finish(struct event *t)
{ {
struct listnode *node; struct listnode *node;
struct bgp *bgp; struct bgp *bgp;

View file

@ -1046,14 +1046,14 @@ static bool bgp_table_map_apply(struct route_map *map, const struct prefix *p,
return false; return false;
} }
static struct thread *bgp_tm_thread_connect; static struct event *bgp_tm_thread_connect;
static bool bgp_tm_status_connected; static bool bgp_tm_status_connected;
static bool bgp_tm_chunk_obtained; static bool bgp_tm_chunk_obtained;
#define BGP_FLOWSPEC_TABLE_CHUNK 100000 #define BGP_FLOWSPEC_TABLE_CHUNK 100000
static uint32_t bgp_tm_min, bgp_tm_max, bgp_tm_chunk_size; static uint32_t bgp_tm_min, bgp_tm_max, bgp_tm_chunk_size;
struct bgp *bgp_tm_bgp; struct bgp *bgp_tm_bgp;
static void bgp_zebra_tm_connect(struct thread *t) static void bgp_zebra_tm_connect(struct event *t)
{ {
struct zclient *zclient; struct zclient *zclient;
int delay = 10, ret = 0; int delay = 10, ret = 0;

View file

@ -3197,7 +3197,7 @@ int peer_group_bind(struct bgp *bgp, union sockunion *su, struct peer *peer,
return 0; return 0;
} }
static void bgp_startup_timer_expire(struct thread *thread) static void bgp_startup_timer_expire(struct event *thread)
{ {
struct bgp *bgp; struct bgp *bgp;
@ -3761,7 +3761,7 @@ int bgp_delete(struct bgp *bgp)
/* Delete the graceful restart info */ /* Delete the graceful restart info */
FOREACH_AFI_SAFI (afi, safi) { FOREACH_AFI_SAFI (afi, safi) {
struct thread *t; struct event *t;
gr_info = &bgp->gr_info[afi][safi]; gr_info = &bgp->gr_info[afi][safi];
if (!gr_info) if (!gr_info)

View file

@ -126,7 +126,7 @@ struct bgp_master {
uint64_t subgrp_idspace; uint64_t subgrp_idspace;
/* timer to dampen route map changes */ /* timer to dampen route map changes */
struct thread *t_rmap_update; /* Handle route map updates */ struct event *t_rmap_update; /* Handle route map updates */
uint32_t rmap_update_timer; /* Route map update timer */ uint32_t rmap_update_timer; /* Route map update timer */
#define RMAP_DEFAULT_UPDATE_TIMER 5 /* disabled by default */ #define RMAP_DEFAULT_UPDATE_TIMER 5 /* disabled by default */
@ -266,11 +266,11 @@ struct graceful_restart_info {
/* Count of EOR received */ /* Count of EOR received */
uint32_t eor_received; uint32_t eor_received;
/* Deferral Timer */ /* Deferral Timer */
struct thread *t_select_deferral; struct event *t_select_deferral;
/* Routes Deferred */ /* Routes Deferred */
uint32_t gr_deferred; uint32_t gr_deferred;
/* Best route select */ /* Best route select */
struct thread *t_route_select; struct event *t_route_select;
/* AFI, SAFI enabled */ /* AFI, SAFI enabled */
bool af_enabled[AFI_MAX][SAFI_MAX]; bool af_enabled[AFI_MAX][SAFI_MAX];
/* Route update completed */ /* Route update completed */
@ -406,15 +406,16 @@ struct bgp {
struct as_confed *confed_peers; struct as_confed *confed_peers;
int confed_peers_cnt; int confed_peers_cnt;
struct thread /* start-up timer on only once at the beginning */
*t_startup; /* start-up timer on only once at the beginning */ struct event *t_startup;
uint32_t v_maxmed_onstartup; /* Duration of max-med on start-up */ uint32_t v_maxmed_onstartup; /* Duration of max-med on start-up */
#define BGP_MAXMED_ONSTARTUP_UNCONFIGURED 0 /* 0 means off, its the default */ #define BGP_MAXMED_ONSTARTUP_UNCONFIGURED 0 /* 0 means off, its the default */
uint32_t maxmed_onstartup_value; /* Max-med value when active on uint32_t maxmed_onstartup_value; /* Max-med value when active on
start-up */ start-up */
struct thread
*t_maxmed_onstartup; /* non-null when max-med onstartup is on */ /* non-null when max-med onstartup is on */
struct event *t_maxmed_onstartup;
uint8_t maxmed_onstartup_over; /* Flag to make it effective only once */ uint8_t maxmed_onstartup_over; /* Flag to make it effective only once */
bool v_maxmed_admin; /* true/false if max-med administrative is on/off bool v_maxmed_admin; /* true/false if max-med administrative is on/off
@ -428,9 +429,9 @@ struct bgp {
uint32_t maxmed_value; /* Max-med value when its active */ uint32_t maxmed_value; /* Max-med value when its active */
/* BGP update delay on startup */ /* BGP update delay on startup */
struct thread *t_update_delay; struct event *t_update_delay;
struct thread *t_establish_wait; struct event *t_establish_wait;
struct thread *t_revalidate[AFI_MAX][SAFI_MAX]; struct event *t_revalidate[AFI_MAX][SAFI_MAX];
uint8_t update_delay_over; uint8_t update_delay_over;
uint8_t main_zebra_update_hold; uint8_t main_zebra_update_hold;
@ -590,7 +591,7 @@ struct bgp {
struct hash *pbr_action_hash; struct hash *pbr_action_hash;
/* timer to re-evaluate neighbor default-originate route-maps */ /* timer to re-evaluate neighbor default-originate route-maps */
struct thread *t_rmap_def_originate_eval; struct event *t_rmap_def_originate_eval;
#define RMAP_DEFAULT_ORIGINATE_EVAL_TIMER 5 #define RMAP_DEFAULT_ORIGINATE_EVAL_TIMER 5
/* BGP distance configuration. */ /* BGP distance configuration. */
@ -769,7 +770,7 @@ struct bgp {
/* BGP Conditional advertisement */ /* BGP Conditional advertisement */
uint32_t condition_check_period; uint32_t condition_check_period;
uint32_t condition_filter_count; uint32_t condition_filter_count;
struct thread *t_condition_check; struct event *t_condition_check;
/* BGP VPN SRv6 backend */ /* BGP VPN SRv6 backend */
bool srv6_enabled; bool srv6_enabled;
@ -978,7 +979,7 @@ struct peer_af {
/* /*
* Trigger timer for bgp_announce_route(). * Trigger timer for bgp_announce_route().
*/ */
struct thread *t_announce_route; struct event *t_announce_route;
afi_t afi; afi_t afi;
safi_t safi; safi_t safi;
@ -1509,24 +1510,24 @@ struct peer {
_Atomic uint32_t v_gr_restart; _Atomic uint32_t v_gr_restart;
/* Threads. */ /* Threads. */
struct thread *t_read; struct event *t_read;
struct thread *t_write; struct event *t_write;
struct thread *t_start; struct event *t_start;
struct thread *t_connect_check_r; struct event *t_connect_check_r;
struct thread *t_connect_check_w; struct event *t_connect_check_w;
struct thread *t_connect; struct event *t_connect;
struct thread *t_holdtime; struct event *t_holdtime;
struct thread *t_routeadv; struct event *t_routeadv;
struct thread *t_delayopen; struct event *t_delayopen;
struct thread *t_pmax_restart; struct event *t_pmax_restart;
struct thread *t_gr_restart; struct event *t_gr_restart;
struct thread *t_gr_stale; struct event *t_gr_stale;
struct thread *t_llgr_stale[AFI_MAX][SAFI_MAX]; struct event *t_llgr_stale[AFI_MAX][SAFI_MAX];
struct thread *t_revalidate_all[AFI_MAX][SAFI_MAX]; struct event *t_revalidate_all[AFI_MAX][SAFI_MAX];
struct thread *t_generate_updgrp_packets; struct event *t_generate_updgrp_packets;
struct thread *t_process_packet; struct event *t_process_packet;
struct thread *t_process_packet_error; struct event *t_process_packet_error;
struct thread *t_refresh_stalepath; struct event *t_refresh_stalepath;
/* Thread flags. */ /* Thread flags. */
_Atomic uint32_t thread_flags; _Atomic uint32_t thread_flags;
@ -2363,7 +2364,7 @@ extern int peer_ttl_security_hops_unset(struct peer *);
extern void peer_tx_shutdown_message_set(struct peer *, const char *msg); extern void peer_tx_shutdown_message_set(struct peer *, const char *msg);
extern void peer_tx_shutdown_message_unset(struct peer *); extern void peer_tx_shutdown_message_unset(struct peer *);
extern void bgp_route_map_update_timer(struct thread *thread); extern void bgp_route_map_update_timer(struct event *thread);
extern const char *bgp_get_name_by_role(uint8_t role); extern const char *bgp_get_name_by_role(uint8_t role);
extern enum asnotation_mode bgp_get_asnotation(struct bgp *bgp); extern enum asnotation_mode bgp_get_asnotation(struct bgp *bgp);

View file

@ -2345,7 +2345,7 @@ static void rfapiMonitorEncapDelete(struct bgp_path_info *vpn_bpi)
/* /*
* Timer callback for withdraw * Timer callback for withdraw
*/ */
static void rfapiWithdrawTimerVPN(struct thread *t) static void rfapiWithdrawTimerVPN(struct event *t)
{ {
struct rfapi_withdraw *wcb = THREAD_ARG(t); struct rfapi_withdraw *wcb = THREAD_ARG(t);
struct bgp_path_info *bpi = wcb->info; struct bgp_path_info *bpi = wcb->info;
@ -2654,7 +2654,7 @@ rfapiWithdrawEncapUpdateCachedUn(struct rfapi_import_table *import_table,
return 0; return 0;
} }
static void rfapiWithdrawTimerEncap(struct thread *t) static void rfapiWithdrawTimerEncap(struct event *t)
{ {
struct rfapi_withdraw *wcb = THREAD_ARG(t); struct rfapi_withdraw *wcb = THREAD_ARG(t);
struct bgp_path_info *bpi = wcb->info; struct bgp_path_info *bpi = wcb->info;
@ -2739,7 +2739,7 @@ static void
rfapiBiStartWithdrawTimer(struct rfapi_import_table *import_table, rfapiBiStartWithdrawTimer(struct rfapi_import_table *import_table,
struct agg_node *rn, struct bgp_path_info *bpi, struct agg_node *rn, struct bgp_path_info *bpi,
afi_t afi, safi_t safi, afi_t afi, safi_t safi,
void (*timer_service_func)(struct thread *)) void (*timer_service_func)(struct event *))
{ {
uint32_t lifetime; uint32_t lifetime;
struct rfapi_withdraw *wcb; struct rfapi_withdraw *wcb;
@ -2831,7 +2831,7 @@ static void rfapiExpireEncapNow(struct rfapi_import_table *it,
struct agg_node *rn, struct bgp_path_info *bpi) struct agg_node *rn, struct bgp_path_info *bpi)
{ {
struct rfapi_withdraw *wcb; struct rfapi_withdraw *wcb;
struct thread t; struct event t;
/* /*
* pretend we're an expiring timer * pretend we're an expiring timer
@ -3094,7 +3094,7 @@ static void rfapiBgpInfoFilteredImportEncap(
* bpi * bpi
*/ */
struct rfapi_withdraw *wcb; struct rfapi_withdraw *wcb;
struct thread t; struct event t;
/* /*
* pretend we're an expiring timer * pretend we're an expiring timer
@ -3305,7 +3305,7 @@ static void rfapiExpireVpnNow(struct rfapi_import_table *it,
int lockoffset) int lockoffset)
{ {
struct rfapi_withdraw *wcb; struct rfapi_withdraw *wcb;
struct thread t; struct event t;
/* /*
* pretend we're an expiring timer * pretend we're an expiring timer
@ -4046,7 +4046,7 @@ static void rfapiProcessPeerDownRt(struct peer *peer,
struct agg_node *rn; struct agg_node *rn;
struct bgp_path_info *bpi; struct bgp_path_info *bpi;
struct agg_table *rt = NULL; struct agg_table *rt = NULL;
void (*timer_service_func)(struct thread *) = NULL; void (*timer_service_func)(struct event *) = NULL;
assert(afi == AFI_IP || afi == AFI_IP6); assert(afi == AFI_IP || afi == AFI_IP6);

View file

@ -730,7 +730,7 @@ void rfapiMonitorResponseRemovalOn(struct bgp *bgp)
bgp->rfapi_cfg->flags &= ~BGP_VNC_CONFIG_RESPONSE_REMOVAL_DISABLE; bgp->rfapi_cfg->flags &= ~BGP_VNC_CONFIG_RESPONSE_REMOVAL_DISABLE;
} }
static void rfapiMonitorTimerExpire(struct thread *t) static void rfapiMonitorTimerExpire(struct event *t)
{ {
struct rfapi_monitor_vpn *m = THREAD_ARG(t); struct rfapi_monitor_vpn *m = THREAD_ARG(t);
@ -1036,7 +1036,7 @@ void rfapiMonitorMovedUp(struct rfapi_import_table *import_table,
} }
} }
static void rfapiMonitorEthTimerExpire(struct thread *t) static void rfapiMonitorEthTimerExpire(struct event *t)
{ {
struct rfapi_monitor_eth *m = THREAD_ARG(t); struct rfapi_monitor_eth *m = THREAD_ARG(t);

View file

@ -25,7 +25,7 @@ struct rfapi_monitor_vpn {
#define RFAPI_MON_FLAG_NEEDCALLBACK 0x00000001 /* deferred callback */ #define RFAPI_MON_FLAG_NEEDCALLBACK 0x00000001 /* deferred callback */
// int dcount; /* debugging counter */ // int dcount; /* debugging counter */
struct thread *timer; struct event *timer;
}; };
struct rfapi_monitor_encap { struct rfapi_monitor_encap {
@ -41,7 +41,7 @@ struct rfapi_monitor_eth {
struct rfapi_descriptor *rfd; /* which NVE requested the route */ struct rfapi_descriptor *rfd; /* which NVE requested the route */
struct ethaddr macaddr; struct ethaddr macaddr;
uint32_t logical_net_id; uint32_t logical_net_id;
struct thread *timer; struct event *timer;
}; };
/* /*

View file

@ -278,7 +278,7 @@ struct rfapi_rib_tcb {
/* /*
* remove route from rib * remove route from rib
*/ */
static void rfapiRibExpireTimer(struct thread *t) static void rfapiRibExpireTimer(struct event *t)
{ {
struct rfapi_rib_tcb *tcb = THREAD_ARG(t); struct rfapi_rib_tcb *tcb = THREAD_ARG(t);

View file

@ -61,7 +61,7 @@ struct rfapi_info {
struct bgp_tea_options *tea_options; struct bgp_tea_options *tea_options;
struct rfapi_un_option *un_options; struct rfapi_un_option *un_options;
struct rfapi_vn_option *vn_options; struct rfapi_vn_option *vn_options;
struct thread *timer; struct event *timer;
}; };
/* /*

View file

@ -516,8 +516,7 @@ void rfapiPrintBi(void *stream, struct bgp_path_info *bpi)
if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra
&& bpi->extra->vnc.import.timer) { && bpi->extra->vnc.import.timer) {
struct thread *t = struct event *t = (struct event *)bpi->extra->vnc.import.timer;
(struct thread *)bpi->extra->vnc.import.timer;
r = snprintf(p, REMAIN, " [%4lu] ", r = snprintf(p, REMAIN, " [%4lu] ",
thread_timer_remain_second(t)); thread_timer_remain_second(t));
INCP; INCP;
@ -1114,8 +1113,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream,
time_t age; time_t age;
char buf_age[BUFSIZ]; char buf_age[BUFSIZ];
struct thread *t = struct event *t = (struct event *)bpi->extra->vnc.import.timer;
(struct thread *)bpi->extra->vnc.import.timer;
remaining = thread_timer_remain_second(t); remaining = thread_timer_remain_second(t);
#ifdef RFAPI_REGISTRATIONS_REPORT_AGE #ifdef RFAPI_REGISTRATIONS_REPORT_AGE

View file

@ -1704,7 +1704,7 @@ void vnc_direct_bgp_rh_add_route(struct bgp *bgp, afi_t afi,
bgp_attr_unintern(&iattr); bgp_attr_unintern(&iattr);
} }
static void vncExportWithdrawTimer(struct thread *t) static void vncExportWithdrawTimer(struct event *t)
{ {
struct vnc_export_info *eti = THREAD_ARG(t); struct vnc_export_info *eti = THREAD_ARG(t);
const struct prefix *p = agg_node_get_prefix(eti->node); const struct prefix *p = agg_node_get_prefix(eti->node);

View file

@ -29,7 +29,7 @@ struct vnc_export_info {
uint8_t type; uint8_t type;
uint8_t subtype; uint8_t subtype;
uint32_t lifetime; uint32_t lifetime;
struct thread *timer; struct event *timer;
}; };
extern struct agg_node *vnc_etn_get(struct bgp *bgp, vnc_export_type_t type, extern struct agg_node *vnc_etn_get(struct bgp *bgp, vnc_export_type_t type,

View file

@ -335,16 +335,16 @@ Time/interval formats
FRR library helper formats FRR library helper formats
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
.. frrfmt:: %pTH (struct thread *) .. frrfmt:: %pTH (struct event *)
Print remaining time on timer thread. Interval-printing flag characters Print remaining time on timer event. Interval-printing flag characters
listed above for ``%pTV`` can be added, e.g. ``%pTHtx``. listed above for ``%pTV`` can be added, e.g. ``%pTHtx``.
``NULL`` pointers are printed as ``-``. ``NULL`` pointers are printed as ``-``.
.. frrfmt:: %pTHD (struct thread *) .. frrfmt:: %pTHD (struct event *)
Print debugging information for given thread. Sample output: Print debugging information for given event. Sample output:
.. code-block:: none .. code-block:: none

View file

@ -28,7 +28,7 @@ within the event system are variations on the term "thread". The primary
datastructure that holds the state of an event loop in this system is called a datastructure that holds the state of an event loop in this system is called a
"threadmaster". Events scheduled on the event loop - what would today be called "threadmaster". Events scheduled on the event loop - what would today be called
an 'event' or 'task' in systems such as libevent - are called "threads" and the an 'event' or 'task' in systems such as libevent - are called "threads" and the
datastructure for them is ``struct thread``. To add to the confusion, these datastructure for them is ``struct event``. To add to the confusion, these
"threads" have various types, one of which is "event". To hopefully avoid some "threads" have various types, one of which is "event". To hopefully avoid some
of this confusion, this document refers to these "threads" as a 'task' except of this confusion, this document refers to these "threads" as a 'task' except
where the datastructures are explicitly named. When they are explicitly named, where the datastructures are explicitly named. When they are explicitly named,
@ -80,8 +80,8 @@ are given by integer macros in :file:`event.h` and are:
Type used internally for tasks on the ready queue. Type used internally for tasks on the ready queue.
``THREAD_UNUSED`` ``THREAD_UNUSED``
Type used internally for ``struct thread`` objects that aren't being used. Type used internally for ``struct event`` objects that aren't being used.
The event system pools ``struct thread`` to avoid heap allocations; this is The event system pools ``struct event`` to avoid heap allocations; this is
the type they have when they're in the pool. the type they have when they're in the pool.
``THREAD_EXECUTE`` ``THREAD_EXECUTE``
@ -95,9 +95,9 @@ irrelevant for the time being) for the specific type. For example, to add a
:: ::
thread_add_read(struct thread_master *master, int (*handler)(struct thread *), void *arg, int fd, struct thread **ref); thread_add_read(struct thread_master *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref);
The ``struct thread`` is then created and added to the appropriate internal The ``struct event`` is then created and added to the appropriate internal
datastructure within the ``threadmaster``. Note that the ``READ`` and datastructure within the ``threadmaster``. Note that the ``READ`` and
``WRITE`` tasks are independent - a ``READ`` task only tests for ``WRITE`` tasks are independent - a ``READ`` task only tests for
readability, for example. readability, for example.
@ -133,7 +133,7 @@ illustrated at the bottom.
Mapping the general names used in the figure to specific FRR functions: Mapping the general names used in the figure to specific FRR functions:
- ``task`` is ``struct thread *`` - ``task`` is ``struct event *``
- ``fetch`` is ``thread_fetch()`` - ``fetch`` is ``thread_fetch()``
- ``exec()`` is ``thread_call`` - ``exec()`` is ``thread_call``
- ``cancel()`` is ``thread_cancel()`` - ``cancel()`` is ``thread_cancel()``

View file

@ -120,7 +120,7 @@ atomic ops & datastructures with other types of locking, e.g. rwlocks.
The ``thread_master`` code currently always holds RCU everywhere, except The ``thread_master`` code currently always holds RCU everywhere, except
while doing the actual ``poll()`` syscall. This is both an optimization as while doing the actual ``poll()`` syscall. This is both an optimization as
well as an "easement" into getting RCU going. The current implementation well as an "easement" into getting RCU going. The current implementation
contract is that any ``struct thread *`` callback is called with a RCU contract is that any ``struct event *`` callback is called with a RCU
holding depth of 1, and that this is owned by the thread so it may (should) holding depth of 1, and that this is owned by the thread so it may (should)
drop and reacquire it when doing some longer-running work. drop and reacquire it when doing some longer-running work.

View file

@ -242,7 +242,7 @@ void eigrp_distribute_update_all_wrapper(struct access_list *notused)
* Called when 10sec waiting time expire and * Called when 10sec waiting time expire and
* executes Graceful restart for whole process * executes Graceful restart for whole process
*/ */
void eigrp_distribute_timer_process(struct thread *thread) void eigrp_distribute_timer_process(struct event *thread)
{ {
struct eigrp *eigrp; struct eigrp *eigrp;
@ -263,7 +263,7 @@ void eigrp_distribute_timer_process(struct thread *thread)
* Called when 10sec waiting time expire and * Called when 10sec waiting time expire and
* executes Graceful restart for interface * executes Graceful restart for interface
*/ */
void eigrp_distribute_timer_interface(struct thread *thread) void eigrp_distribute_timer_interface(struct event *thread)
{ {
struct eigrp_interface *ei; struct eigrp_interface *ei;

View file

@ -23,7 +23,7 @@ extern void eigrp_distribute_update(struct distribute_ctx *ctx,
extern void eigrp_distribute_update_interface(struct interface *ifp); extern void eigrp_distribute_update_interface(struct interface *ifp);
extern void eigrp_distribute_update_all(struct prefix_list *plist); extern void eigrp_distribute_update_all(struct prefix_list *plist);
extern void eigrp_distribute_update_all_wrapper(struct access_list *alist); extern void eigrp_distribute_update_all_wrapper(struct access_list *alist);
extern void eigrp_distribute_timer_process(struct thread *thread); extern void eigrp_distribute_timer_process(struct event *thread);
extern void eigrp_distribute_timer_interface(struct thread *thread); extern void eigrp_distribute_timer_interface(struct event *thread);
#endif /* EIGRPD_EIGRP_FILTER_H_ */ #endif /* EIGRPD_EIGRP_FILTER_H_ */

View file

@ -66,7 +66,7 @@ static const struct message eigrp_general_tlv_type_str[] = {
* Sends hello packet via multicast for all interfaces eigrp * Sends hello packet via multicast for all interfaces eigrp
* is configured for * is configured for
*/ */
void eigrp_hello_timer(struct thread *thread) void eigrp_hello_timer(struct event *thread)
{ {
struct eigrp_interface *ei; struct eigrp_interface *ei;

View file

@ -174,7 +174,7 @@ void eigrp_nbr_delete(struct eigrp_neighbor *nbr)
XFREE(MTYPE_EIGRP_NEIGHBOR, nbr); XFREE(MTYPE_EIGRP_NEIGHBOR, nbr);
} }
void holddown_timer_expired(struct thread *thread) void holddown_timer_expired(struct event *thread)
{ {
struct eigrp_neighbor *nbr = THREAD_ARG(thread); struct eigrp_neighbor *nbr = THREAD_ARG(thread);
struct eigrp *eigrp = nbr->ei->eigrp; struct eigrp *eigrp = nbr->ei->eigrp;

View file

@ -24,7 +24,7 @@ extern struct eigrp_neighbor *eigrp_nbr_get(struct eigrp_interface *ei,
extern struct eigrp_neighbor *eigrp_nbr_new(struct eigrp_interface *ei); extern struct eigrp_neighbor *eigrp_nbr_new(struct eigrp_interface *ei);
extern void eigrp_nbr_delete(struct eigrp_neighbor *neigh); extern void eigrp_nbr_delete(struct eigrp_neighbor *neigh);
extern void holddown_timer_expired(struct thread *thread); extern void holddown_timer_expired(struct event *thread);
extern int eigrp_neighborship_check(struct eigrp_neighbor *neigh, extern int eigrp_neighborship_check(struct eigrp_neighbor *neigh,
struct TLV_Parameter_Type *tlv); struct TLV_Parameter_Type *tlv);

View file

@ -20,7 +20,7 @@ extern int eigrp_if_ipmulticast(struct eigrp *, struct prefix *, unsigned int);
extern int eigrp_network_set(struct eigrp *eigrp, struct prefix *p); extern int eigrp_network_set(struct eigrp *eigrp, struct prefix *p);
extern int eigrp_network_unset(struct eigrp *eigrp, struct prefix *p); extern int eigrp_network_unset(struct eigrp *eigrp, struct prefix *p);
extern void eigrp_hello_timer(struct thread *thread); extern void eigrp_hello_timer(struct event *thread);
extern void eigrp_if_update(struct interface *); extern void eigrp_if_update(struct interface *);
extern int eigrp_if_add_allspfrouters(struct eigrp *, struct prefix *, extern int eigrp_if_add_allspfrouters(struct eigrp *, struct prefix *,
unsigned int); unsigned int);

View file

@ -305,7 +305,7 @@ int eigrp_check_sha256_digest(struct stream *s,
return 1; return 1;
} }
void eigrp_write(struct thread *thread) void eigrp_write(struct event *thread)
{ {
struct eigrp *eigrp = THREAD_ARG(thread); struct eigrp *eigrp = THREAD_ARG(thread);
struct eigrp_header *eigrph; struct eigrp_header *eigrph;
@ -459,7 +459,7 @@ out:
} }
/* Starting point of packet process function. */ /* Starting point of packet process function. */
void eigrp_read(struct thread *thread) void eigrp_read(struct event *thread)
{ {
int ret; int ret;
struct stream *ibuf; struct stream *ibuf;
@ -970,7 +970,7 @@ static int eigrp_check_network_mask(struct eigrp_interface *ei,
return 0; return 0;
} }
void eigrp_unack_packet_retrans(struct thread *thread) void eigrp_unack_packet_retrans(struct event *thread)
{ {
struct eigrp_neighbor *nbr; struct eigrp_neighbor *nbr;
nbr = (struct eigrp_neighbor *)THREAD_ARG(thread); nbr = (struct eigrp_neighbor *)THREAD_ARG(thread);
@ -1006,7 +1006,7 @@ void eigrp_unack_packet_retrans(struct thread *thread)
} }
} }
void eigrp_unack_multicast_packet_retrans(struct thread *thread) void eigrp_unack_multicast_packet_retrans(struct event *thread)
{ {
struct eigrp_neighbor *nbr; struct eigrp_neighbor *nbr;
nbr = (struct eigrp_neighbor *)THREAD_ARG(thread); nbr = (struct eigrp_neighbor *)THREAD_ARG(thread);

View file

@ -18,8 +18,8 @@
#define _ZEBRA_EIGRP_PACKET_H #define _ZEBRA_EIGRP_PACKET_H
/*Prototypes*/ /*Prototypes*/
extern void eigrp_read(struct thread *thread); extern void eigrp_read(struct event *thread);
extern void eigrp_write(struct thread *thread); extern void eigrp_write(struct event *thread);
extern struct eigrp_packet *eigrp_packet_new(size_t size, extern struct eigrp_packet *eigrp_packet_new(size_t size,
struct eigrp_neighbor *nbr); struct eigrp_neighbor *nbr);
@ -51,8 +51,8 @@ extern uint16_t eigrp_add_authTLV_MD5_to_stream(struct stream *s,
extern uint16_t eigrp_add_authTLV_SHA256_to_stream(struct stream *s, extern uint16_t eigrp_add_authTLV_SHA256_to_stream(struct stream *s,
struct eigrp_interface *ei); struct eigrp_interface *ei);
extern void eigrp_unack_packet_retrans(struct thread *thread); extern void eigrp_unack_packet_retrans(struct event *thread);
extern void eigrp_unack_multicast_packet_retrans(struct thread *thread); extern void eigrp_unack_multicast_packet_retrans(struct event *thread);
/* /*
* untill there is reason to have their own header, these externs are found in * untill there is reason to have their own header, these externs are found in
@ -65,7 +65,7 @@ extern void eigrp_hello_send_ack(struct eigrp_neighbor *nbr);
extern void eigrp_hello_receive(struct eigrp *eigrp, struct ip *iph, extern void eigrp_hello_receive(struct eigrp *eigrp, struct ip *iph,
struct eigrp_header *eigrph, struct stream *s, struct eigrp_header *eigrph, struct stream *s,
struct eigrp_interface *ei, int size); struct eigrp_interface *ei, int size);
extern void eigrp_hello_timer(struct thread *thread); extern void eigrp_hello_timer(struct event *thread);
/* /*
* These externs are found in eigrp_update.c * These externs are found in eigrp_update.c
@ -81,7 +81,7 @@ extern void eigrp_update_send_all(struct eigrp *eigrp,
struct eigrp_interface *exception); struct eigrp_interface *exception);
extern void eigrp_update_send_init(struct eigrp_neighbor *nbr); extern void eigrp_update_send_init(struct eigrp_neighbor *nbr);
extern void eigrp_update_send_EOT(struct eigrp_neighbor *nbr); extern void eigrp_update_send_EOT(struct eigrp_neighbor *nbr);
extern void eigrp_update_send_GR_thread(struct thread *thread); extern void eigrp_update_send_GR_thread(struct event *thread);
extern void eigrp_update_send_GR(struct eigrp_neighbor *nbr, extern void eigrp_update_send_GR(struct eigrp_neighbor *nbr,
enum GR_type gr_type, struct vty *vty); enum GR_type gr_type, struct vty *vty);
extern void eigrp_update_send_interface_GR(struct eigrp_interface *ei, extern void eigrp_update_send_interface_GR(struct eigrp_interface *ei,

View file

@ -71,9 +71,9 @@ struct eigrp {
struct list *oi_write_q; struct list *oi_write_q;
/*Threads*/ /*Threads*/
struct thread *t_write; struct event *t_write;
struct thread *t_read; struct event *t_read;
struct thread *t_distribute; /* timer for distribute list */ struct event *t_distribute; /* timer for distribute list */
struct route_table *networks; /* EIGRP config networks. */ struct route_table *networks; /* EIGRP config networks. */
@ -165,8 +165,8 @@ struct eigrp_interface {
struct list *nbrs; /* EIGRP Neighbor List */ struct list *nbrs; /* EIGRP Neighbor List */
/* Threads. */ /* Threads. */
struct thread *t_hello; /* timer */ struct event *t_hello; /* timer */
struct thread *t_distribute; /* timer for distribute list */ struct event *t_distribute; /* timer for distribute list */
int on_write_q; int on_write_q;
@ -240,8 +240,8 @@ struct eigrp_neighbor {
uint16_t v_holddown; uint16_t v_holddown;
/* Threads. */ /* Threads. */
struct thread *t_holddown; struct event *t_holddown;
struct thread *t_nbr_send_gr; /* thread for sending multiple GR packet struct event *t_nbr_send_gr; /* thread for sending multiple GR packet
chunks */ chunks */
struct eigrp_fifo *retrans_queue; struct eigrp_fifo *retrans_queue;
@ -271,7 +271,7 @@ struct eigrp_packet {
struct in_addr dst; struct in_addr dst;
/*Packet retransmission thread*/ /*Packet retransmission thread*/
struct thread *t_retrans_timer; struct event *t_retrans_timer;
/*Packet retransmission counter*/ /*Packet retransmission counter*/
uint8_t retrans_counter; uint8_t retrans_counter;

View file

@ -895,7 +895,7 @@ static void eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
* *
* Uses nbr_gr_packet_type and t_nbr_send_gr from neighbor. * Uses nbr_gr_packet_type and t_nbr_send_gr from neighbor.
*/ */
void eigrp_update_send_GR_thread(struct thread *thread) void eigrp_update_send_GR_thread(struct event *thread)
{ {
struct eigrp_neighbor *nbr; struct eigrp_neighbor *nbr;

View file

@ -40,7 +40,7 @@ struct fabricd {
enum fabricd_sync_state initial_sync_state; enum fabricd_sync_state initial_sync_state;
time_t initial_sync_start; time_t initial_sync_start;
struct isis_circuit *initial_sync_circuit; struct isis_circuit *initial_sync_circuit;
struct thread *initial_sync_timeout; struct event *initial_sync_timeout;
struct isis_spftree *spftree; struct isis_spftree *spftree;
struct skiplist *neighbors; struct skiplist *neighbors;
@ -49,8 +49,8 @@ struct fabricd {
uint8_t tier; uint8_t tier;
uint8_t tier_config; uint8_t tier_config;
uint8_t tier_pending; uint8_t tier_pending;
struct thread *tier_calculation_timer; struct event *tier_calculation_timer;
struct thread *tier_set_timer; struct event *tier_set_timer;
int csnp_delay; int csnp_delay;
bool always_send_csnp; bool always_send_csnp;
@ -237,7 +237,7 @@ void fabricd_finish(struct fabricd *f)
hash_free(f->neighbors_neighbors); hash_free(f->neighbors_neighbors);
} }
static void fabricd_initial_sync_timeout(struct thread *thread) static void fabricd_initial_sync_timeout(struct event *thread)
{ {
struct fabricd *f = THREAD_ARG(thread); struct fabricd *f = THREAD_ARG(thread);
@ -389,14 +389,14 @@ static uint8_t fabricd_calculate_fabric_tier(struct isis_area *area)
return tier; return tier;
} }
static void fabricd_tier_set_timer(struct thread *thread) static void fabricd_tier_set_timer(struct event *thread)
{ {
struct fabricd *f = THREAD_ARG(thread); struct fabricd *f = THREAD_ARG(thread);
fabricd_set_tier(f, f->tier_pending); fabricd_set_tier(f, f->tier_pending);
} }
static void fabricd_tier_calculation_cb(struct thread *thread) static void fabricd_tier_calculation_cb(struct event *thread)
{ {
struct fabricd *f = THREAD_ARG(thread); struct fabricd *f = THREAD_ARG(thread);
uint8_t tier = ISIS_TIER_UNDEFINED; uint8_t tier = ISIS_TIER_UNDEFINED;

View file

@ -478,7 +478,7 @@ const char *isis_adj_yang_state(enum isis_adj_state state)
assert(!"Reached end of function where we are not expecting to"); assert(!"Reached end of function where we are not expecting to");
} }
void isis_adj_expire(struct thread *thread) void isis_adj_expire(struct event *thread)
{ {
struct isis_adjacency *adj; struct isis_adjacency *adj;

View file

@ -90,7 +90,7 @@ struct isis_adjacency {
enum isis_threeway_state threeway_state; enum isis_threeway_state threeway_state;
uint32_t ext_circuit_id; uint32_t ext_circuit_id;
int flaps; /* number of adjacency flaps */ int flaps; /* number of adjacency flaps */
struct thread *t_expire; /* expire after hold_time */ struct event *t_expire; /* expire after hold_time */
struct isis_circuit *circuit; /* back pointer */ struct isis_circuit *circuit; /* back pointer */
uint16_t *mt_set; /* Topologies this adjacency is valid for */ uint16_t *mt_set; /* Topologies this adjacency is valid for */
unsigned int mt_count; /* Number of entries in mt_set */ unsigned int mt_count; /* Number of entries in mt_set */
@ -128,7 +128,7 @@ void isis_adj_state_change(struct isis_adjacency **adj,
enum isis_adj_state state, const char *reason); enum isis_adj_state state, const char *reason);
void isis_adj_print(struct isis_adjacency *adj); void isis_adj_print(struct isis_adjacency *adj);
const char *isis_adj_yang_state(enum isis_adj_state state); const char *isis_adj_yang_state(enum isis_adj_state state);
void isis_adj_expire(struct thread *thread); void isis_adj_expire(struct event *thread);
void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty, void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
char detail); char detail);
void isis_adj_print_json(struct isis_adjacency *adj, struct json_object *json, void isis_adj_print_json(struct isis_adjacency *adj, struct json_object *json,
@ -136,6 +136,6 @@ void isis_adj_print_json(struct isis_adjacency *adj, struct json_object *json,
void isis_adj_build_neigh_list(struct list *adjdb, struct list *list); void isis_adj_build_neigh_list(struct list *adjdb, struct list *list);
void isis_adj_build_up_list(struct list *adjdb, struct list *list); void isis_adj_build_up_list(struct list *adjdb, struct list *list);
int isis_adj_usage2levels(enum isis_adj_usage usage); int isis_adj_usage2levels(enum isis_adj_usage usage);
void isis_bfd_startup_timer(struct thread *thread); void isis_bfd_startup_timer(struct event *thread);
const char *isis_adj_name(const struct isis_adjacency *adj); const char *isis_adj_name(const struct isis_adjacency *adj);
#endif /* ISIS_ADJACENCY_H */ #endif /* ISIS_ADJACENCY_H */

View file

@ -41,21 +41,21 @@ struct metric {
struct isis_bcast_info { struct isis_bcast_info {
uint8_t snpa[ETH_ALEN]; /* SNPA of this circuit */ uint8_t snpa[ETH_ALEN]; /* SNPA of this circuit */
char run_dr_elect[ISIS_LEVELS]; /* Should we run dr election ? */ char run_dr_elect[ISIS_LEVELS]; /* Should we run dr election ? */
struct thread *t_run_dr[ISIS_LEVELS]; /* DR election thread */ struct event *t_run_dr[ISIS_LEVELS]; /* DR election thread */
struct thread *t_send_lan_hello[ISIS_LEVELS]; /* send LAN IIHs in this struct event *t_send_lan_hello[ISIS_LEVELS]; /* send LAN IIHs in this
thread */ thread */
struct list *adjdb[ISIS_LEVELS]; /* adjacency dbs */ struct list *adjdb[ISIS_LEVELS]; /* adjacency dbs */
struct list *lan_neighs[ISIS_LEVELS]; /* list of lx neigh snpa */ struct list *lan_neighs[ISIS_LEVELS]; /* list of lx neigh snpa */
char is_dr[ISIS_LEVELS]; /* Are we level x DR ? */ char is_dr[ISIS_LEVELS]; /* Are we level x DR ? */
uint8_t l1_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-1 DR */ uint8_t l1_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-1 DR */
uint8_t l2_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-2 DR */ uint8_t l2_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-2 DR */
struct thread *t_refresh_pseudo_lsp[ISIS_LEVELS]; /* refresh pseudo-node struct event *t_refresh_pseudo_lsp[ISIS_LEVELS]; /* refresh pseudo-node
LSPs */ LSPs */
}; };
struct isis_p2p_info { struct isis_p2p_info {
struct isis_adjacency *neighbor; struct isis_adjacency *neighbor;
struct thread *t_send_p2p_hello; /* send P2P IIHs in this thread */ struct event *t_send_p2p_hello; /* send P2P IIHs in this thread */
}; };
struct isis_circuit_arg { struct isis_circuit_arg {
@ -85,9 +85,9 @@ struct isis_circuit {
/* /*
* Threads * Threads
*/ */
struct thread *t_read; struct event *t_read;
struct thread *t_send_csnp[ISIS_LEVELS]; struct event *t_send_csnp[ISIS_LEVELS];
struct thread *t_send_psnp[ISIS_LEVELS]; struct event *t_send_psnp[ISIS_LEVELS];
struct isis_tx_queue *tx_queue; struct isis_tx_queue *tx_queue;
struct isis_circuit_arg struct isis_circuit_arg
level_arg[ISIS_LEVELS]; /* used as argument for threads */ level_arg[ISIS_LEVELS]; /* used as argument for threads */

View file

@ -48,7 +48,7 @@ const char *isis_disflag2string(int disflag)
return NULL; /* not reached */ return NULL; /* not reached */
} }
void isis_run_dr(struct thread *thread) void isis_run_dr(struct event *thread)
{ {
struct isis_circuit_arg *arg = THREAD_ARG(thread); struct isis_circuit_arg *arg = THREAD_ARG(thread);

View file

@ -11,7 +11,7 @@
#ifndef _ZEBRA_ISIS_DR_H #ifndef _ZEBRA_ISIS_DR_H
#define _ZEBRA_ISIS_DR_H #define _ZEBRA_ISIS_DR_H
void isis_run_dr(struct thread *thread); void isis_run_dr(struct event *thread);
int isis_dr_elect(struct isis_circuit *circuit, int level); int isis_dr_elect(struct isis_circuit *circuit, int level);
int isis_dr_resign(struct isis_circuit *circuit, int level); int isis_dr_resign(struct isis_circuit *circuit, int level);
int isis_dr_commence(struct isis_circuit *circuit, int level); int isis_dr_commence(struct isis_circuit *circuit, int level);

View file

@ -29,7 +29,7 @@
DEFINE_MTYPE_STATIC(ISISD, ISIS_DYNHN, "ISIS dyn hostname"); DEFINE_MTYPE_STATIC(ISISD, ISIS_DYNHN, "ISIS dyn hostname");
static void dyn_cache_cleanup(struct thread *); static void dyn_cache_cleanup(struct event *);
void dyn_cache_init(struct isis *isis) void dyn_cache_init(struct isis *isis)
{ {
@ -54,7 +54,7 @@ void dyn_cache_finish(struct isis *isis)
list_delete(&isis->dyn_cache); list_delete(&isis->dyn_cache);
} }
static void dyn_cache_cleanup(struct thread *thread) static void dyn_cache_cleanup(struct event *thread)
{ {
struct listnode *node, *nnode; struct listnode *node, *nnode;
struct isis_dynhn *dyn; struct isis_dynhn *dyn;

View file

@ -196,7 +196,7 @@ void isis_circuit_is_type_set(struct isis_circuit *circuit, int newtype)
/* events supporting code */ /* events supporting code */
void isis_event_dis_status_change(struct thread *thread) void isis_event_dis_status_change(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;

View file

@ -18,7 +18,7 @@ void isis_event_circuit_type_change(struct isis_circuit *circuit, int newtype);
/* /*
* Events related to adjacencies * Events related to adjacencies
*/ */
void isis_event_dis_status_change(struct thread *thread); void isis_event_dis_status_change(struct event *thread);
/* /*
* Error events * Error events

View file

@ -331,7 +331,7 @@ void isis_ldp_sync_set_if_metric(struct isis_circuit *circuit, bool run_regen)
/* /*
* LDP-SYNC holddown timer routines * LDP-SYNC holddown timer routines
*/ */
static void isis_ldp_sync_holddown_timer(struct thread *thread) static void isis_ldp_sync_holddown_timer(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
struct ldp_sync_info *ldp_sync_info; struct ldp_sync_info *ldp_sync_info;

View file

@ -1388,7 +1388,7 @@ static struct rlfa *rlfa_lookup(struct isis_spftree *spftree,
return rlfa_tree_find(&spftree->lfa.remote.rlfas, &s); return rlfa_tree_find(&spftree->lfa.remote.rlfas, &s);
} }
static void isis_area_verify_routes_cb(struct thread *thread) static void isis_area_verify_routes_cb(struct event *thread)
{ {
struct isis_area *area = THREAD_ARG(thread); struct isis_area *area = THREAD_ARG(thread);

View file

@ -49,9 +49,9 @@
DEFINE_MTYPE_STATIC(ISISD, ISIS_LSP, "ISIS LSP"); DEFINE_MTYPE_STATIC(ISISD, ISIS_LSP, "ISIS LSP");
static void lsp_refresh(struct thread *thread); static void lsp_refresh(struct event *thread);
static void lsp_l1_refresh_pseudo(struct thread *thread); static void lsp_l1_refresh_pseudo(struct event *thread);
static void lsp_l2_refresh_pseudo(struct thread *thread); static void lsp_l2_refresh_pseudo(struct event *thread);
static void lsp_destroy(struct isis_lsp *lsp); static void lsp_destroy(struct isis_lsp *lsp);
@ -429,7 +429,7 @@ bool isis_level2_adj_up(struct isis_area *area)
/* /*
* Unset the overload bit after the timer expires * Unset the overload bit after the timer expires
*/ */
void set_overload_on_start_timer(struct thread *thread) void set_overload_on_start_timer(struct event *thread)
{ {
struct isis_area *area = THREAD_ARG(thread); struct isis_area *area = THREAD_ARG(thread);
assert(area); assert(area);
@ -1523,7 +1523,7 @@ static int lsp_regenerate(struct isis_area *area, int level)
/* /*
* Something has changed or periodic refresh -> regenerate LSP * Something has changed or periodic refresh -> regenerate LSP
*/ */
static void lsp_refresh(struct thread *thread) static void lsp_refresh(struct event *thread)
{ {
struct lsp_refresh_arg *arg = THREAD_ARG(thread); struct lsp_refresh_arg *arg = THREAD_ARG(thread);
@ -1903,7 +1903,7 @@ static int lsp_regenerate_pseudo(struct isis_circuit *circuit, int level)
/* /*
* Something has changed or periodic refresh -> regenerate pseudo LSP * Something has changed or periodic refresh -> regenerate pseudo LSP
*/ */
static void lsp_l1_refresh_pseudo(struct thread *thread) static void lsp_l1_refresh_pseudo(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
uint8_t id[ISIS_SYS_ID_LEN + 2]; uint8_t id[ISIS_SYS_ID_LEN + 2];
@ -1925,7 +1925,7 @@ static void lsp_l1_refresh_pseudo(struct thread *thread)
lsp_regenerate_pseudo(circuit, IS_LEVEL_1); lsp_regenerate_pseudo(circuit, IS_LEVEL_1);
} }
static void lsp_l2_refresh_pseudo(struct thread *thread) static void lsp_l2_refresh_pseudo(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
uint8_t id[ISIS_SYS_ID_LEN + 2]; uint8_t id[ISIS_SYS_ID_LEN + 2];
@ -2049,7 +2049,7 @@ int lsp_regenerate_schedule_pseudo(struct isis_circuit *circuit, int level)
* Walk through LSPs for an area * Walk through LSPs for an area
* - set remaining lifetime * - set remaining lifetime
*/ */
void lsp_tick(struct thread *thread) void lsp_tick(struct event *thread)
{ {
struct isis_area *area; struct isis_area *area;
struct isis_lsp *lsp; struct isis_lsp *lsp;

View file

@ -52,8 +52,8 @@ DECLARE_RBTREE_UNIQ(lspdb, struct isis_lsp, dbe, lspdb_compare);
void lsp_db_init(struct lspdb_head *head); void lsp_db_init(struct lspdb_head *head);
void lsp_db_fini(struct lspdb_head *head); void lsp_db_fini(struct lspdb_head *head);
void lsp_tick(struct thread *thread); void lsp_tick(struct event *thread);
void set_overload_on_start_timer(struct thread *thread); void set_overload_on_start_timer(struct event *thread);
int lsp_generate(struct isis_area *area, int level); int lsp_generate(struct isis_area *area, int level);
#define lsp_regenerate_schedule(area, level, all_pseudo) \ #define lsp_regenerate_schedule(area, level, all_pseudo) \

View file

@ -169,7 +169,7 @@ static const struct frr_yang_module_info *const isisd_yang_modules[] = {
/* clang-format on */ /* clang-format on */
static void isis_config_finish(struct thread *t) static void isis_config_finish(struct event *t)
{ {
struct listnode *node, *inode; struct listnode *node, *inode;
struct isis *isis; struct isis *isis;

View file

@ -1780,7 +1780,7 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
return retval; return retval;
} }
void isis_receive(struct thread *thread) void isis_receive(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
uint8_t ssnpa[ETH_ALEN]; uint8_t ssnpa[ETH_ALEN];
@ -2009,7 +2009,7 @@ int send_hello(struct isis_circuit *circuit, int level)
return retval; return retval;
} }
static void send_hello_cb(struct thread *thread) static void send_hello_cb(struct event *thread)
{ {
struct isis_circuit_arg *arg = THREAD_ARG(thread); struct isis_circuit_arg *arg = THREAD_ARG(thread);
assert(arg); assert(arg);
@ -2050,8 +2050,7 @@ static void send_hello_cb(struct thread *thread)
} }
static void _send_hello_sched(struct isis_circuit *circuit, static void _send_hello_sched(struct isis_circuit *circuit,
struct thread **threadp, struct event **threadp, int level, long delay)
int level, long delay)
{ {
if (*threadp) { if (*threadp) {
if (thread_timer_remain_msec(*threadp) < (unsigned long)delay) if (thread_timer_remain_msec(*threadp) < (unsigned long)delay)
@ -2240,7 +2239,7 @@ int send_csnp(struct isis_circuit *circuit, int level)
return ISIS_OK; return ISIS_OK;
} }
void send_l1_csnp(struct thread *thread) void send_l1_csnp(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
@ -2260,7 +2259,7 @@ void send_l1_csnp(struct thread *thread)
&circuit->t_send_csnp[0]); &circuit->t_send_csnp[0]);
} }
void send_l2_csnp(struct thread *thread) void send_l2_csnp(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
@ -2394,7 +2393,7 @@ static int send_psnp(int level, struct isis_circuit *circuit)
return ISIS_OK; return ISIS_OK;
} }
void send_l1_psnp(struct thread *thread) void send_l1_psnp(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
@ -2415,7 +2414,7 @@ void send_l1_psnp(struct thread *thread)
* 7.3.15.4 action on expiration of partial SNP interval * 7.3.15.4 action on expiration of partial SNP interval
* level 2 * level 2
*/ */
void send_l2_psnp(struct thread *thread) void send_l2_psnp(struct event *thread)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;

View file

@ -182,7 +182,7 @@ struct isis_partial_seqnum_hdr {
/* /*
* Function for receiving IS-IS PDUs * Function for receiving IS-IS PDUs
*/ */
void isis_receive(struct thread *thread); void isis_receive(struct event *thread);
/* /*
* calling arguments for snp_process () * calling arguments for snp_process ()
@ -197,10 +197,10 @@ void isis_receive(struct thread *thread);
*/ */
void send_hello_sched(struct isis_circuit *circuit, int level, long delay); void send_hello_sched(struct isis_circuit *circuit, int level, long delay);
int send_csnp(struct isis_circuit *circuit, int level); int send_csnp(struct isis_circuit *circuit, int level);
void send_l1_csnp(struct thread *thread); void send_l1_csnp(struct event *thread);
void send_l2_csnp(struct thread *thread); void send_l2_csnp(struct event *thread);
void send_l1_psnp(struct thread *thread); void send_l1_psnp(struct event *thread);
void send_l2_psnp(struct thread *thread); void send_l2_psnp(struct event *thread);
void send_lsp(struct isis_circuit *circuit, void send_lsp(struct isis_circuit *circuit,
struct isis_lsp *lsp, enum isis_tx_type tx_type); struct isis_lsp *lsp, enum isis_tx_type tx_type);
void fill_fixed_hdr(uint8_t pdu_type, struct stream *stream); void fill_fixed_hdr(uint8_t pdu_type, struct stream *stream);

View file

@ -1853,7 +1853,7 @@ void isis_spf_switchover_routes(struct isis_area *area,
family, nexthop_ip, ifindex); family, nexthop_ip, ifindex);
} }
static void isis_run_spf_cb(struct thread *thread) static void isis_run_spf_cb(struct event *thread)
{ {
struct isis_spf_run *run = THREAD_ARG(thread); struct isis_spf_run *run = THREAD_ARG(thread);
struct isis_area *area = run->area; struct isis_area *area = run->area;

View file

@ -1081,7 +1081,7 @@ DEFUN(show_sr_node, show_sr_node_cmd,
* *
* @return 1 on success * @return 1 on success
*/ */
static void sr_start_label_manager(struct thread *start) static void sr_start_label_manager(struct event *start)
{ {
struct isis_area *area; struct isis_area *area;

View file

@ -155,7 +155,7 @@ struct isis_sr_db {
bool enabled; bool enabled;
/* Thread timer to start Label Manager */ /* Thread timer to start Label Manager */
struct thread *t_start_lm; struct event *t_start_lm;
/* List of local Adjacency-SIDs. */ /* List of local Adjacency-SIDs. */
struct list *adj_sids; struct list *adj_sids;

View file

@ -32,7 +32,7 @@ struct isis_tx_queue_entry {
struct isis_lsp *lsp; struct isis_lsp *lsp;
enum isis_tx_type type; enum isis_tx_type type;
bool is_retry; bool is_retry;
struct thread *retry; struct event *retry;
struct isis_tx_queue *queue; struct isis_tx_queue *queue;
}; };
@ -100,7 +100,7 @@ static struct isis_tx_queue_entry *tx_queue_find(struct isis_tx_queue *queue,
return hash_lookup(queue->hash, &e); return hash_lookup(queue->hash, &e);
} }
static void tx_queue_send_event(struct thread *thread) static void tx_queue_send_event(struct event *thread)
{ {
struct isis_tx_queue_entry *e = THREAD_ARG(thread); struct isis_tx_queue_entry *e = THREAD_ARG(thread);
struct isis_tx_queue *queue = e->queue; struct isis_tx_queue *queue = e->queue;

View file

@ -88,7 +88,7 @@ static struct isis_master isis_master;
struct isis_master *im; struct isis_master *im;
/* ISIS config processing thread */ /* ISIS config processing thread */
struct thread *t_isis_cfg; struct event *t_isis_cfg;
#ifndef FABRICD #ifndef FABRICD
DEFINE_HOOK(isis_hook_db_overload, (const struct isis_area *area), (area)); DEFINE_HOOK(isis_hook_db_overload, (const struct isis_area *area), (area));

View file

@ -89,7 +89,7 @@ struct isis {
uint8_t max_area_addrs; /* maximumAreaAdresses */ uint8_t max_area_addrs; /* maximumAreaAdresses */
struct area_addr *man_area_addrs; /* manualAreaAddresses */ struct area_addr *man_area_addrs; /* manualAreaAddresses */
time_t uptime; /* when did we start */ time_t uptime; /* when did we start */
struct thread *t_dync_clean; /* dynamic hostname cache cleanup thread */ struct event *t_dync_clean; /* dynamic hostname cache cleanup thread */
uint32_t circuit_ids_used[8]; /* 256 bits to track circuit ids 1 through 255 */ uint32_t circuit_ids_used[8]; /* 256 bits to track circuit ids 1 through 255 */
int snmp_notifications; int snmp_notifications;
struct list *dyn_cache; struct list *dyn_cache;
@ -99,7 +99,7 @@ struct isis {
extern struct isis_master *im; extern struct isis_master *im;
extern struct thread *t_isis_cfg; extern struct event *t_isis_cfg;
enum spf_tree_id { enum spf_tree_id {
SPFTREE_IPV4 = 0, SPFTREE_IPV4 = 0,
@ -129,11 +129,11 @@ struct isis_area {
struct list *circuit_list; /* IS-IS circuits */ struct list *circuit_list; /* IS-IS circuits */
struct list *adjacency_list; /* IS-IS adjacencies */ struct list *adjacency_list; /* IS-IS adjacencies */
struct flags flags; struct flags flags;
struct thread *t_tick; /* LSP walker */ struct event *t_tick; /* LSP walker */
struct thread *t_lsp_refresh[ISIS_LEVELS]; struct event *t_lsp_refresh[ISIS_LEVELS];
struct thread *t_overload_on_startup_timer; struct event *t_overload_on_startup_timer;
struct timeval last_lsp_refresh_event[ISIS_LEVELS]; struct timeval last_lsp_refresh_event[ISIS_LEVELS];
struct thread *t_rlfa_rib_update; struct event *t_rlfa_rib_update;
/* t_lsp_refresh is used in two ways: /* t_lsp_refresh is used in two ways:
* a) regular refresh of LSPs * a) regular refresh of LSPs
* b) (possibly throttled) updates to LSPs * b) (possibly throttled) updates to LSPs
@ -226,7 +226,7 @@ struct isis_area {
struct spf_backoff *spf_delay_ietf[ISIS_LEVELS]; /*Structure with IETF struct spf_backoff *spf_delay_ietf[ISIS_LEVELS]; /*Structure with IETF
SPF algo SPF algo
parameters*/ parameters*/
struct thread *spf_timer[ISIS_LEVELS]; struct event *spf_timer[ISIS_LEVELS];
struct lsp_refresh_arg lsp_refresh_arg[ISIS_LEVELS]; struct lsp_refresh_arg lsp_refresh_arg[ISIS_LEVELS];

View file

@ -13,21 +13,21 @@
struct accept_ev { struct accept_ev {
LIST_ENTRY(accept_ev) entry; LIST_ENTRY(accept_ev) entry;
struct thread *ev; struct event *ev;
void (*accept_cb)(struct thread *); void (*accept_cb)(struct event *);
void *arg; void *arg;
int fd; int fd;
}; };
struct { struct {
LIST_HEAD(, accept_ev) queue; LIST_HEAD(, accept_ev) queue;
struct thread *evt; struct event *evt;
} accept_queue; } accept_queue;
static void accept_arm(void); static void accept_arm(void);
static void accept_unarm(void); static void accept_unarm(void);
static void accept_cb(struct thread *); static void accept_cb(struct event *);
static void accept_timeout(struct thread *); static void accept_timeout(struct event *);
void void
accept_init(void) accept_init(void)
@ -35,7 +35,7 @@ accept_init(void)
LIST_INIT(&accept_queue.queue); LIST_INIT(&accept_queue.queue);
} }
int accept_add(int fd, void (*cb)(struct thread *), void *arg) int accept_add(int fd, void (*cb)(struct event *), void *arg)
{ {
struct accept_ev *av; struct accept_ev *av;
@ -103,14 +103,14 @@ accept_unarm(void)
THREAD_OFF(av->ev); THREAD_OFF(av->ev);
} }
static void accept_cb(struct thread *thread) static void accept_cb(struct event *thread)
{ {
struct accept_ev *av = THREAD_ARG(thread); struct accept_ev *av = THREAD_ARG(thread);
thread_add_read(master, accept_cb, av, av->fd, &av->ev); thread_add_read(master, accept_cb, av, av->fd, &av->ev);
av->accept_cb(thread); av->accept_cb(thread);
} }
static void accept_timeout(struct thread *thread) static void accept_timeout(struct event *thread)
{ {
accept_queue.evt = NULL; accept_queue.evt = NULL;

View file

@ -15,12 +15,12 @@
#include "log.h" #include "log.h"
static __inline int adj_compare(const struct adj *, const struct adj *); static __inline int adj_compare(const struct adj *, const struct adj *);
static void adj_itimer(struct thread *); static void adj_itimer(struct event *);
static __inline int tnbr_compare(const struct tnbr *, const struct tnbr *); static __inline int tnbr_compare(const struct tnbr *, const struct tnbr *);
static void tnbr_del(struct ldpd_conf *, struct tnbr *); static void tnbr_del(struct ldpd_conf *, struct tnbr *);
static void tnbr_start(struct tnbr *); static void tnbr_start(struct tnbr *);
static void tnbr_stop(struct tnbr *); static void tnbr_stop(struct tnbr *);
static void tnbr_hello_timer(struct thread *); static void tnbr_hello_timer(struct event *);
static void tnbr_start_hello_timer(struct tnbr *); static void tnbr_start_hello_timer(struct tnbr *);
static void tnbr_stop_hello_timer(struct tnbr *); static void tnbr_stop_hello_timer(struct tnbr *);
@ -161,7 +161,7 @@ adj_get_af(const struct adj *adj)
/* adjacency timers */ /* adjacency timers */
/* ARGSUSED */ /* ARGSUSED */
static void adj_itimer(struct thread *thread) static void adj_itimer(struct event *thread)
{ {
struct adj *adj = THREAD_ARG(thread); struct adj *adj = THREAD_ARG(thread);
@ -331,7 +331,7 @@ tnbr_get_hello_interval(struct tnbr *tnbr)
/* target neighbors timers */ /* target neighbors timers */
/* ARGSUSED */ /* ARGSUSED */
static void tnbr_hello_timer(struct thread *thread) static void tnbr_hello_timer(struct event *thread)
{ {
struct tnbr *tnbr = THREAD_ARG(thread); struct tnbr *tnbr = THREAD_ARG(thread);

View file

@ -15,11 +15,11 @@
#define CONTROL_BACKLOG 5 #define CONTROL_BACKLOG 5
static void control_accept(struct thread *); static void control_accept(struct event *);
static struct ctl_conn *control_connbyfd(int); static struct ctl_conn *control_connbyfd(int);
static struct ctl_conn *control_connbypid(pid_t); static struct ctl_conn *control_connbypid(pid_t);
static void control_close(int); static void control_close(int);
static void control_dispatch_imsg(struct thread *); static void control_dispatch_imsg(struct event *);
struct ctl_conns ctl_conns; struct ctl_conns ctl_conns;
@ -90,7 +90,7 @@ control_cleanup(char *path)
} }
/* ARGSUSED */ /* ARGSUSED */
static void control_accept(struct thread *thread) static void control_accept(struct event *thread)
{ {
int connfd; int connfd;
socklen_t len; socklen_t len;
@ -177,7 +177,7 @@ control_close(int fd)
} }
/* ARGSUSED */ /* ARGSUSED */
static void control_dispatch_imsg(struct thread *thread) static void control_dispatch_imsg(struct event *thread)
{ {
int fd = THREAD_FD(thread); int fd = THREAD_FD(thread);
struct ctl_conn *c; struct ctl_conn *c;

View file

@ -22,7 +22,7 @@ static struct if_addr *if_addr_lookup(struct if_addr_head *, struct kaddr *);
static int if_start(struct iface *, int); static int if_start(struct iface *, int);
static int if_reset(struct iface *, int); static int if_reset(struct iface *, int);
static void if_update_af(struct iface_af *); static void if_update_af(struct iface_af *);
static void if_hello_timer(struct thread *thread); static void if_hello_timer(struct event *thread);
static void if_start_hello_timer(struct iface_af *); static void if_start_hello_timer(struct iface_af *);
static void if_stop_hello_timer(struct iface_af *); static void if_stop_hello_timer(struct iface_af *);
static int if_join_ipv4_group(struct iface *, struct in_addr *); static int if_join_ipv4_group(struct iface *, struct in_addr *);
@ -32,7 +32,7 @@ static int if_leave_ipv6_group(struct iface *, struct in6_addr *);
static int ldp_sync_fsm_init(struct iface *iface, int state); static int ldp_sync_fsm_init(struct iface *iface, int state);
static int ldp_sync_act_iface_start_sync(struct iface *iface); static int ldp_sync_act_iface_start_sync(struct iface *iface);
static void iface_wait_for_ldp_sync_timer(struct thread *thread); static void iface_wait_for_ldp_sync_timer(struct event *thread);
static void start_wait_for_ldp_sync_timer(struct iface *iface); static void start_wait_for_ldp_sync_timer(struct iface *iface);
static void stop_wait_for_ldp_sync_timer(struct iface *iface); static void stop_wait_for_ldp_sync_timer(struct iface *iface);
static int ldp_sync_act_ldp_start_sync(struct iface *iface); static int ldp_sync_act_ldp_start_sync(struct iface *iface);
@ -444,7 +444,7 @@ if_get_wait_for_sync_interval(void)
/* timers */ /* timers */
/* ARGSUSED */ /* ARGSUSED */
static void if_hello_timer(struct thread *thread) static void if_hello_timer(struct event *thread)
{ {
struct iface_af *ia = THREAD_ARG(thread); struct iface_af *ia = THREAD_ARG(thread);
@ -720,7 +720,7 @@ ldp_sync_act_iface_start_sync(struct iface *iface)
return (0); return (0);
} }
static void iface_wait_for_ldp_sync_timer(struct thread *thread) static void iface_wait_for_ldp_sync_timer(struct event *thread)
{ {
struct iface *iface = THREAD_ARG(thread); struct iface *iface = THREAD_ARG(thread);

View file

@ -30,8 +30,8 @@
#include "libfrr.h" #include "libfrr.h"
static void lde_shutdown(void); static void lde_shutdown(void);
static void lde_dispatch_imsg(struct thread *thread); static void lde_dispatch_imsg(struct event *thread);
static void lde_dispatch_parent(struct thread *thread); static void lde_dispatch_parent(struct event *thread);
static __inline int lde_nbr_compare(const struct lde_nbr *, static __inline int lde_nbr_compare(const struct lde_nbr *,
const struct lde_nbr *); const struct lde_nbr *);
static struct lde_nbr *lde_nbr_new(uint32_t, struct lde_nbr *); static struct lde_nbr *lde_nbr_new(uint32_t, struct lde_nbr *);
@ -145,7 +145,7 @@ lde(void)
/* create base configuration */ /* create base configuration */
ldeconf = config_new_empty(); ldeconf = config_new_empty();
struct thread thread; struct event thread;
while (thread_fetch(master, &thread)) while (thread_fetch(master, &thread))
thread_call(&thread); thread_call(&thread);
@ -232,7 +232,7 @@ lde_imsg_compose_ldpe(int type, uint32_t peerid, pid_t pid, void *data,
} }
/* ARGSUSED */ /* ARGSUSED */
static void lde_dispatch_imsg(struct thread *thread) static void lde_dispatch_imsg(struct event *thread)
{ {
struct imsgev *iev = THREAD_ARG(thread); struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf; struct imsgbuf *ibuf = &iev->ibuf;
@ -402,7 +402,7 @@ static void lde_dispatch_imsg(struct thread *thread)
} }
/* ARGSUSED */ /* ARGSUSED */
static void lde_dispatch_parent(struct thread *thread) static void lde_dispatch_parent(struct event *thread)
{ {
static struct ldpd_conf *nconf; static struct ldpd_conf *nconf;
struct iface *iface, *niface; struct iface *iface, *niface;
@ -2123,7 +2123,7 @@ lde_address_list_free(struct lde_nbr *ln)
/* /*
* Event callback used to retry the label-manager sync zapi session. * Event callback used to retry the label-manager sync zapi session.
*/ */
static void zclient_sync_retry(struct thread *thread) static void zclient_sync_retry(struct event *thread)
{ {
zclient_sync_init(); zclient_sync_init();
} }

View file

@ -132,7 +132,7 @@ struct label_chunk {
extern struct ldpd_conf *ldeconf; extern struct ldpd_conf *ldeconf;
extern struct fec_tree ft; extern struct fec_tree ft;
extern struct nbr_tree lde_nbrs; extern struct nbr_tree lde_nbrs;
extern struct thread *gc_timer; extern struct event *gc_timer;
/* lde.c */ /* lde.c */
void lde(void); void lde(void);
@ -216,7 +216,7 @@ void lde_check_withdraw(struct map *, struct lde_nbr *);
void lde_check_withdraw_wcard(struct map *, struct lde_nbr *); void lde_check_withdraw_wcard(struct map *, struct lde_nbr *);
int lde_wildcard_apply(struct map *, struct fec *, int lde_wildcard_apply(struct map *, struct fec *,
struct lde_map *); struct lde_map *);
void lde_gc_timer(struct thread *thread); void lde_gc_timer(struct event *thread);
void lde_gc_start_timer(void); void lde_gc_start_timer(void);
void lde_gc_stop_timer(void); void lde_gc_stop_timer(void);

View file

@ -28,7 +28,7 @@ static void fec_nh_del(struct fec_nh *);
RB_GENERATE(fec_tree, fec, entry, fec_compare) RB_GENERATE(fec_tree, fec, entry, fec_compare)
struct fec_tree ft = RB_INITIALIZER(&ft); struct fec_tree ft = RB_INITIALIZER(&ft);
struct thread *gc_timer; struct event *gc_timer;
/* FEC tree functions */ /* FEC tree functions */
void void
@ -1026,7 +1026,7 @@ lde_wildcard_apply(struct map *wcard, struct fec *fec, struct lde_map *me)
/* gabage collector timer: timer to remove dead entries from the LIB */ /* gabage collector timer: timer to remove dead entries from the LIB */
/* ARGSUSED */ /* ARGSUSED */
void lde_gc_timer(struct thread *thread) void lde_gc_timer(struct event *thread)
{ {
struct fec *fec, *safe; struct fec *fec, *safe;
struct fec_node *fn; struct fec_node *fn;

View file

@ -35,8 +35,8 @@
static void ldpd_shutdown(void); static void ldpd_shutdown(void);
static pid_t start_child(enum ldpd_process, char *, int, int); static pid_t start_child(enum ldpd_process, char *, int, int);
static void main_dispatch_ldpe(struct thread *thread); static void main_dispatch_ldpe(struct event *thread);
static void main_dispatch_lde(struct thread *thread); static void main_dispatch_lde(struct event *thread);
static int main_imsg_send_ipc_sockets(struct imsgbuf *, static int main_imsg_send_ipc_sockets(struct imsgbuf *,
struct imsgbuf *); struct imsgbuf *);
static void main_imsg_send_net_sockets(int); static void main_imsg_send_net_sockets(int);
@ -208,7 +208,7 @@ FRR_DAEMON_INFO(ldpd, LDP,
.n_yang_modules = array_size(ldpd_yang_modules), .n_yang_modules = array_size(ldpd_yang_modules),
); );
static void ldp_config_fork_apply(struct thread *t) static void ldp_config_fork_apply(struct event *t)
{ {
/* /*
* So the frr_config_fork() function schedules * So the frr_config_fork() function schedules
@ -557,7 +557,7 @@ start_child(enum ldpd_process p, char *argv0, int fd_async, int fd_sync)
/* imsg handling */ /* imsg handling */
/* ARGSUSED */ /* ARGSUSED */
static void main_dispatch_ldpe(struct thread *thread) static void main_dispatch_ldpe(struct event *thread)
{ {
struct imsgev *iev = THREAD_ARG(thread); struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf; struct imsgbuf *ibuf = &iev->ibuf;
@ -625,7 +625,7 @@ static void main_dispatch_ldpe(struct thread *thread)
} }
/* ARGSUSED */ /* ARGSUSED */
static void main_dispatch_lde(struct thread *thread) static void main_dispatch_lde(struct event *thread)
{ {
struct imsgev *iev = THREAD_ARG(thread); struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf; struct imsgbuf *ibuf = &iev->ibuf;
@ -733,7 +733,7 @@ static void main_dispatch_lde(struct thread *thread)
} }
/* ARGSUSED */ /* ARGSUSED */
void ldp_write_handler(struct thread *thread) void ldp_write_handler(struct event *thread)
{ {
struct imsgev *iev = THREAD_ARG(thread); struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf; struct imsgbuf *ibuf = &iev->ibuf;
@ -823,7 +823,7 @@ evbuf_event_add(struct evbuf *eb)
&eb->ev); &eb->ev);
} }
void evbuf_init(struct evbuf *eb, int fd, void (*handler)(struct thread *), void evbuf_init(struct evbuf *eb, int fd, void (*handler)(struct event *),
void *arg) void *arg)
{ {
msgbuf_init(&eb->wbuf); msgbuf_init(&eb->wbuf);

View file

@ -51,17 +51,17 @@
struct evbuf { struct evbuf {
struct msgbuf wbuf; struct msgbuf wbuf;
struct thread *ev; struct event *ev;
void (*handler)(struct thread *); void (*handler)(struct event *);
void *arg; void *arg;
}; };
struct imsgev { struct imsgev {
struct imsgbuf ibuf; struct imsgbuf ibuf;
void (*handler_write)(struct thread *); void (*handler_write)(struct event *);
struct thread *ev_write; struct event *ev_write;
void (*handler_read)(struct thread *); void (*handler_read)(struct event *);
struct thread *ev_read; struct event *ev_read;
}; };
enum imsg_type { enum imsg_type {
@ -329,14 +329,14 @@ struct iface_af {
int state; int state;
struct ia_adj_head adj_tree; struct ia_adj_head adj_tree;
time_t uptime; time_t uptime;
struct thread *hello_timer; struct event *hello_timer;
uint16_t hello_holdtime; uint16_t hello_holdtime;
uint16_t hello_interval; uint16_t hello_interval;
}; };
struct iface_ldp_sync { struct iface_ldp_sync {
int state; int state;
struct thread *wait_for_sync_timer; struct event *wait_for_sync_timer;
}; };
struct iface { struct iface {
@ -359,7 +359,7 @@ DECLARE_QOBJ_TYPE(iface);
/* source of targeted hellos */ /* source of targeted hellos */
struct tnbr { struct tnbr {
RB_ENTRY(tnbr) entry; RB_ENTRY(tnbr) entry;
struct thread *hello_timer; struct event *hello_timer;
struct adj *adj; struct adj *adj;
int af; int af;
union ldpd_addr addr; union ldpd_addr addr;
@ -582,8 +582,8 @@ DECLARE_QOBJ_TYPE(ldpd_conf);
#define F_LDPD_ALLOW_BROKEN_LSP 0x0010 #define F_LDPD_ALLOW_BROKEN_LSP 0x0010
struct ldpd_af_global { struct ldpd_af_global {
struct thread *disc_ev; struct event *disc_ev;
struct thread *edisc_ev; struct event *edisc_ev;
int ldp_disc_socket; int ldp_disc_socket;
int ldp_edisc_socket; int ldp_edisc_socket;
int ldp_session_socket; int ldp_session_socket;
@ -781,7 +781,7 @@ void sa2addr(struct sockaddr *, int *, union ldpd_addr *,
socklen_t sockaddr_len(struct sockaddr *); socklen_t sockaddr_len(struct sockaddr *);
/* ldpd.c */ /* ldpd.c */
void ldp_write_handler(struct thread *thread); void ldp_write_handler(struct event *thread);
void main_imsg_compose_ldpe(int, pid_t, void *, uint16_t); void main_imsg_compose_ldpe(int, pid_t, void *, uint16_t);
void main_imsg_compose_lde(int, pid_t, void *, uint16_t); void main_imsg_compose_lde(int, pid_t, void *, uint16_t);
int main_imsg_compose_both(enum imsg_type, void *, int main_imsg_compose_both(enum imsg_type, void *,
@ -791,7 +791,7 @@ int imsg_compose_event(struct imsgev *, uint16_t, uint32_t,
pid_t, int, void *, uint16_t); pid_t, int, void *, uint16_t);
void evbuf_enqueue(struct evbuf *, struct ibuf *); void evbuf_enqueue(struct evbuf *, struct ibuf *);
void evbuf_event_add(struct evbuf *); void evbuf_event_add(struct evbuf *);
void evbuf_init(struct evbuf *, int, void (*)(struct thread *), void *); void evbuf_init(struct evbuf *, int, void (*)(struct event *), void *);
void evbuf_clear(struct evbuf *); void evbuf_clear(struct evbuf *);
int ldp_acl_request(struct imsgev *, char *, int, int ldp_acl_request(struct imsgev *, char *, int,
union ldpd_addr *, uint8_t); union ldpd_addr *, uint8_t);

View file

@ -25,10 +25,10 @@
#include "libfrr.h" #include "libfrr.h"
static void ldpe_shutdown(void); static void ldpe_shutdown(void);
static void ldpe_dispatch_main(struct thread *thread); static void ldpe_dispatch_main(struct event *thread);
static void ldpe_dispatch_lde(struct thread *thread); static void ldpe_dispatch_lde(struct event *thread);
#ifdef __OpenBSD__ #ifdef __OpenBSD__
static void ldpe_dispatch_pfkey(struct thread *thread); static void ldpe_dispatch_pfkey(struct event *thread);
#endif #endif
static void ldpe_setup_sockets(int, int, int, int); static void ldpe_setup_sockets(int, int, int, int);
static void ldpe_close_sockets(int); static void ldpe_close_sockets(int);
@ -44,7 +44,7 @@ static struct imsgev iev_main_data;
static struct imsgev *iev_main, *iev_main_sync; static struct imsgev *iev_main, *iev_main_sync;
static struct imsgev *iev_lde; static struct imsgev *iev_lde;
#ifdef __OpenBSD__ #ifdef __OpenBSD__
static struct thread *pfkey_ev; static struct event *pfkey_ev;
#endif #endif
/* ldpe privileges */ /* ldpe privileges */
@ -122,7 +122,7 @@ ldpe(void)
/* create base configuration */ /* create base configuration */
leconf = config_new_empty(); leconf = config_new_empty();
struct thread thread; struct event thread;
while (thread_fetch(master, &thread)) while (thread_fetch(master, &thread))
thread_call(&thread); thread_call(&thread);
@ -262,7 +262,7 @@ ldpe_imsg_compose_lde(int type, uint32_t peerid, pid_t pid, void *data,
} }
/* ARGSUSED */ /* ARGSUSED */
static void ldpe_dispatch_main(struct thread *thread) static void ldpe_dispatch_main(struct event *thread)
{ {
static struct ldpd_conf *nconf; static struct ldpd_conf *nconf;
struct iface *niface; struct iface *niface;
@ -622,7 +622,7 @@ static void ldpe_dispatch_main(struct thread *thread)
} }
/* ARGSUSED */ /* ARGSUSED */
static void ldpe_dispatch_lde(struct thread *thread) static void ldpe_dispatch_lde(struct event *thread)
{ {
struct imsgev *iev = THREAD_ARG(thread); struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf; struct imsgbuf *ibuf = &iev->ibuf;
@ -759,7 +759,7 @@ static void ldpe_dispatch_lde(struct thread *thread)
#ifdef __OpenBSD__ #ifdef __OpenBSD__
/* ARGSUSED */ /* ARGSUSED */
static void ldpe_dispatch_pfkey(struct thread *thread) static void ldpe_dispatch_pfkey(struct event *thread)
{ {
int fd = THREAD_FD(thread); int fd = THREAD_FD(thread);

View file

@ -37,7 +37,7 @@ struct adj {
struct nbr *nbr; struct nbr *nbr;
int ds_tlv; int ds_tlv;
struct hello_source source; struct hello_source source;
struct thread *inactivity_timer; struct event *inactivity_timer;
uint16_t holdtime; uint16_t holdtime;
union ldpd_addr trans_addr; union ldpd_addr trans_addr;
}; };
@ -50,7 +50,7 @@ struct tcp_conn {
int fd; int fd;
struct ibuf_read *rbuf; struct ibuf_read *rbuf;
struct evbuf wbuf; struct evbuf wbuf;
struct thread *rev; struct event *rev;
in_port_t lport; in_port_t lport;
in_port_t rport; in_port_t rport;
}; };
@ -59,11 +59,11 @@ struct nbr {
RB_ENTRY(nbr) id_tree, addr_tree, pid_tree; RB_ENTRY(nbr) id_tree, addr_tree, pid_tree;
struct tcp_conn *tcp; struct tcp_conn *tcp;
struct nbr_adj_head adj_tree; /* adjacencies */ struct nbr_adj_head adj_tree; /* adjacencies */
struct thread *ev_connect; struct event *ev_connect;
struct thread *keepalive_timer; struct event *keepalive_timer;
struct thread *keepalive_timeout; struct event *keepalive_timeout;
struct thread *init_timeout; struct event *init_timeout;
struct thread *initdelay_timer; struct event *initdelay_timer;
struct mapping_head mapping_list; struct mapping_head mapping_list;
struct mapping_head withdraw_list; struct mapping_head withdraw_list;
@ -115,7 +115,7 @@ struct pending_conn {
int fd; int fd;
int af; int af;
union ldpd_addr addr; union ldpd_addr addr;
struct thread *ev_timeout; struct event *ev_timeout;
}; };
#define PENDING_CONN_TIMEOUT 5 #define PENDING_CONN_TIMEOUT 5
@ -137,7 +137,7 @@ extern struct nbr_pid_head nbrs_by_pid;
/* accept.c */ /* accept.c */
void accept_init(void); void accept_init(void);
int accept_add(int, void (*)(struct thread *), void *); int accept_add(int, void (*)(struct event *), void *);
void accept_del(int); void accept_del(int);
void accept_pause(void); void accept_pause(void);
void accept_unpause(void); void accept_unpause(void);
@ -281,8 +281,8 @@ int gen_ldp_hdr(struct ibuf *, uint16_t);
int gen_msg_hdr(struct ibuf *, uint16_t, uint16_t); int gen_msg_hdr(struct ibuf *, uint16_t, uint16_t);
int send_packet(int, int, union ldpd_addr *, int send_packet(int, int, union ldpd_addr *,
struct iface_af *, void *, size_t); struct iface_af *, void *, size_t);
void disc_recv_packet(struct thread *thread); void disc_recv_packet(struct event *thread);
void session_accept(struct thread *thread); void session_accept(struct event *thread);
void session_accept_nbr(struct nbr *, int); void session_accept_nbr(struct nbr *, int);
void session_shutdown(struct nbr *, uint32_t, uint32_t, void session_shutdown(struct nbr *, uint32_t, uint32_t,
uint32_t); uint32_t);

View file

@ -24,13 +24,13 @@ static __inline int nbr_addr_compare(const struct nbr *,
static __inline int nbr_pid_compare(const struct nbr *, static __inline int nbr_pid_compare(const struct nbr *,
const struct nbr *); const struct nbr *);
static void nbr_update_peerid(struct nbr *); static void nbr_update_peerid(struct nbr *);
static void nbr_ktimer(struct thread *thread); static void nbr_ktimer(struct event *thread);
static void nbr_start_ktimer(struct nbr *); static void nbr_start_ktimer(struct nbr *);
static void nbr_ktimeout(struct thread *thread); static void nbr_ktimeout(struct event *thread);
static void nbr_start_ktimeout(struct nbr *); static void nbr_start_ktimeout(struct nbr *);
static void nbr_itimeout(struct thread *thread); static void nbr_itimeout(struct event *thread);
static void nbr_start_itimeout(struct nbr *); static void nbr_start_itimeout(struct nbr *);
static void nbr_idtimer(struct thread *thread); static void nbr_idtimer(struct event *thread);
static int nbr_act_session_operational(struct nbr *); static int nbr_act_session_operational(struct nbr *);
static void nbr_send_labelmappings(struct nbr *); static void nbr_send_labelmappings(struct nbr *);
static __inline int nbr_params_compare(const struct nbr_params *, static __inline int nbr_params_compare(const struct nbr_params *,
@ -407,7 +407,7 @@ nbr_session_active_role(struct nbr *nbr)
/* Keepalive timer: timer to send keepalive message to neighbors */ /* Keepalive timer: timer to send keepalive message to neighbors */
static void nbr_ktimer(struct thread *thread) static void nbr_ktimer(struct event *thread)
{ {
struct nbr *nbr = THREAD_ARG(thread); struct nbr *nbr = THREAD_ARG(thread);
@ -436,7 +436,7 @@ nbr_stop_ktimer(struct nbr *nbr)
/* Keepalive timeout: if the nbr hasn't sent keepalive */ /* Keepalive timeout: if the nbr hasn't sent keepalive */
static void nbr_ktimeout(struct thread *thread) static void nbr_ktimeout(struct event *thread)
{ {
struct nbr *nbr = THREAD_ARG(thread); struct nbr *nbr = THREAD_ARG(thread);
@ -464,7 +464,7 @@ nbr_stop_ktimeout(struct nbr *nbr)
/* Session initialization timeout: if nbr got stuck in the initialization FSM */ /* Session initialization timeout: if nbr got stuck in the initialization FSM */
static void nbr_itimeout(struct thread *thread) static void nbr_itimeout(struct event *thread)
{ {
struct nbr *nbr = THREAD_ARG(thread); struct nbr *nbr = THREAD_ARG(thread);
@ -492,7 +492,7 @@ nbr_stop_itimeout(struct nbr *nbr)
/* Init delay timer: timer to retry to iniziatize session */ /* Init delay timer: timer to retry to iniziatize session */
static void nbr_idtimer(struct thread *thread) static void nbr_idtimer(struct event *thread)
{ {
struct nbr *nbr = THREAD_ARG(thread); struct nbr *nbr = THREAD_ARG(thread);
@ -549,7 +549,7 @@ nbr_pending_connect(struct nbr *nbr)
return (nbr->ev_connect != NULL); return (nbr->ev_connect != NULL);
} }
static void nbr_connect_cb(struct thread *thread) static void nbr_connect_cb(struct event *thread)
{ {
struct nbr *nbr = THREAD_ARG(thread); struct nbr *nbr = THREAD_ARG(thread);
int error; int error;

View file

@ -17,12 +17,12 @@
static struct iface *disc_find_iface(unsigned int, int, static struct iface *disc_find_iface(unsigned int, int,
union ldpd_addr *); union ldpd_addr *);
static void session_read(struct thread *thread); static void session_read(struct event *thread);
static void session_write(struct thread *thread); static void session_write(struct event *thread);
static ssize_t session_get_pdu(struct ibuf_read *, char **); static ssize_t session_get_pdu(struct ibuf_read *, char **);
static void tcp_close(struct tcp_conn *); static void tcp_close(struct tcp_conn *);
static struct pending_conn *pending_conn_new(int, int, union ldpd_addr *); static struct pending_conn *pending_conn_new(int, int, union ldpd_addr *);
static void pending_conn_timeout(struct thread *thread); static void pending_conn_timeout(struct event *thread);
int int
gen_ldp_hdr(struct ibuf *buf, uint16_t size) gen_ldp_hdr(struct ibuf *buf, uint16_t size)
@ -95,10 +95,10 @@ send_packet(int fd, int af, union ldpd_addr *dst, struct iface_af *ia,
} }
/* Discovery functions */ /* Discovery functions */
void disc_recv_packet(struct thread *thread) void disc_recv_packet(struct event *thread)
{ {
int fd = THREAD_FD(thread); int fd = THREAD_FD(thread);
struct thread **threadp = THREAD_ARG(thread); struct event **threadp = THREAD_ARG(thread);
union { union {
struct cmsghdr hdr; struct cmsghdr hdr;
@ -290,7 +290,7 @@ disc_find_iface(unsigned int ifindex, int af, union ldpd_addr *src)
return (iface); return (iface);
} }
void session_accept(struct thread *thread) void session_accept(struct event *thread)
{ {
int fd = THREAD_FD(thread); int fd = THREAD_FD(thread);
struct sockaddr_storage src; struct sockaddr_storage src;
@ -394,7 +394,7 @@ session_accept_nbr(struct nbr *nbr, int fd)
nbr_fsm(nbr, NBR_EVT_MATCH_ADJ); nbr_fsm(nbr, NBR_EVT_MATCH_ADJ);
} }
static void session_read(struct thread *thread) static void session_read(struct event *thread)
{ {
int fd = THREAD_FD(thread); int fd = THREAD_FD(thread);
struct nbr *nbr = THREAD_ARG(thread); struct nbr *nbr = THREAD_ARG(thread);
@ -610,7 +610,7 @@ static void session_read(struct thread *thread)
free(buf); free(buf);
} }
static void session_write(struct thread *thread) static void session_write(struct event *thread)
{ {
struct tcp_conn *tcp = THREAD_ARG(thread); struct tcp_conn *tcp = THREAD_ARG(thread);
struct nbr *nbr = tcp->nbr; struct nbr *nbr = tcp->nbr;
@ -795,7 +795,7 @@ pending_conn_find(int af, union ldpd_addr *addr)
return (NULL); return (NULL);
} }
static void pending_conn_timeout(struct thread *thread) static void pending_conn_timeout(struct event *thread)
{ {
struct pending_conn *pconn = THREAD_ARG(thread); struct pending_conn *pconn = THREAD_ARG(thread);
struct tcp_conn *tcp; struct tcp_conn *tcp;

View file

@ -28,12 +28,12 @@ DEFINE_HOOK(agentx_enabled, (), ());
static bool agentx_enabled = false; static bool agentx_enabled = false;
static struct thread_master *agentx_tm; static struct thread_master *agentx_tm;
static struct thread *timeout_thr = NULL; static struct event *timeout_thr = NULL;
static struct list *events = NULL; static struct list *events = NULL;
static void agentx_events_update(void); static void agentx_events_update(void);
static void agentx_timeout(struct thread *t) static void agentx_timeout(struct event *t)
{ {
snmp_timeout(); snmp_timeout();
run_alarms(); run_alarms();
@ -41,13 +41,13 @@ static void agentx_timeout(struct thread *t)
agentx_events_update(); agentx_events_update();
} }
static void agentx_read(struct thread *t) static void agentx_read(struct event *t)
{ {
fd_set fds; fd_set fds;
int flags, new_flags = 0; int flags, new_flags = 0;
int nonblock = false; int nonblock = false;
struct listnode *ln = THREAD_ARG(t); struct listnode *ln = THREAD_ARG(t);
struct thread **thr = listgetdata(ln); struct event **thr = listgetdata(ln);
XFREE(MTYPE_TMP, thr); XFREE(MTYPE_TMP, thr);
list_delete_node(events, ln); list_delete_node(events, ln);
@ -94,7 +94,7 @@ static void agentx_events_update(void)
struct timeval timeout = {.tv_sec = 0, .tv_usec = 0}; struct timeval timeout = {.tv_sec = 0, .tv_usec = 0};
fd_set fds; fd_set fds;
struct listnode *ln; struct listnode *ln;
struct thread **thr; struct event **thr;
int fd, thr_fd; int fd, thr_fd;
thread_cancel(&timeout_thr); thread_cancel(&timeout_thr);
@ -130,8 +130,8 @@ static void agentx_events_update(void)
/* need listener, but haven't hit one where it would be */ /* need listener, but haven't hit one where it would be */
else if (FD_ISSET(fd, &fds)) { else if (FD_ISSET(fd, &fds)) {
struct listnode *newln; struct listnode *newln;
thr = XCALLOC(MTYPE_TMP, sizeof(struct thread *));
thr = XCALLOC(MTYPE_TMP, sizeof(struct event *));
newln = listnode_add_before(events, ln, thr); newln = listnode_add_before(events, ln, thr);
thread_add_read(agentx_tm, agentx_read, newln, fd, thr); thread_add_read(agentx_tm, agentx_read, newln, fd, thr);
} }

View file

@ -87,7 +87,7 @@ struct bfd_session_params {
* configuration load or northbound batch), so we'll use this to * configuration load or northbound batch), so we'll use this to
* install/uninstall the BFD session parameters only once. * install/uninstall the BFD session parameters only once.
*/ */
struct thread *installev; struct event *installev;
/** BFD session installation state. */ /** BFD session installation state. */
bool installed; bool installed;
@ -485,7 +485,7 @@ static bool _bfd_sess_valid(const struct bfd_session_params *bsp)
return true; return true;
} }
static void _bfd_sess_send(struct thread *t) static void _bfd_sess_send(struct event *t)
{ {
struct bfd_session_params *bsp = THREAD_ARG(t); struct bfd_session_params *bsp = THREAD_ARG(t);
int rv; int rv;

View file

@ -28,19 +28,19 @@ DEFINE_MTYPE_STATIC(LIB, THREAD_MASTER, "Thread master");
DEFINE_MTYPE_STATIC(LIB, THREAD_POLL, "Thread Poll Info"); DEFINE_MTYPE_STATIC(LIB, THREAD_POLL, "Thread Poll Info");
DEFINE_MTYPE_STATIC(LIB, THREAD_STATS, "Thread stats"); DEFINE_MTYPE_STATIC(LIB, THREAD_STATS, "Thread stats");
DECLARE_LIST(thread_list, struct thread, threaditem); DECLARE_LIST(thread_list, struct event, threaditem);
struct cancel_req { struct cancel_req {
int flags; int flags;
struct thread *thread; struct event *thread;
void *eventobj; void *eventobj;
struct thread **threadref; struct event **threadref;
}; };
/* Flags for task cancellation */ /* Flags for task cancellation */
#define THREAD_CANCEL_FLAG_READY 0x01 #define THREAD_CANCEL_FLAG_READY 0x01
static int thread_timer_cmp(const struct thread *a, const struct thread *b) static int thread_timer_cmp(const struct event *a, const struct event *b)
{ {
if (a->u.sands.tv_sec < b->u.sands.tv_sec) if (a->u.sands.tv_sec < b->u.sands.tv_sec)
return -1; return -1;
@ -53,7 +53,7 @@ static int thread_timer_cmp(const struct thread *a, const struct thread *b)
return 0; return 0;
} }
DECLARE_HEAP(thread_timer_list, struct thread, timeritem, thread_timer_cmp); DECLARE_HEAP(thread_timer_list, struct event, timeritem, thread_timer_cmp);
#if defined(__APPLE__) #if defined(__APPLE__)
#include <mach/mach.h> #include <mach/mach.h>
@ -73,7 +73,7 @@ pthread_key_t thread_current;
static pthread_mutex_t masters_mtx = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t masters_mtx = PTHREAD_MUTEX_INITIALIZER;
static struct list *masters; static struct list *masters;
static void thread_free(struct thread_master *master, struct thread *thread); static void thread_free(struct thread_master *master, struct event *thread);
#ifndef EXCLUDE_CPU_TIME #ifndef EXCLUDE_CPU_TIME
#define EXCLUDE_CPU_TIME 0 #define EXCLUDE_CPU_TIME 0
@ -399,7 +399,7 @@ static void show_thread_poll_helper(struct vty *vty, struct thread_master *m)
{ {
const char *name = m->name ? m->name : "main"; const char *name = m->name ? m->name : "main";
char underline[strlen(name) + 1]; char underline[strlen(name) + 1];
struct thread *thread; struct event *thread;
uint32_t i; uint32_t i;
memset(underline, '-', sizeof(underline)); memset(underline, '-', sizeof(underline));
@ -485,7 +485,7 @@ static void show_thread_timers_helper(struct vty *vty, struct thread_master *m)
{ {
const char *name = m->name ? m->name : "main"; const char *name = m->name ? m->name : "main";
char underline[strlen(name) + 1]; char underline[strlen(name) + 1];
struct thread *thread; struct event *thread;
memset(underline, '-', sizeof(underline)); memset(underline, '-', sizeof(underline));
underline[sizeof(underline) - 1] = '\0'; underline[sizeof(underline) - 1] = '\0';
@ -571,10 +571,10 @@ struct thread_master *thread_master_create(const char *name)
} }
rv->read = XCALLOC(MTYPE_THREAD_POLL, rv->read = XCALLOC(MTYPE_THREAD_POLL,
sizeof(struct thread *) * rv->fd_limit); sizeof(struct event *) * rv->fd_limit);
rv->write = XCALLOC(MTYPE_THREAD_POLL, rv->write = XCALLOC(MTYPE_THREAD_POLL,
sizeof(struct thread *) * rv->fd_limit); sizeof(struct event *) * rv->fd_limit);
char tmhashname[strlen(name) + 32]; char tmhashname[strlen(name) + 32];
snprintf(tmhashname, sizeof(tmhashname), "%s - threadmaster event hash", snprintf(tmhashname, sizeof(tmhashname), "%s - threadmaster event hash",
@ -634,14 +634,14 @@ void thread_master_set_name(struct thread_master *master, const char *name)
#define THREAD_UNUSED_DEPTH 10 #define THREAD_UNUSED_DEPTH 10
/* Move thread to unuse list. */ /* Move thread to unuse list. */
static void thread_add_unuse(struct thread_master *m, struct thread *thread) static void thread_add_unuse(struct thread_master *m, struct event *thread)
{ {
pthread_mutex_t mtxc = thread->mtx; pthread_mutex_t mtxc = thread->mtx;
assert(m != NULL && thread != NULL); assert(m != NULL && thread != NULL);
thread->hist->total_active--; thread->hist->total_active--;
memset(thread, 0, sizeof(struct thread)); memset(thread, 0, sizeof(struct event));
thread->type = THREAD_UNUSED; thread->type = THREAD_UNUSED;
/* Restore the thread mutex context. */ /* Restore the thread mutex context. */
@ -659,16 +659,16 @@ static void thread_add_unuse(struct thread_master *m, struct thread *thread)
static void thread_list_free(struct thread_master *m, static void thread_list_free(struct thread_master *m,
struct thread_list_head *list) struct thread_list_head *list)
{ {
struct thread *t; struct event *t;
while ((t = thread_list_pop(list))) while ((t = thread_list_pop(list)))
thread_free(m, t); thread_free(m, t);
} }
static void thread_array_free(struct thread_master *m, static void thread_array_free(struct thread_master *m,
struct thread **thread_array) struct event **thread_array)
{ {
struct thread *t; struct event *t;
int index; int index;
for (index = 0; index < m->fd_limit; ++index) { for (index = 0; index < m->fd_limit; ++index) {
@ -692,7 +692,7 @@ static void thread_array_free(struct thread_master *m,
void thread_master_free_unused(struct thread_master *m) void thread_master_free_unused(struct thread_master *m)
{ {
frr_with_mutex (&m->mtx) { frr_with_mutex (&m->mtx) {
struct thread *t; struct event *t;
while ((t = thread_list_pop(&m->unuse))) while ((t = thread_list_pop(&m->unuse)))
thread_free(m, t); thread_free(m, t);
} }
@ -701,7 +701,7 @@ void thread_master_free_unused(struct thread_master *m)
/* Stop thread scheduler. */ /* Stop thread scheduler. */
void thread_master_free(struct thread_master *m) void thread_master_free(struct thread_master *m)
{ {
struct thread *t; struct event *t;
frr_with_mutex (&masters_mtx) { frr_with_mutex (&masters_mtx) {
listnode_delete(masters, m); listnode_delete(masters, m);
@ -733,7 +733,7 @@ void thread_master_free(struct thread_master *m)
} }
/* Return remain time in milliseconds. */ /* Return remain time in milliseconds. */
unsigned long thread_timer_remain_msec(struct thread *thread) unsigned long thread_timer_remain_msec(struct event *thread)
{ {
int64_t remain; int64_t remain;
@ -748,12 +748,12 @@ unsigned long thread_timer_remain_msec(struct thread *thread)
} }
/* Return remain time in seconds. */ /* Return remain time in seconds. */
unsigned long thread_timer_remain_second(struct thread *thread) unsigned long thread_timer_remain_second(struct event *thread)
{ {
return thread_timer_remain_msec(thread) / 1000LL; return thread_timer_remain_msec(thread) / 1000LL;
} }
struct timeval thread_timer_remain(struct thread *thread) struct timeval thread_timer_remain(struct event *thread)
{ {
struct timeval remain; struct timeval remain;
frr_with_mutex (&thread->mtx) { frr_with_mutex (&thread->mtx) {
@ -780,8 +780,7 @@ static int time_hhmmss(char *buf, int buf_size, long sec)
return wr != 8; return wr != 8;
} }
char *thread_timer_to_hhmmss(char *buf, int buf_size, char *thread_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
struct thread *t_timer)
{ {
if (t_timer) { if (t_timer) {
time_hhmmss(buf, buf_size, time_hhmmss(buf, buf_size,
@ -793,15 +792,15 @@ char *thread_timer_to_hhmmss(char *buf, int buf_size,
} }
/* Get new thread. */ /* Get new thread. */
static struct thread *thread_get(struct thread_master *m, uint8_t type, static struct event *thread_get(struct thread_master *m, uint8_t type,
void (*func)(struct thread *), void *arg, void (*func)(struct event *), void *arg,
const struct xref_threadsched *xref) const struct xref_threadsched *xref)
{ {
struct thread *thread = thread_list_pop(&m->unuse); struct event *thread = thread_list_pop(&m->unuse);
struct cpu_thread_history tmp; struct cpu_thread_history tmp;
if (!thread) { if (!thread) {
thread = XCALLOC(MTYPE_THREAD, sizeof(struct thread)); thread = XCALLOC(MTYPE_THREAD, sizeof(struct event));
/* mutex only needs to be initialized at struct creation. */ /* mutex only needs to be initialized at struct creation. */
pthread_mutex_init(&thread->mtx, NULL); pthread_mutex_init(&thread->mtx, NULL);
m->alloc++; m->alloc++;
@ -840,7 +839,7 @@ static struct thread *thread_get(struct thread_master *m, uint8_t type,
return thread; return thread;
} }
static void thread_free(struct thread_master *master, struct thread *thread) static void thread_free(struct thread_master *master, struct event *thread)
{ {
/* Update statistics. */ /* Update statistics. */
assert(master->alloc > 0); assert(master->alloc > 0);
@ -951,12 +950,12 @@ done:
/* Add new read thread. */ /* Add new read thread. */
void _thread_add_read_write(const struct xref_threadsched *xref, void _thread_add_read_write(const struct xref_threadsched *xref,
struct thread_master *m, struct thread_master *m,
void (*func)(struct thread *), void *arg, int fd, void (*func)(struct event *), void *arg, int fd,
struct thread **t_ptr) struct event **t_ptr)
{ {
int dir = xref->thread_type; int dir = xref->thread_type;
struct thread *thread = NULL; struct event *thread = NULL;
struct thread **thread_array; struct event **thread_array;
if (dir == THREAD_READ) if (dir == THREAD_READ)
frrtrace(9, frr_libfrr, schedule_read, m, frrtrace(9, frr_libfrr, schedule_read, m,
@ -1031,11 +1030,11 @@ void _thread_add_read_write(const struct xref_threadsched *xref,
static void _thread_add_timer_timeval(const struct xref_threadsched *xref, static void _thread_add_timer_timeval(const struct xref_threadsched *xref,
struct thread_master *m, struct thread_master *m,
void (*func)(struct thread *), void *arg, void (*func)(struct event *), void *arg,
struct timeval *time_relative, struct timeval *time_relative,
struct thread **t_ptr) struct event **t_ptr)
{ {
struct thread *thread; struct event *thread;
struct timeval t; struct timeval t;
assert(m != NULL); assert(m != NULL);
@ -1084,8 +1083,8 @@ static void _thread_add_timer_timeval(const struct xref_threadsched *xref,
/* Add timer event thread. */ /* Add timer event thread. */
void _thread_add_timer(const struct xref_threadsched *xref, void _thread_add_timer(const struct xref_threadsched *xref,
struct thread_master *m, void (*func)(struct thread *), struct thread_master *m, void (*func)(struct event *),
void *arg, long timer, struct thread **t_ptr) void *arg, long timer, struct event **t_ptr)
{ {
struct timeval trel; struct timeval trel;
@ -1100,8 +1099,8 @@ void _thread_add_timer(const struct xref_threadsched *xref,
/* Add timer event thread with "millisecond" resolution */ /* Add timer event thread with "millisecond" resolution */
void _thread_add_timer_msec(const struct xref_threadsched *xref, void _thread_add_timer_msec(const struct xref_threadsched *xref,
struct thread_master *m, struct thread_master *m,
void (*func)(struct thread *), void *arg, void (*func)(struct event *), void *arg, long timer,
long timer, struct thread **t_ptr) struct event **t_ptr)
{ {
struct timeval trel; struct timeval trel;
@ -1115,19 +1114,18 @@ void _thread_add_timer_msec(const struct xref_threadsched *xref,
/* Add timer event thread with "timeval" resolution */ /* Add timer event thread with "timeval" resolution */
void _thread_add_timer_tv(const struct xref_threadsched *xref, void _thread_add_timer_tv(const struct xref_threadsched *xref,
struct thread_master *m, struct thread_master *m, void (*func)(struct event *),
void (*func)(struct thread *), void *arg, void *arg, struct timeval *tv, struct event **t_ptr)
struct timeval *tv, struct thread **t_ptr)
{ {
_thread_add_timer_timeval(xref, m, func, arg, tv, t_ptr); _thread_add_timer_timeval(xref, m, func, arg, tv, t_ptr);
} }
/* Add simple event thread. */ /* Add simple event thread. */
void _thread_add_event(const struct xref_threadsched *xref, void _thread_add_event(const struct xref_threadsched *xref,
struct thread_master *m, void (*func)(struct thread *), struct thread_master *m, void (*func)(struct event *),
void *arg, int val, struct thread **t_ptr) void *arg, int val, struct event **t_ptr)
{ {
struct thread *thread = NULL; struct event *thread = NULL;
frrtrace(9, frr_libfrr, schedule_event, m, frrtrace(9, frr_libfrr, schedule_event, m,
xref->funcname, xref->xref.file, xref->xref.line, xref->funcname, xref->xref.file, xref->xref.line,
@ -1240,7 +1238,7 @@ static void thread_cancel_rw(struct thread_master *master, int fd, short state,
static void cancel_arg_helper(struct thread_master *master, static void cancel_arg_helper(struct thread_master *master,
const struct cancel_req *cr) const struct cancel_req *cr)
{ {
struct thread *t; struct event *t;
nfds_t i; nfds_t i;
int fd; int fd;
struct pollfd *pfd; struct pollfd *pfd;
@ -1307,7 +1305,7 @@ static void cancel_arg_helper(struct thread_master *master,
/* Check the timer tasks */ /* Check the timer tasks */
t = thread_timer_list_first(&master->timer); t = thread_timer_list_first(&master->timer);
while (t) { while (t) {
struct thread *t_next; struct event *t_next;
t_next = thread_timer_list_next(&master->timer, t); t_next = thread_timer_list_next(&master->timer, t);
@ -1333,8 +1331,8 @@ static void cancel_arg_helper(struct thread_master *master,
static void do_thread_cancel(struct thread_master *master) static void do_thread_cancel(struct thread_master *master)
{ {
struct thread_list_head *list = NULL; struct thread_list_head *list = NULL;
struct thread **thread_array = NULL; struct event **thread_array = NULL;
struct thread *thread; struct event *thread;
struct cancel_req *cr; struct cancel_req *cr;
struct listnode *ln; struct listnode *ln;
@ -1467,7 +1465,7 @@ void thread_cancel_event_ready(struct thread_master *m, void *arg)
* *
* @param thread task to cancel * @param thread task to cancel
*/ */
void thread_cancel(struct thread **thread) void thread_cancel(struct event **thread)
{ {
struct thread_master *master; struct thread_master *master;
@ -1497,7 +1495,7 @@ void thread_cancel(struct thread **thread)
/** /**
* Asynchronous cancellation. * Asynchronous cancellation.
* *
* Called with either a struct thread ** or void * to an event argument, * Called with either a struct event ** or void * to an event argument,
* this function posts the correct cancellation request and blocks until it is * this function posts the correct cancellation request and blocks until it is
* serviced. * serviced.
* *
@ -1518,7 +1516,7 @@ void thread_cancel(struct thread **thread)
* @param thread pointer to thread to cancel * @param thread pointer to thread to cancel
* @param eventobj the event * @param eventobj the event
*/ */
void thread_cancel_async(struct thread_master *master, struct thread **thread, void thread_cancel_async(struct thread_master *master, struct event **thread,
void *eventobj) void *eventobj)
{ {
assert(!(thread && eventobj) && (thread || eventobj)); assert(!(thread && eventobj) && (thread || eventobj));
@ -1566,13 +1564,13 @@ static struct timeval *thread_timer_wait(struct thread_timer_list_head *timers,
if (!thread_timer_list_count(timers)) if (!thread_timer_list_count(timers))
return NULL; return NULL;
struct thread *next_timer = thread_timer_list_first(timers); struct event *next_timer = thread_timer_list_first(timers);
monotime_until(&next_timer->u.sands, timer_val); monotime_until(&next_timer->u.sands, timer_val);
return timer_val; return timer_val;
} }
static struct thread *thread_run(struct thread_master *m, struct thread *thread, static struct event *thread_run(struct thread_master *m, struct event *thread,
struct thread *fetch) struct event *fetch)
{ {
*fetch = *thread; *fetch = *thread;
thread_add_unuse(m, thread); thread_add_unuse(m, thread);
@ -1580,10 +1578,10 @@ static struct thread *thread_run(struct thread_master *m, struct thread *thread,
} }
static int thread_process_io_helper(struct thread_master *m, static int thread_process_io_helper(struct thread_master *m,
struct thread *thread, short state, struct event *thread, short state,
short actual_state, int pos) short actual_state, int pos)
{ {
struct thread **thread_array; struct event **thread_array;
/* /*
* poll() clears the .events field, but the pollfd array we * poll() clears the .events field, but the pollfd array we
@ -1690,7 +1688,7 @@ static unsigned int thread_process_timers(struct thread_master *m,
{ {
struct timeval prev = *timenow; struct timeval prev = *timenow;
bool displayed = false; bool displayed = false;
struct thread *thread; struct event *thread;
unsigned int ready = 0; unsigned int ready = 0;
while ((thread = thread_timer_list_first(&m->timer))) { while ((thread = thread_timer_list_first(&m->timer))) {
@ -1729,7 +1727,7 @@ static unsigned int thread_process_timers(struct thread_master *m,
/* process a list en masse, e.g. for event thread lists */ /* process a list en masse, e.g. for event thread lists */
static unsigned int thread_process(struct thread_list_head *list) static unsigned int thread_process(struct thread_list_head *list)
{ {
struct thread *thread; struct event *thread;
unsigned int ready = 0; unsigned int ready = 0;
while ((thread = thread_list_pop(list))) { while ((thread = thread_list_pop(list))) {
@ -1742,9 +1740,9 @@ static unsigned int thread_process(struct thread_list_head *list)
/* Fetch next ready thread. */ /* Fetch next ready thread. */
struct thread *thread_fetch(struct thread_master *m, struct thread *fetch) struct event *thread_fetch(struct thread_master *m, struct event *fetch)
{ {
struct thread *thread = NULL; struct event *thread = NULL;
struct timeval now; struct timeval now;
struct timeval zerotime = {0, 0}; struct timeval zerotime = {0, 0};
struct timeval tv; struct timeval tv;
@ -1912,7 +1910,7 @@ unsigned long thread_consumed_time(RUSAGE_T *now, RUSAGE_T *start,
for CPU time. On balance, wall clock time seems to make sense. for CPU time. On balance, wall clock time seems to make sense.
Plus it has the added benefit that gettimeofday should be faster Plus it has the added benefit that gettimeofday should be faster
than calling getrusage. */ than calling getrusage. */
int thread_should_yield(struct thread *thread) int thread_should_yield(struct event *thread)
{ {
int result; int result;
frr_with_mutex (&thread->mtx) { frr_with_mutex (&thread->mtx) {
@ -1922,7 +1920,7 @@ int thread_should_yield(struct thread *thread)
return result; return result;
} }
void thread_set_yield_time(struct thread *thread, unsigned long yield_time) void thread_set_yield_time(struct event *thread, unsigned long yield_time)
{ {
frr_with_mutex (&thread->mtx) { frr_with_mutex (&thread->mtx) {
thread->yield = yield_time; thread->yield = yield_time;
@ -1963,7 +1961,7 @@ void thread_getrusage(RUSAGE_T *r)
* particular, the maximum real and cpu times must be monotonically increasing * particular, the maximum real and cpu times must be monotonically increasing
* or this code is not correct. * or this code is not correct.
*/ */
void thread_call(struct thread *thread) void thread_call(struct event *thread)
{ {
RUSAGE_T before, after; RUSAGE_T before, after;
@ -2060,10 +2058,10 @@ void thread_call(struct thread *thread)
/* Execute thread */ /* Execute thread */
void _thread_execute(const struct xref_threadsched *xref, void _thread_execute(const struct xref_threadsched *xref,
struct thread_master *m, void (*func)(struct thread *), struct thread_master *m, void (*func)(struct event *),
void *arg, int val) void *arg, int val)
{ {
struct thread *thread; struct event *thread;
/* Get or allocate new thread to execute. */ /* Get or allocate new thread to execute. */
frr_with_mutex (&m->mtx) { frr_with_mutex (&m->mtx) {
@ -2131,7 +2129,7 @@ void debug_signals(const sigset_t *sigs)
} }
static ssize_t printfrr_thread_dbg(struct fbuf *buf, struct printfrr_eargs *ea, static ssize_t printfrr_thread_dbg(struct fbuf *buf, struct printfrr_eargs *ea,
const struct thread *thread) const struct event *thread)
{ {
static const char * const types[] = { static const char * const types[] = {
[THREAD_READ] = "read", [THREAD_READ] = "read",
@ -2176,7 +2174,7 @@ printfrr_ext_autoreg_p("TH", printfrr_thread);
static ssize_t printfrr_thread(struct fbuf *buf, struct printfrr_eargs *ea, static ssize_t printfrr_thread(struct fbuf *buf, struct printfrr_eargs *ea,
const void *ptr) const void *ptr)
{ {
const struct thread *thread = ptr; const struct event *thread = ptr;
struct timespec remain = {}; struct timespec remain = {};
if (ea->fmt[0] == 'D') { if (ea->fmt[0] == 'D') {

View file

@ -69,8 +69,8 @@ struct xref_threadsched {
struct thread_master { struct thread_master {
char *name; char *name;
struct thread **read; struct event **read;
struct thread **write; struct event **write;
struct thread_timer_list_head timer; struct thread_timer_list_head timer;
struct thread_list_head event, ready, unuse; struct thread_list_head event, ready, unuse;
struct list *cancel_req; struct list *cancel_req;
@ -92,14 +92,14 @@ struct thread_master {
}; };
/* Thread itself. */ /* Thread itself. */
struct thread { struct event {
uint8_t type; /* thread type */ uint8_t type; /* thread type */
uint8_t add_type; /* thread type */ uint8_t add_type; /* thread type */
struct thread_list_item threaditem; struct thread_list_item threaditem;
struct thread_timer_list_item timeritem; struct thread_timer_list_item timeritem;
struct thread **ref; /* external reference (if given) */ struct event **ref; /* external reference (if given) */
struct thread_master *master; /* pointer to the struct thread_master */ struct thread_master *master; /* pointer to the struct thread_master */
void (*func)(struct thread *); /* event function */ void (*func)(struct event *); /* event function */
void *arg; /* event argument */ void *arg; /* event argument */
union { union {
int val; /* second argument of the event. */ int val; /* second argument of the event. */
@ -115,11 +115,11 @@ struct thread {
}; };
#ifdef _FRR_ATTRIBUTE_PRINTFRR #ifdef _FRR_ATTRIBUTE_PRINTFRR
#pragma FRR printfrr_ext "%pTH" (struct thread *) #pragma FRR printfrr_ext "%pTH"(struct event *)
#endif #endif
struct cpu_thread_history { struct cpu_thread_history {
void (*func)(struct thread *); void (*func)(struct event *);
atomic_size_t total_cpu_warn; atomic_size_t total_cpu_warn;
atomic_size_t total_wall_warn; atomic_size_t total_wall_warn;
atomic_size_t total_starv_warn; atomic_size_t total_starv_warn;
@ -212,48 +212,48 @@ extern void thread_master_free_unused(struct thread_master *);
extern void _thread_add_read_write(const struct xref_threadsched *xref, extern void _thread_add_read_write(const struct xref_threadsched *xref,
struct thread_master *master, struct thread_master *master,
void (*fn)(struct thread *), void *arg, void (*fn)(struct event *), void *arg,
int fd, struct thread **tref); int fd, struct event **tref);
extern void _thread_add_timer(const struct xref_threadsched *xref, extern void _thread_add_timer(const struct xref_threadsched *xref,
struct thread_master *master, struct thread_master *master,
void (*fn)(struct thread *), void *arg, long t, void (*fn)(struct event *), void *arg, long t,
struct thread **tref); struct event **tref);
extern void _thread_add_timer_msec(const struct xref_threadsched *xref, extern void _thread_add_timer_msec(const struct xref_threadsched *xref,
struct thread_master *master, struct thread_master *master,
void (*fn)(struct thread *), void *arg, void (*fn)(struct event *), void *arg,
long t, struct thread **tref); long t, struct event **tref);
extern void _thread_add_timer_tv(const struct xref_threadsched *xref, extern void _thread_add_timer_tv(const struct xref_threadsched *xref,
struct thread_master *master, struct thread_master *master,
void (*fn)(struct thread *), void *arg, void (*fn)(struct event *), void *arg,
struct timeval *tv, struct thread **tref); struct timeval *tv, struct event **tref);
extern void _thread_add_event(const struct xref_threadsched *xref, extern void _thread_add_event(const struct xref_threadsched *xref,
struct thread_master *master, struct thread_master *master,
void (*fn)(struct thread *), void *arg, int val, void (*fn)(struct event *), void *arg, int val,
struct thread **tref); struct event **tref);
extern void _thread_execute(const struct xref_threadsched *xref, extern void _thread_execute(const struct xref_threadsched *xref,
struct thread_master *master, struct thread_master *master,
void (*fn)(struct thread *), void *arg, int val); void (*fn)(struct event *), void *arg, int val);
extern void thread_cancel(struct thread **event); extern void thread_cancel(struct event **event);
extern void thread_cancel_async(struct thread_master *, struct thread **, extern void thread_cancel_async(struct thread_master *, struct event **,
void *); void *);
/* Cancel ready tasks with an arg matching 'arg' */ /* Cancel ready tasks with an arg matching 'arg' */
extern void thread_cancel_event_ready(struct thread_master *m, void *arg); extern void thread_cancel_event_ready(struct thread_master *m, void *arg);
/* Cancel all tasks with an arg matching 'arg', including timers and io */ /* Cancel all tasks with an arg matching 'arg', including timers and io */
extern void thread_cancel_event(struct thread_master *m, void *arg); extern void thread_cancel_event(struct thread_master *m, void *arg);
extern struct thread *thread_fetch(struct thread_master *, struct thread *); extern struct event *thread_fetch(struct thread_master *, struct event *event);
extern void thread_call(struct thread *); extern void thread_call(struct event *event);
extern unsigned long thread_timer_remain_second(struct thread *); extern unsigned long thread_timer_remain_second(struct event *event);
extern struct timeval thread_timer_remain(struct thread *); extern struct timeval thread_timer_remain(struct event *event);
extern unsigned long thread_timer_remain_msec(struct thread *); extern unsigned long thread_timer_remain_msec(struct event *event);
extern int thread_should_yield(struct thread *); extern int thread_should_yield(struct event *event);
/* set yield time for thread */ /* set yield time for thread */
extern void thread_set_yield_time(struct thread *, unsigned long); extern void thread_set_yield_time(struct event *event, unsigned long);
/* Internal libfrr exports */ /* Internal libfrr exports */
extern void thread_getrusage(RUSAGE_T *); extern void thread_getrusage(RUSAGE_T *);
@ -266,9 +266,9 @@ extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
/* only for use in logging functions! */ /* only for use in logging functions! */
extern pthread_key_t thread_current; extern pthread_key_t thread_current;
extern char *thread_timer_to_hhmmss(char *buf, int buf_size, extern char *thread_timer_to_hhmmss(char *buf, int buf_size,
struct thread *t_timer); struct event *t_timer);
static inline bool thread_is_scheduled(struct thread *thread) static inline bool thread_is_scheduled(struct event *thread)
{ {
if (thread) if (thread)
return true; return true;
@ -279,9 +279,9 @@ static inline bool thread_is_scheduled(struct thread *thread)
/* Debug signal mask */ /* Debug signal mask */
void debug_signals(const sigset_t *sigs); void debug_signals(const sigset_t *sigs);
static inline void thread_ignore_late_timer(struct thread *thread) static inline void thread_ignore_late_timer(struct event *event)
{ {
thread->ignore_timer_late = true; event->ignore_timer_late = true;
} }
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -224,12 +224,12 @@ void frr_pthread_stop_all(void)
*/ */
/* dummy task for sleeper pipe */ /* dummy task for sleeper pipe */
static void fpt_dummy(struct thread *thread) static void fpt_dummy(struct event *thread)
{ {
} }
/* poison pill task to end event loop */ /* poison pill task to end event loop */
static void fpt_finish(struct thread *thread) static void fpt_finish(struct event *thread)
{ {
struct frr_pthread *fpt = THREAD_ARG(thread); struct frr_pthread *fpt = THREAD_ARG(thread);
@ -289,7 +289,7 @@ static void *fpt_run(void *arg)
frr_pthread_notify_running(fpt); frr_pthread_notify_running(fpt);
struct thread task; struct event task;
while (atomic_load_explicit(&fpt->running, memory_order_relaxed)) { while (atomic_load_explicit(&fpt->running, memory_order_relaxed)) {
pthread_testcancel(); pthread_testcancel();
if (thread_fetch(fpt->master, &task)) { if (thread_fetch(fpt->master, &task)) {

View file

@ -43,7 +43,7 @@ void frrzmq_finish(void)
} }
} }
static void frrzmq_read_msg(struct thread *t) static void frrzmq_read_msg(struct event *t)
{ {
struct frrzmq_cb **cbp = THREAD_ARG(t); struct frrzmq_cb **cbp = THREAD_ARG(t);
struct frrzmq_cb *cb; struct frrzmq_cb *cb;
@ -201,7 +201,7 @@ int _frrzmq_thread_add_read(const struct xref_threadsched *xref,
return 0; return 0;
} }
static void frrzmq_write_msg(struct thread *t) static void frrzmq_write_msg(struct event *t)
{ {
struct frrzmq_cb **cbp = THREAD_ARG(t); struct frrzmq_cb **cbp = THREAD_ARG(t);
struct frrzmq_cb *cb; struct frrzmq_cb *cb;

View file

@ -26,7 +26,7 @@ extern "C" {
/* callback integration */ /* callback integration */
struct cb_core { struct cb_core {
struct thread *thread; struct event *thread;
void *arg; void *arg;
bool cancelled; bool cancelled;

View file

@ -27,7 +27,7 @@ struct thread_master *master;
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
struct thread thread; struct event event;
master = thread_master_create(NULL); master = thread_master_create(NULL);
@ -45,8 +45,8 @@ int main(int argc, char **argv)
vty_stdio(vty_do_exit); vty_stdio(vty_do_exit);
/* Fetch next active thread. */ /* Fetch next active thread. */
while (thread_fetch(master, &thread)) while (thread_fetch(master, &event))
thread_call(&thread); thread_call(&event);
/* Not reached. */ /* Not reached. */
exit(0); exit(0);

Some files were not shown because too many files have changed in this diff Show more