DEFINE_MGROUP(BABELD, "babeld");
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_initial_noise(void);
-static void babel_read_protocol(struct thread *thread);
-static void babel_main_loop(struct thread *thread);
+static void babel_read_protocol(struct event *thread);
+static void babel_main_loop(struct event *thread);
static void babel_set_timer(struct timeval *timeout);
static void babel_fill_with_next_timeout(struct timeval *tv);
static void
}
/* 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;
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
/* 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,
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);
babel_get_myid();
}
/* Function used with timeout. */
-static void babel_main_loop(struct thread *thread)
+static void babel_main_loop(struct event *thread)
{
struct timeval tv;
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct babel
{
/* Babel threads. */
- struct thread *t_read; /* on Babel protocol's socket */
- struct thread *t_update; /* timers */
+ struct event *t_read; /* on Babel protocol's socket */
+ struct event *t_update; /* timers */
/* distribute_ctx */
struct distribute_ctx *distribute_ctx;
};
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);
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);
}
/* 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);
}
/* 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_config_timers timers;
struct bfd_timers cur_timers;
uint64_t detect_TO;
- struct thread *echo_recvtimer_ev;
- struct thread *recvtimer_ev;
+ struct event *echo_recvtimer_ev;
+ struct event *recvtimer_ev;
uint64_t xmt_TO;
uint64_t echo_xmt_TO;
- struct thread *xmttimer_ev;
- struct thread *echo_xmttimer_ev;
+ struct event *xmttimer_ev;
+ struct event *echo_xmttimer_ev;
uint64_t echo_detect_TO;
/* software object state */
TAILQ_ENTRY(bfd_control_socket) bcs_entry;
int bcs_sd;
- struct thread *bcs_ev;
- struct thread *bcs_outev;
+ struct event *bcs_ev;
+ struct event *bcs_outev;
struct bcqueue bcs_bcqueue;
/* Notification data */
void control_shutdown(void);
int control_notify(struct bfd_session *bs, uint8_t notify_state);
int control_notify_config(const char *op, struct bfd_session *bs);
-void control_accept(struct thread *t);
+void control_accept(struct event *t);
/*
int bg_echov6;
struct vrf *vrf;
- struct thread *bg_ev[6];
+ struct event *bg_ev[6];
};
/* Forward declaration of data plane context struct. */
struct bfd_global {
int bg_csock;
- struct thread *bg_csockev;
+ struct event *bg_csockev;
struct bcslist bg_bcslist;
struct pllist bg_pllist;
/* Distributed BFD items. */
bool bg_use_dplane;
int bg_dplane_sock;
- struct thread *bg_dplane_sockev;
+ struct event *bg_dplane_sockev;
struct dplane_queue bg_dplaneq;
/* Debug options. */
void ptm_bfd_echo_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);
/*
*
* 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_echo_recvtimer_update(struct bfd_session *bs);
/* Export callback functions for `event.c`. */
extern struct thread_master *master;
-void bfd_recvtimer_cb(struct thread *t);
-void bfd_echo_recvtimer_cb(struct thread *t);
-void bfd_xmt_cb(struct thread *t);
-void bfd_echo_xmt_cb(struct thread *t);
+void bfd_recvtimer_cb(struct event *t);
+void bfd_echo_recvtimer_cb(struct event *t);
+void bfd_xmt_cb(struct event *t);
+void bfd_echo_xmt_cb(struct event *t);
extern struct in6_addr zero_addr;
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);
struct bfd_session *bfd;
struct bfd_control_socket *control_new(int sd);
static void control_free(struct bfd_control_socket *bcs);
static void control_reset_buf(struct bfd_control_buffer *bcb);
-static void control_read(struct thread *t);
-static void control_write(struct thread *t);
+static void control_read(struct event *t);
+static void control_write(struct event *t);
static void control_handle_request_add(struct bfd_control_socket *bcs,
struct bfd_control_msg *bcm);
}
}
-void control_accept(struct thread *t)
+void control_accept(struct event *t)
{
int csock, sd = THREAD_FD(t);
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_buffer *bcb = &bcs->bcs_bin;
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_buffer *bcb = bcs->bcs_bout;
/** Output buffer data. */
struct stream *outbuf;
/** Input event data. */
- struct thread *inbufev;
+ struct event *inbufev;
/** Output event data. */
- struct thread *outbufev;
+ struct event *outbufev;
/** Connection event. */
- struct thread *connectev;
+ struct event *connectev;
/** Amount of bytes read. */
uint64_t in_bytes;
*/
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 void bfd_dplane_ctx_free(struct bfd_dplane_ctx *bdc);
static int _bfd_dplane_add_session(struct bfd_dplane_ctx *bdc,
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);
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);
int rv;
/*
* 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_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);
int rv, sock;
(*cnt)++;
}
-static void bmp_stats(struct thread *thread)
+static void bmp_stats(struct event *thread)
{
struct bmp_targets *bt = THREAD_ARG(thread);
struct stream *s;
}
/* 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);
char buf[1024];
}
/* Accept BMP connection. */
-static void bmp_accept(struct thread *thread)
+static void bmp_accept(struct event *thread)
{
union sockunion su;
struct bmp_listener *bl = THREAD_ARG(thread);
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);
socklen_t slen;
int socket;
char remote[SU_ADDRSTRLEN + 6];
- struct thread *t_read;
+ struct event *t_read;
struct pullwr *pullwr;
union sockunion addrs[8];
int socket;
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 */
union sockunion addr;
int port;
- struct thread *t_accept;
+ struct event *t_accept;
int sock;
};
struct bmp_actives_head actives;
- struct thread *t_stats;
+ struct event *t_stats;
struct bmp_session_head sessions;
struct bmp_qhash_head updhash;
/* Handler of conditional advertisement timer event.
* 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;
safi_t safi;
/* Handler of reuse timer event. Each route in the current reuse-list
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 *next;
struct bgp_damp_info *no_reuse_list;
/* Reuse timer thread per-set base. */
- struct thread *t_reuse;
+ struct event *t_reuse;
afi_t afi;
safi_t safi;
char *interval_str;
- struct thread *t_interval;
+ struct event *t_interval;
};
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. */
struct stream *bgp_dump_obuf;
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;
bgp_dump = THREAD_ARG(t);
bool is_local);
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_unlink(struct bgp_path_evpn_nh_info *nh_info);
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;
struct listnode *node;
/* List of ESs with pending/periodic processing */
struct list *pend_es_list;
/* periodic timer for running background consistency checks */
- struct thread *t_cons_check;
+ struct event *t_cons_check;
/* config knobs for optimizing or interop */
/* Generate EAD-EVI routes even if the ES is oper-down. This can be
function. */
/* BGP event function. */
-void bgp_event(struct thread *);
+void bgp_event(struct event *event);
/* BGP thread functions. */
-static void bgp_start_timer(struct thread *);
-static void bgp_connect_timer(struct thread *);
-static void bgp_holdtime_timer(struct thread *);
-static void bgp_delayopen_timer(struct thread *);
+static void bgp_start_timer(struct event *event);
+static void bgp_connect_timer(struct event *event);
+static void bgp_holdtime_timer(struct event *event);
+static void bgp_delayopen_timer(struct event *event);
/* BGP FSM functions. */
static enum bgp_fsm_state_progress bgp_start(struct peer *);
/* BGP start timer. This function set BGP_Start event to thread value
and process event. */
-static void bgp_start_timer(struct thread *thread)
+static void bgp_start_timer(struct event *thread)
{
struct peer *peer;
}
/* BGP connect retry timer. */
-static void bgp_connect_timer(struct thread *thread)
+static void bgp_connect_timer(struct event *thread)
{
struct peer *peer;
}
/* BGP holdtime timer. */
-static void bgp_holdtime_timer(struct thread *thread)
+static void bgp_holdtime_timer(struct event *thread)
{
atomic_size_t inq_count;
struct peer *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;
}
/* RFC 4271 DelayOpenTimer */
-void bgp_delayopen_timer(struct thread *thread)
+void bgp_delayopen_timer(struct event *thread)
{
struct peer *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 *peer;
}
}
-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 listnode *node, *nnode;
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;
afi_t afi;
}
/* 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;
afi_t afi;
}
/* 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;
}
/* 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;
}
/* 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;
* 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.
*/
-static void bgp_connect_check(struct thread *thread)
+static void bgp_connect_check(struct event *thread)
{
int status;
socklen_t slen;
};
/* Execute event process. */
-void bgp_event(struct thread *thread)
+void bgp_event(struct event *thread)
{
enum bgp_fsm_events event;
struct peer *peer;
* 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_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_stop(struct peer *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,
enum bgp_fsm_status status);
extern const char *const peer_down_str[];
/* forward declarations */
static uint16_t bgp_write(struct peer *);
static uint16_t bgp_read(struct peer *peer, int *code_p);
-static void bgp_process_writes(struct thread *);
-static void bgp_process_reads(struct thread *);
+static void bgp_process_writes(struct event *event);
+static void bgp_process_reads(struct event *event);
static bool validate_header(struct peer *);
/* generic i/o status codes */
/*
* 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;
peer = THREAD_ARG(thread);
* 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.
*/
-static void bgp_process_reads(struct thread *thread)
+static void bgp_process_reads(struct event *thread)
{
/* clang-format off */
static struct peer *peer; /* peer to read from */
struct timeval starttime;
struct skiplist *timestamps_alloc;
struct skiplist *timestamps_dealloc;
- struct thread *event_thread;
+ struct event *event_thread;
unsigned int counter[LPT_STAT_MAX];
};
return 0;
}
-static void labelpool_test_event_handler(struct thread *thread)
+static void labelpool_test_event_handler(struct event *thread)
{
struct lp_test *tcb;
}
/* Accept bgp connection. */
-static void bgp_accept(struct thread *thread)
+static void bgp_accept(struct event *thread)
{
int bgp_sock;
int accept_sock;
struct bgp_listener {
int fd;
union sockunion su;
- struct thread *thread;
+ struct event *thread;
struct bgp *bgp;
char *name;
};
static void register_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 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)
{
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);
struct bgp *bgp = THREAD_ARG(thread);
* update group a peer belongs to, encode this information into packets, and
* 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);
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;
* @param thread
* @return 0
*/
-void bgp_process_packet(struct thread *thread)
+void bgp_process_packet(struct event *thread)
{
/* Yes first of all get peer pointer. */
struct peer *peer; // peer
* having the io pthread try to enqueue fsm events or mess with the peer
* struct.
*/
-void bgp_packet_process_error(struct thread *thread)
+void bgp_packet_process_error(struct event *thread)
{
struct peer *peer;
int code;
extern int bgp_packet_set_marker(struct stream *s, uint8_t type);
extern void bgp_packet_set_size(struct stream *s);
-extern void bgp_generate_updgrp_packets(struct thread *);
-extern void bgp_process_packet(struct thread *);
+extern void bgp_generate_updgrp_packets(struct event *event);
+extern void bgp_process_packet(struct event *event);
extern void bgp_send_delayed_eor(struct bgp *bgp);
/* 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
bgp_notify_decapsulate_hard_reset(struct bgp_notify *notify);
extern bool bgp_has_graceful_restart_notification(struct peer *peer);
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;
afi_t afi;
struct afi_safi_info *thread_info;
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);
XFREE(MTYPE_TMP, thread_info);
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;
* Callback that is invoked when the route announcement timer for a
* 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 *peer;
* Without splitting the full job into several part,
* 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;
struct bgp_dest *dest;
}
}
-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 *top;
}
}
-static void bgp_peer_count_walker(struct thread *t)
+static void bgp_peer_count_walker(struct event *t)
{
struct bgp_dest *rn, *rm;
const struct bgp_table *table;
} export;
struct {
- struct thread *timer;
+ struct event *timer;
void *hme; /* encap monitor, if this is a VPN route */
struct prefix_rd
rd; /* import: route's route-distinguisher */
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);
}
#define RETRY_INTERVAL_DEFAULT 600
#define BGP_RPKI_CACHE_SERVER_SYNC_RETRY_TIMEOUT 3
-static struct thread *t_rpki_sync;
+static struct event *t_rpki_sync;
#define RPKI_DEBUG(...) \
if (rpki_debug) { \
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 bgp_dest *match, *node;
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 listnode *node;
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);
return 0;
}
-static void sync_expired(struct thread *thread)
+static void sync_expired(struct event *thread)
{
if (!rtr_mgr_conf_in_sync(rtr_config)) {
RPKI_DEBUG("rtr_mgr is not synced, retrying.");
/* soft_reconfig_table in progress */
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 */
struct list *soft_reconfig_peers;
/*
* 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;
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;
char reason[] = "refresh default-originate route-map";
/* announcement attribute hash */
struct hash *hash;
- struct thread *t_coalesce;
+ struct event *t_coalesce;
uint32_t v_coalesce;
- struct thread *t_merge_check;
+ struct event *t_merge_check;
/* table version that the subgroup has caught up to. */
uint64_t version;
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_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_subgroup_inherit_info(struct update_subgroup *to,
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 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)
{
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 bgp *bgp;
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_chunk_obtained;
#define BGP_FLOWSPEC_TABLE_CHUNK 100000
static uint32_t bgp_tm_min, bgp_tm_max, bgp_tm_chunk_size;
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;
int delay = 10, ret = 0;
return 0;
}
-static void bgp_startup_timer_expire(struct thread *thread)
+static void bgp_startup_timer_expire(struct event *thread)
{
struct bgp *bgp;
/* Delete the graceful restart info */
FOREACH_AFI_SAFI (afi, safi) {
- struct thread *t;
+ struct event *t;
gr_info = &bgp->gr_info[afi][safi];
if (!gr_info)
uint64_t subgrp_idspace;
/* 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 */
#define RMAP_DEFAULT_UPDATE_TIMER 5 /* disabled by default */
/* Count of EOR received */
uint32_t eor_received;
/* Deferral Timer */
- struct thread *t_select_deferral;
+ struct event *t_select_deferral;
/* Routes Deferred */
uint32_t gr_deferred;
/* Best route select */
- struct thread *t_route_select;
+ struct event *t_route_select;
/* AFI, SAFI enabled */
bool af_enabled[AFI_MAX][SAFI_MAX];
/* Route update completed */
struct as_confed *confed_peers;
int confed_peers_cnt;
- struct thread
- *t_startup; /* start-up timer on only once at the beginning */
+ /* 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 */
#define BGP_MAXMED_ONSTARTUP_UNCONFIGURED 0 /* 0 means off, its the default */
uint32_t maxmed_onstartup_value; /* Max-med value when active on
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 */
bool v_maxmed_admin; /* true/false if max-med administrative is on/off
uint32_t maxmed_value; /* Max-med value when its active */
/* BGP update delay on startup */
- struct thread *t_update_delay;
- struct thread *t_establish_wait;
- struct thread *t_revalidate[AFI_MAX][SAFI_MAX];
+ struct event *t_update_delay;
+ struct event *t_establish_wait;
+ struct event *t_revalidate[AFI_MAX][SAFI_MAX];
uint8_t update_delay_over;
uint8_t main_zebra_update_hold;
struct hash *pbr_action_hash;
/* 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
/* BGP distance configuration. */
/* BGP Conditional advertisement */
uint32_t condition_check_period;
uint32_t condition_filter_count;
- struct thread *t_condition_check;
+ struct event *t_condition_check;
/* BGP VPN SRv6 backend */
bool srv6_enabled;
/*
* Trigger timer for bgp_announce_route().
*/
- struct thread *t_announce_route;
+ struct event *t_announce_route;
afi_t afi;
safi_t safi;
_Atomic uint32_t v_gr_restart;
/* Threads. */
- struct thread *t_read;
- struct thread *t_write;
- struct thread *t_start;
- struct thread *t_connect_check_r;
- struct thread *t_connect_check_w;
- struct thread *t_connect;
- struct thread *t_holdtime;
- struct thread *t_routeadv;
- struct thread *t_delayopen;
- struct thread *t_pmax_restart;
- struct thread *t_gr_restart;
- struct thread *t_gr_stale;
- struct thread *t_llgr_stale[AFI_MAX][SAFI_MAX];
- struct thread *t_revalidate_all[AFI_MAX][SAFI_MAX];
- struct thread *t_generate_updgrp_packets;
- struct thread *t_process_packet;
- struct thread *t_process_packet_error;
- struct thread *t_refresh_stalepath;
+ struct event *t_read;
+ struct event *t_write;
+ struct event *t_start;
+ struct event *t_connect_check_r;
+ struct event *t_connect_check_w;
+ struct event *t_connect;
+ struct event *t_holdtime;
+ struct event *t_routeadv;
+ struct event *t_delayopen;
+ struct event *t_pmax_restart;
+ struct event *t_gr_restart;
+ struct event *t_gr_stale;
+ struct event *t_llgr_stale[AFI_MAX][SAFI_MAX];
+ struct event *t_revalidate_all[AFI_MAX][SAFI_MAX];
+ struct event *t_generate_updgrp_packets;
+ struct event *t_process_packet;
+ struct event *t_process_packet_error;
+ struct event *t_refresh_stalepath;
/* Thread flags. */
_Atomic uint32_t thread_flags;
extern void peer_tx_shutdown_message_set(struct peer *, const char *msg);
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 enum asnotation_mode bgp_get_asnotation(struct bgp *bgp);
/*
* Timer callback for withdraw
*/
-static void rfapiWithdrawTimerVPN(struct thread *t)
+static void rfapiWithdrawTimerVPN(struct event *t)
{
struct rfapi_withdraw *wcb = THREAD_ARG(t);
struct bgp_path_info *bpi = wcb->info;
return 0;
}
-static void rfapiWithdrawTimerEncap(struct thread *t)
+static void rfapiWithdrawTimerEncap(struct event *t)
{
struct rfapi_withdraw *wcb = THREAD_ARG(t);
struct bgp_path_info *bpi = wcb->info;
rfapiBiStartWithdrawTimer(struct rfapi_import_table *import_table,
struct agg_node *rn, struct bgp_path_info *bpi,
afi_t afi, safi_t safi,
- void (*timer_service_func)(struct thread *))
+ void (*timer_service_func)(struct event *))
{
uint32_t lifetime;
struct rfapi_withdraw *wcb;
struct agg_node *rn, struct bgp_path_info *bpi)
{
struct rfapi_withdraw *wcb;
- struct thread t;
+ struct event t;
/*
* pretend we're an expiring timer
* bpi
*/
struct rfapi_withdraw *wcb;
- struct thread t;
+ struct event t;
/*
* pretend we're an expiring timer
int lockoffset)
{
struct rfapi_withdraw *wcb;
- struct thread t;
+ struct event t;
/*
* pretend we're an expiring timer
struct agg_node *rn;
struct bgp_path_info *bpi;
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);
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);
}
}
-static void rfapiMonitorEthTimerExpire(struct thread *t)
+static void rfapiMonitorEthTimerExpire(struct event *t)
{
struct rfapi_monitor_eth *m = THREAD_ARG(t);
#define RFAPI_MON_FLAG_NEEDCALLBACK 0x00000001 /* deferred callback */
// int dcount; /* debugging counter */
- struct thread *timer;
+ struct event *timer;
};
struct rfapi_monitor_encap {
struct rfapi_descriptor *rfd; /* which NVE requested the route */
struct ethaddr macaddr;
uint32_t logical_net_id;
- struct thread *timer;
+ struct event *timer;
};
/*
/*
* 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 bgp_tea_options *tea_options;
struct rfapi_un_option *un_options;
struct rfapi_vn_option *vn_options;
- struct thread *timer;
+ struct event *timer;
};
/*
if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra
&& bpi->extra->vnc.import.timer) {
- struct thread *t =
- (struct thread *)bpi->extra->vnc.import.timer;
+ struct event *t = (struct event *)bpi->extra->vnc.import.timer;
r = snprintf(p, REMAIN, " [%4lu] ",
thread_timer_remain_second(t));
INCP;
time_t age;
char buf_age[BUFSIZ];
- struct thread *t =
- (struct thread *)bpi->extra->vnc.import.timer;
+ struct event *t = (struct event *)bpi->extra->vnc.import.timer;
remaining = thread_timer_remain_second(t);
#ifdef RFAPI_REGISTRATIONS_REPORT_AGE
bgp_attr_unintern(&iattr);
}
-static void vncExportWithdrawTimer(struct thread *t)
+static void vncExportWithdrawTimer(struct event *t)
{
struct vnc_export_info *eti = THREAD_ARG(t);
const struct prefix *p = agg_node_get_prefix(eti->node);
uint8_t type;
uint8_t subtype;
uint32_t lifetime;
- struct thread *timer;
+ struct event *timer;
};
extern struct agg_node *vnc_etn_get(struct bgp *bgp, vnc_export_type_t type,
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``.
``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
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
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
of this confusion, this document refers to these "threads" as a 'task' except
where the datastructures are explicitly named. When they are explicitly named,
Type used internally for tasks on the ready queue.
``THREAD_UNUSED``
- Type used internally for ``struct thread`` objects that aren't being used.
- The event system pools ``struct thread`` to avoid heap allocations; this is
+ Type used internally for ``struct event`` objects that aren't being used.
+ The event system pools ``struct event`` to avoid heap allocations; this is
the type they have when they're in the pool.
``THREAD_EXECUTE``
::
- 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
``WRITE`` tasks are independent - a ``READ`` task only tests for
readability, for example.
Mapping the general names used in the figure to specific FRR functions:
-- ``task`` is ``struct thread *``
+- ``task`` is ``struct event *``
- ``fetch`` is ``thread_fetch()``
- ``exec()`` is ``thread_call``
- ``cancel()`` is ``thread_cancel()``
The ``thread_master`` code currently always holds RCU everywhere, except
while doing the actual ``poll()`` syscall. This is both an optimization as
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)
drop and reacquire it when doing some longer-running work.
* Called when 10sec waiting time expire and
* 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;
* Called when 10sec waiting time expire and
* 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;
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_wrapper(struct access_list *alist);
-extern void eigrp_distribute_timer_process(struct thread *thread);
-extern void eigrp_distribute_timer_interface(struct thread *thread);
+extern void eigrp_distribute_timer_process(struct event *thread);
+extern void eigrp_distribute_timer_interface(struct event *thread);
#endif /* EIGRPD_EIGRP_FILTER_H_ */
* Sends hello packet via multicast for all interfaces eigrp
* is configured for
*/
-void eigrp_hello_timer(struct thread *thread)
+void eigrp_hello_timer(struct event *thread)
{
struct eigrp_interface *ei;
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 *eigrp = nbr->ei->eigrp;
extern struct eigrp_neighbor *eigrp_nbr_new(struct eigrp_interface *ei);
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,
struct TLV_Parameter_Type *tlv);
extern int eigrp_network_set(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 int eigrp_if_add_allspfrouters(struct eigrp *, struct prefix *,
unsigned int);
return 1;
}
-void eigrp_write(struct thread *thread)
+void eigrp_write(struct event *thread)
{
struct eigrp *eigrp = THREAD_ARG(thread);
struct eigrp_header *eigrph;
}
/* Starting point of packet process function. */
-void eigrp_read(struct thread *thread)
+void eigrp_read(struct event *thread)
{
int ret;
struct stream *ibuf;
return 0;
}
-void eigrp_unack_packet_retrans(struct thread *thread)
+void eigrp_unack_packet_retrans(struct event *thread)
{
struct eigrp_neighbor *nbr;
nbr = (struct eigrp_neighbor *)THREAD_ARG(thread);
}
}
-void eigrp_unack_multicast_packet_retrans(struct thread *thread)
+void eigrp_unack_multicast_packet_retrans(struct event *thread)
{
struct eigrp_neighbor *nbr;
nbr = (struct eigrp_neighbor *)THREAD_ARG(thread);
#define _ZEBRA_EIGRP_PACKET_H
/*Prototypes*/
-extern void eigrp_read(struct thread *thread);
-extern void eigrp_write(struct thread *thread);
+extern void eigrp_read(struct event *thread);
+extern void eigrp_write(struct event *thread);
extern struct eigrp_packet *eigrp_packet_new(size_t size,
struct eigrp_neighbor *nbr);
extern uint16_t eigrp_add_authTLV_SHA256_to_stream(struct stream *s,
struct eigrp_interface *ei);
-extern void eigrp_unack_packet_retrans(struct thread *thread);
-extern void eigrp_unack_multicast_packet_retrans(struct thread *thread);
+extern void eigrp_unack_packet_retrans(struct event *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
extern void eigrp_hello_receive(struct eigrp *eigrp, struct ip *iph,
struct eigrp_header *eigrph, struct stream *s,
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
struct eigrp_interface *exception);
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_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,
enum GR_type gr_type, struct vty *vty);
extern void eigrp_update_send_interface_GR(struct eigrp_interface *ei,
struct list *oi_write_q;
/*Threads*/
- struct thread *t_write;
- struct thread *t_read;
- struct thread *t_distribute; /* timer for distribute list */
+ struct event *t_write;
+ struct event *t_read;
+ struct event *t_distribute; /* timer for distribute list */
struct route_table *networks; /* EIGRP config networks. */
struct list *nbrs; /* EIGRP Neighbor List */
/* Threads. */
- struct thread *t_hello; /* timer */
- struct thread *t_distribute; /* timer for distribute list */
+ struct event *t_hello; /* timer */
+ struct event *t_distribute; /* timer for distribute list */
int on_write_q;
uint16_t v_holddown;
/* Threads. */
- struct thread *t_holddown;
- struct thread *t_nbr_send_gr; /* thread for sending multiple GR packet
+ struct event *t_holddown;
+ struct event *t_nbr_send_gr; /* thread for sending multiple GR packet
chunks */
struct eigrp_fifo *retrans_queue;
struct in_addr dst;
/*Packet retransmission thread*/
- struct thread *t_retrans_timer;
+ struct event *t_retrans_timer;
/*Packet retransmission counter*/
uint8_t retrans_counter;
*
* 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;
enum fabricd_sync_state initial_sync_state;
time_t initial_sync_start;
struct isis_circuit *initial_sync_circuit;
- struct thread *initial_sync_timeout;
+ struct event *initial_sync_timeout;
struct isis_spftree *spftree;
struct skiplist *neighbors;
uint8_t tier;
uint8_t tier_config;
uint8_t tier_pending;
- struct thread *tier_calculation_timer;
- struct thread *tier_set_timer;
+ struct event *tier_calculation_timer;
+ struct event *tier_set_timer;
int csnp_delay;
bool always_send_csnp;
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);
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);
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);
uint8_t tier = ISIS_TIER_UNDEFINED;
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;
enum isis_threeway_state threeway_state;
uint32_t ext_circuit_id;
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 */
uint16_t *mt_set; /* Topologies this adjacency is valid for */
unsigned int mt_count; /* Number of entries in mt_set */
enum isis_adj_state state, const char *reason);
void isis_adj_print(struct isis_adjacency *adj);
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,
char detail);
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_up_list(struct list *adjdb, struct list *list);
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);
#endif /* ISIS_ADJACENCY_H */
struct isis_bcast_info {
uint8_t snpa[ETH_ALEN]; /* SNPA of this circuit */
char run_dr_elect[ISIS_LEVELS]; /* Should we run dr election ? */
- struct thread *t_run_dr[ISIS_LEVELS]; /* DR election thread */
- struct thread *t_send_lan_hello[ISIS_LEVELS]; /* send LAN IIHs in this
- thread */
+ struct event *t_run_dr[ISIS_LEVELS]; /* DR election thread */
+ struct event *t_send_lan_hello[ISIS_LEVELS]; /* send LAN IIHs in this
+ thread */
struct list *adjdb[ISIS_LEVELS]; /* adjacency dbs */
struct list *lan_neighs[ISIS_LEVELS]; /* list of lx neigh snpa */
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 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 */
};
struct isis_p2p_info {
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 {
/*
* Threads
*/
- struct thread *t_read;
- struct thread *t_send_csnp[ISIS_LEVELS];
- struct thread *t_send_psnp[ISIS_LEVELS];
+ struct event *t_read;
+ struct event *t_send_csnp[ISIS_LEVELS];
+ struct event *t_send_psnp[ISIS_LEVELS];
struct isis_tx_queue *tx_queue;
struct isis_circuit_arg
level_arg[ISIS_LEVELS]; /* used as argument for threads */
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);
#ifndef _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_resign(struct isis_circuit *circuit, int level);
int isis_dr_commence(struct isis_circuit *circuit, int level);
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)
{
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 isis_dynhn *dyn;
/* 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;
/*
* Events related to adjacencies
*/
-void isis_event_dis_status_change(struct thread *thread);
+void isis_event_dis_status_change(struct event *thread);
/*
* Error events
/*
* 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 ldp_sync_info *ldp_sync_info;
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);
DEFINE_MTYPE_STATIC(ISISD, ISIS_LSP, "ISIS LSP");
-static void lsp_refresh(struct thread *thread);
-static void lsp_l1_refresh_pseudo(struct thread *thread);
-static void lsp_l2_refresh_pseudo(struct thread *thread);
+static void lsp_refresh(struct event *thread);
+static void lsp_l1_refresh_pseudo(struct event *thread);
+static void lsp_l2_refresh_pseudo(struct event *thread);
static void lsp_destroy(struct isis_lsp *lsp);
/*
* 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);
assert(area);
/*
* 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);
/*
* 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;
uint8_t id[ISIS_SYS_ID_LEN + 2];
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;
uint8_t id[ISIS_SYS_ID_LEN + 2];
* Walk through LSPs for an area
* - set remaining lifetime
*/
-void lsp_tick(struct thread *thread)
+void lsp_tick(struct event *thread)
{
struct isis_area *area;
struct isis_lsp *lsp;
void lsp_db_init(struct lspdb_head *head);
void lsp_db_fini(struct lspdb_head *head);
-void lsp_tick(struct thread *thread);
-void set_overload_on_start_timer(struct thread *thread);
+void lsp_tick(struct event *thread);
+void set_overload_on_start_timer(struct event *thread);
int lsp_generate(struct isis_area *area, int level);
#define lsp_regenerate_schedule(area, level, all_pseudo) \
/* clang-format on */
-static void isis_config_finish(struct thread *t)
+static void isis_config_finish(struct event *t)
{
struct listnode *node, *inode;
struct isis *isis;
return retval;
}
-void isis_receive(struct thread *thread)
+void isis_receive(struct event *thread)
{
struct isis_circuit *circuit;
uint8_t ssnpa[ETH_ALEN];
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);
assert(arg);
}
static void _send_hello_sched(struct isis_circuit *circuit,
- struct thread **threadp,
- int level, long delay)
+ struct event **threadp, int level, long delay)
{
if (*threadp) {
if (thread_timer_remain_msec(*threadp) < (unsigned long)delay)
return ISIS_OK;
}
-void send_l1_csnp(struct thread *thread)
+void send_l1_csnp(struct event *thread)
{
struct isis_circuit *circuit;
&circuit->t_send_csnp[0]);
}
-void send_l2_csnp(struct thread *thread)
+void send_l2_csnp(struct event *thread)
{
struct isis_circuit *circuit;
return ISIS_OK;
}
-void send_l1_psnp(struct thread *thread)
+void send_l1_psnp(struct event *thread)
{
struct isis_circuit *circuit;
* 7.3.15.4 action on expiration of partial SNP interval
* level 2
*/
-void send_l2_psnp(struct thread *thread)
+void send_l2_psnp(struct event *thread)
{
struct isis_circuit *circuit;
/*
* Function for receiving IS-IS PDUs
*/
-void isis_receive(struct thread *thread);
+void isis_receive(struct event *thread);
/*
* calling arguments for snp_process ()
*/
void send_hello_sched(struct isis_circuit *circuit, int level, long delay);
int send_csnp(struct isis_circuit *circuit, int level);
-void send_l1_csnp(struct thread *thread);
-void send_l2_csnp(struct thread *thread);
-void send_l1_psnp(struct thread *thread);
-void send_l2_psnp(struct thread *thread);
+void send_l1_csnp(struct event *thread);
+void send_l2_csnp(struct event *thread);
+void send_l1_psnp(struct event *thread);
+void send_l2_psnp(struct event *thread);
void send_lsp(struct isis_circuit *circuit,
struct isis_lsp *lsp, enum isis_tx_type tx_type);
void fill_fixed_hdr(uint8_t pdu_type, struct stream *stream);
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_area *area = run->area;
*
* @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;
bool enabled;
/* Thread timer to start Label Manager */
- struct thread *t_start_lm;
+ struct event *t_start_lm;
/* List of local Adjacency-SIDs. */
struct list *adj_sids;
struct isis_lsp *lsp;
enum isis_tx_type type;
bool is_retry;
- struct thread *retry;
+ struct event *retry;
struct isis_tx_queue *queue;
};
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 *queue = e->queue;
struct isis_master *im;
/* ISIS config processing thread */
-struct thread *t_isis_cfg;
+struct event *t_isis_cfg;
#ifndef FABRICD
DEFINE_HOOK(isis_hook_db_overload, (const struct isis_area *area), (area));
uint8_t max_area_addrs; /* maximumAreaAdresses */
struct area_addr *man_area_addrs; /* manualAreaAddresses */
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 */
int snmp_notifications;
struct list *dyn_cache;
extern struct isis_master *im;
-extern struct thread *t_isis_cfg;
+extern struct event *t_isis_cfg;
enum spf_tree_id {
SPFTREE_IPV4 = 0,
struct list *circuit_list; /* IS-IS circuits */
struct list *adjacency_list; /* IS-IS adjacencies */
struct flags flags;
- struct thread *t_tick; /* LSP walker */
- struct thread *t_lsp_refresh[ISIS_LEVELS];
- struct thread *t_overload_on_startup_timer;
+ struct event *t_tick; /* LSP walker */
+ struct event *t_lsp_refresh[ISIS_LEVELS];
+ struct event *t_overload_on_startup_timer;
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:
* a) regular refresh of LSPs
* b) (possibly throttled) updates to LSPs
struct spf_backoff *spf_delay_ietf[ISIS_LEVELS]; /*Structure with IETF
SPF algo
parameters*/
- struct thread *spf_timer[ISIS_LEVELS];
+ struct event *spf_timer[ISIS_LEVELS];
struct lsp_refresh_arg lsp_refresh_arg[ISIS_LEVELS];
struct accept_ev {
LIST_ENTRY(accept_ev) entry;
- struct thread *ev;
- void (*accept_cb)(struct thread *);
+ struct event *ev;
+ void (*accept_cb)(struct event *);
void *arg;
int fd;
};
struct {
LIST_HEAD(, accept_ev) queue;
- struct thread *evt;
+ struct event *evt;
} accept_queue;
static void accept_arm(void);
static void accept_unarm(void);
-static void accept_cb(struct thread *);
-static void accept_timeout(struct thread *);
+static void accept_cb(struct event *);
+static void accept_timeout(struct event *);
void
accept_init(void)
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;
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);
thread_add_read(master, accept_cb, av, av->fd, &av->ev);
av->accept_cb(thread);
}
-static void accept_timeout(struct thread *thread)
+static void accept_timeout(struct event *thread)
{
accept_queue.evt = NULL;
#include "log.h"
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 void tnbr_del(struct ldpd_conf *, struct tnbr *);
static void tnbr_start(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_stop_hello_timer(struct tnbr *);
/* adjacency timers */
/* ARGSUSED */
-static void adj_itimer(struct thread *thread)
+static void adj_itimer(struct event *thread)
{
struct adj *adj = THREAD_ARG(thread);
/* target neighbors timers */
/* ARGSUSED */
-static void tnbr_hello_timer(struct thread *thread)
+static void tnbr_hello_timer(struct event *thread)
{
struct tnbr *tnbr = THREAD_ARG(thread);
#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_connbypid(pid_t);
static void control_close(int);
-static void control_dispatch_imsg(struct thread *);
+static void control_dispatch_imsg(struct event *);
struct ctl_conns ctl_conns;
}
/* ARGSUSED */
-static void control_accept(struct thread *thread)
+static void control_accept(struct event *thread)
{
int connfd;
socklen_t len;
}
/* ARGSUSED */
-static void control_dispatch_imsg(struct thread *thread)
+static void control_dispatch_imsg(struct event *thread)
{
int fd = THREAD_FD(thread);
struct ctl_conn *c;
static int if_start(struct iface *, int);
static int if_reset(struct iface *, int);
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_stop_hello_timer(struct iface_af *);
static int if_join_ipv4_group(struct iface *, struct in_addr *);
static int ldp_sync_fsm_init(struct iface *iface, int state);
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 stop_wait_for_ldp_sync_timer(struct iface *iface);
static int ldp_sync_act_ldp_start_sync(struct iface *iface);
/* timers */
/* ARGSUSED */
-static void if_hello_timer(struct thread *thread)
+static void if_hello_timer(struct event *thread)
{
struct iface_af *ia = THREAD_ARG(thread);
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);
#include "libfrr.h"
static void lde_shutdown(void);
-static void lde_dispatch_imsg(struct thread *thread);
-static void lde_dispatch_parent(struct thread *thread);
+static void lde_dispatch_imsg(struct event *thread);
+static void lde_dispatch_parent(struct event *thread);
static __inline int lde_nbr_compare(const struct lde_nbr *,
const struct lde_nbr *);
static struct lde_nbr *lde_nbr_new(uint32_t, struct lde_nbr *);
/* create base configuration */
ldeconf = config_new_empty();
- struct thread thread;
+ struct event thread;
while (thread_fetch(master, &thread))
thread_call(&thread);
}
/* ARGSUSED */
-static void lde_dispatch_imsg(struct thread *thread)
+static void lde_dispatch_imsg(struct event *thread)
{
struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf;
}
/* ARGSUSED */
-static void lde_dispatch_parent(struct thread *thread)
+static void lde_dispatch_parent(struct event *thread)
{
static struct ldpd_conf *nconf;
struct iface *iface, *niface;
/*
* 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();
}
extern struct ldpd_conf *ldeconf;
extern struct fec_tree ft;
extern struct nbr_tree lde_nbrs;
-extern struct thread *gc_timer;
+extern struct event *gc_timer;
/* lde.c */
void lde(void);
void lde_check_withdraw_wcard(struct map *, struct lde_nbr *);
int lde_wildcard_apply(struct map *, struct fec *,
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_stop_timer(void);
RB_GENERATE(fec_tree, fec, entry, fec_compare)
struct fec_tree ft = RB_INITIALIZER(&ft);
-struct thread *gc_timer;
+struct event *gc_timer;
/* FEC tree functions */
void
/* gabage collector timer: timer to remove dead entries from the LIB */
/* ARGSUSED */
-void lde_gc_timer(struct thread *thread)
+void lde_gc_timer(struct event *thread)
{
struct fec *fec, *safe;
struct fec_node *fn;
static void ldpd_shutdown(void);
static pid_t start_child(enum ldpd_process, char *, int, int);
-static void main_dispatch_ldpe(struct thread *thread);
-static void main_dispatch_lde(struct thread *thread);
+static void main_dispatch_ldpe(struct event *thread);
+static void main_dispatch_lde(struct event *thread);
static int main_imsg_send_ipc_sockets(struct imsgbuf *,
struct imsgbuf *);
static void main_imsg_send_net_sockets(int);
.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
/* imsg handling */
/* ARGSUSED */
-static void main_dispatch_ldpe(struct thread *thread)
+static void main_dispatch_ldpe(struct event *thread)
{
struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf;
}
/* ARGSUSED */
-static void main_dispatch_lde(struct thread *thread)
+static void main_dispatch_lde(struct event *thread)
{
struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf;
}
/* ARGSUSED */
-void ldp_write_handler(struct thread *thread)
+void ldp_write_handler(struct event *thread)
{
struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf;
&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)
{
msgbuf_init(&eb->wbuf);
struct evbuf {
struct msgbuf wbuf;
- struct thread *ev;
- void (*handler)(struct thread *);
+ struct event *ev;
+ void (*handler)(struct event *);
void *arg;
};
struct imsgev {
struct imsgbuf ibuf;
- void (*handler_write)(struct thread *);
- struct thread *ev_write;
- void (*handler_read)(struct thread *);
- struct thread *ev_read;
+ void (*handler_write)(struct event *);
+ struct event *ev_write;
+ void (*handler_read)(struct event *);
+ struct event *ev_read;
};
enum imsg_type {
int state;
struct ia_adj_head adj_tree;
time_t uptime;
- struct thread *hello_timer;
+ struct event *hello_timer;
uint16_t hello_holdtime;
uint16_t hello_interval;
};
struct iface_ldp_sync {
int state;
- struct thread *wait_for_sync_timer;
+ struct event *wait_for_sync_timer;
};
struct iface {
/* source of targeted hellos */
struct tnbr {
RB_ENTRY(tnbr) entry;
- struct thread *hello_timer;
+ struct event *hello_timer;
struct adj *adj;
int af;
union ldpd_addr addr;
#define F_LDPD_ALLOW_BROKEN_LSP 0x0010
struct ldpd_af_global {
- struct thread *disc_ev;
- struct thread *edisc_ev;
+ struct event *disc_ev;
+ struct event *edisc_ev;
int ldp_disc_socket;
int ldp_edisc_socket;
int ldp_session_socket;
socklen_t sockaddr_len(struct sockaddr *);
/* 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_lde(int, pid_t, void *, uint16_t);
int main_imsg_compose_both(enum imsg_type, void *,
pid_t, int, void *, uint16_t);
void evbuf_enqueue(struct evbuf *, struct ibuf *);
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 *);
int ldp_acl_request(struct imsgev *, char *, int,
union ldpd_addr *, uint8_t);
#include "libfrr.h"
static void ldpe_shutdown(void);
-static void ldpe_dispatch_main(struct thread *thread);
-static void ldpe_dispatch_lde(struct thread *thread);
+static void ldpe_dispatch_main(struct event *thread);
+static void ldpe_dispatch_lde(struct event *thread);
#ifdef __OpenBSD__
-static void ldpe_dispatch_pfkey(struct thread *thread);
+static void ldpe_dispatch_pfkey(struct event *thread);
#endif
static void ldpe_setup_sockets(int, int, int, int);
static void ldpe_close_sockets(int);
static struct imsgev *iev_main, *iev_main_sync;
static struct imsgev *iev_lde;
#ifdef __OpenBSD__
-static struct thread *pfkey_ev;
+static struct event *pfkey_ev;
#endif
/* ldpe privileges */
/* create base configuration */
leconf = config_new_empty();
- struct thread thread;
+ struct event thread;
while (thread_fetch(master, &thread))
thread_call(&thread);
}
/* ARGSUSED */
-static void ldpe_dispatch_main(struct thread *thread)
+static void ldpe_dispatch_main(struct event *thread)
{
static struct ldpd_conf *nconf;
struct iface *niface;
}
/* ARGSUSED */
-static void ldpe_dispatch_lde(struct thread *thread)
+static void ldpe_dispatch_lde(struct event *thread)
{
struct imsgev *iev = THREAD_ARG(thread);
struct imsgbuf *ibuf = &iev->ibuf;
#ifdef __OpenBSD__
/* ARGSUSED */
-static void ldpe_dispatch_pfkey(struct thread *thread)
+static void ldpe_dispatch_pfkey(struct event *thread)
{
int fd = THREAD_FD(thread);
struct nbr *nbr;
int ds_tlv;
struct hello_source source;
- struct thread *inactivity_timer;
+ struct event *inactivity_timer;
uint16_t holdtime;
union ldpd_addr trans_addr;
};
int fd;
struct ibuf_read *rbuf;
struct evbuf wbuf;
- struct thread *rev;
+ struct event *rev;
in_port_t lport;
in_port_t rport;
};
RB_ENTRY(nbr) id_tree, addr_tree, pid_tree;
struct tcp_conn *tcp;
struct nbr_adj_head adj_tree; /* adjacencies */
- struct thread *ev_connect;
- struct thread *keepalive_timer;
- struct thread *keepalive_timeout;
- struct thread *init_timeout;
- struct thread *initdelay_timer;
+ struct event *ev_connect;
+ struct event *keepalive_timer;
+ struct event *keepalive_timeout;
+ struct event *init_timeout;
+ struct event *initdelay_timer;
struct mapping_head mapping_list;
struct mapping_head withdraw_list;
int fd;
int af;
union ldpd_addr addr;
- struct thread *ev_timeout;
+ struct event *ev_timeout;
};
#define PENDING_CONN_TIMEOUT 5
/* accept.c */
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_pause(void);
void accept_unpause(void);
int gen_msg_hdr(struct ibuf *, uint16_t, uint16_t);
int send_packet(int, int, union ldpd_addr *,
struct iface_af *, void *, size_t);
-void disc_recv_packet(struct thread *thread);
-void session_accept(struct thread *thread);
+void disc_recv_packet(struct event *thread);
+void session_accept(struct event *thread);
void session_accept_nbr(struct nbr *, int);
void session_shutdown(struct nbr *, uint32_t, uint32_t,
uint32_t);
static __inline int nbr_pid_compare(const struct nbr *,
const 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_ktimeout(struct thread *thread);
+static void nbr_ktimeout(struct event *thread);
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_idtimer(struct thread *thread);
+static void nbr_idtimer(struct event *thread);
static int nbr_act_session_operational(struct nbr *);
static void nbr_send_labelmappings(struct nbr *);
static __inline int nbr_params_compare(const struct nbr_params *,
/* 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);
/* 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);
/* 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);
/* 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);
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);
int error;
static struct iface *disc_find_iface(unsigned int, int,
union ldpd_addr *);
-static void session_read(struct thread *thread);
-static void session_write(struct thread *thread);
+static void session_read(struct event *thread);
+static void session_write(struct event *thread);
static ssize_t session_get_pdu(struct ibuf_read *, char **);
static void tcp_close(struct tcp_conn *);
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
gen_ldp_hdr(struct ibuf *buf, uint16_t size)
}
/* Discovery functions */
-void disc_recv_packet(struct thread *thread)
+void disc_recv_packet(struct event *thread)
{
int fd = THREAD_FD(thread);
- struct thread **threadp = THREAD_ARG(thread);
+ struct event **threadp = THREAD_ARG(thread);
union {
struct cmsghdr hdr;
return (iface);
}
-void session_accept(struct thread *thread)
+void session_accept(struct event *thread)
{
int fd = THREAD_FD(thread);
struct sockaddr_storage src;
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);
struct nbr *nbr = THREAD_ARG(thread);
free(buf);
}
-static void session_write(struct thread *thread)
+static void session_write(struct event *thread)
{
struct tcp_conn *tcp = THREAD_ARG(thread);
struct nbr *nbr = tcp->nbr;
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 tcp_conn *tcp;
static bool agentx_enabled = false;
static struct thread_master *agentx_tm;
-static struct thread *timeout_thr = NULL;
+static struct event *timeout_thr = NULL;
static struct list *events = NULL;
static void agentx_events_update(void);
-static void agentx_timeout(struct thread *t)
+static void agentx_timeout(struct event *t)
{
snmp_timeout();
run_alarms();
agentx_events_update();
}
-static void agentx_read(struct thread *t)
+static void agentx_read(struct event *t)
{
fd_set fds;
int flags, new_flags = 0;
int nonblock = false;
struct listnode *ln = THREAD_ARG(t);
- struct thread **thr = listgetdata(ln);
+ struct event **thr = listgetdata(ln);
XFREE(MTYPE_TMP, thr);
list_delete_node(events, ln);
struct timeval timeout = {.tv_sec = 0, .tv_usec = 0};
fd_set fds;
struct listnode *ln;
- struct thread **thr;
+ struct event **thr;
int fd, thr_fd;
thread_cancel(&timeout_thr);
/* need listener, but haven't hit one where it would be */
else if (FD_ISSET(fd, &fds)) {
struct listnode *newln;
- thr = XCALLOC(MTYPE_TMP, sizeof(struct thread *));
+ thr = XCALLOC(MTYPE_TMP, sizeof(struct event *));
newln = listnode_add_before(events, ln, thr);
thread_add_read(agentx_tm, agentx_read, newln, fd, thr);
}
* configuration load or northbound batch), so we'll use this to
* install/uninstall the BFD session parameters only once.
*/
- struct thread *installev;
+ struct event *installev;
/** BFD session installation state. */
bool installed;
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);
int rv;
DEFINE_MTYPE_STATIC(LIB, THREAD_POLL, "Thread Poll Info");
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 {
int flags;
- struct thread *thread;
+ struct event *thread;
void *eventobj;
- struct thread **threadref;
+ struct event **threadref;
};
/* Flags for task cancellation */
#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)
return -1;
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__)
#include <mach/mach.h>
static pthread_mutex_t masters_mtx = PTHREAD_MUTEX_INITIALIZER;
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
#define EXCLUDE_CPU_TIME 0
{
const char *name = m->name ? m->name : "main";
char underline[strlen(name) + 1];
- struct thread *thread;
+ struct event *thread;
uint32_t i;
memset(underline, '-', sizeof(underline));
{
const char *name = m->name ? m->name : "main";
char underline[strlen(name) + 1];
- struct thread *thread;
+ struct event *thread;
memset(underline, '-', sizeof(underline));
underline[sizeof(underline) - 1] = '\0';
}
rv->read = XCALLOC(MTYPE_THREAD_POLL,
- sizeof(struct thread *) * rv->fd_limit);
+ sizeof(struct event *) * rv->fd_limit);
rv->write = XCALLOC(MTYPE_THREAD_POLL,
- sizeof(struct thread *) * rv->fd_limit);
+ sizeof(struct event *) * rv->fd_limit);
char tmhashname[strlen(name) + 32];
snprintf(tmhashname, sizeof(tmhashname), "%s - threadmaster event hash",
#define THREAD_UNUSED_DEPTH 10
/* 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;
assert(m != NULL && thread != NULL);
thread->hist->total_active--;
- memset(thread, 0, sizeof(struct thread));
+ memset(thread, 0, sizeof(struct event));
thread->type = THREAD_UNUSED;
/* Restore the thread mutex context. */
static void thread_list_free(struct thread_master *m,
struct thread_list_head *list)
{
- struct thread *t;
+ struct event *t;
while ((t = thread_list_pop(list)))
thread_free(m, t);
}
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;
for (index = 0; index < m->fd_limit; ++index) {
void thread_master_free_unused(struct thread_master *m)
{
frr_with_mutex (&m->mtx) {
- struct thread *t;
+ struct event *t;
while ((t = thread_list_pop(&m->unuse)))
thread_free(m, t);
}
/* Stop thread scheduler. */
void thread_master_free(struct thread_master *m)
{
- struct thread *t;
+ struct event *t;
frr_with_mutex (&masters_mtx) {
listnode_delete(masters, m);
}
/* 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;
}
/* 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;
}
-struct timeval thread_timer_remain(struct thread *thread)
+struct timeval thread_timer_remain(struct event *thread)
{
struct timeval remain;
frr_with_mutex (&thread->mtx) {
return wr != 8;
}
-char *thread_timer_to_hhmmss(char *buf, int buf_size,
- struct thread *t_timer)
+char *thread_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
{
if (t_timer) {
time_hhmmss(buf, buf_size,
}
/* Get new thread. */
-static struct thread *thread_get(struct thread_master *m, uint8_t type,
- void (*func)(struct thread *), void *arg,
- const struct xref_threadsched *xref)
+static struct event *thread_get(struct thread_master *m, uint8_t type,
+ void (*func)(struct event *), void *arg,
+ 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;
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. */
pthread_mutex_init(&thread->mtx, NULL);
m->alloc++;
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. */
assert(master->alloc > 0);
/* Add new read thread. */
void _thread_add_read_write(const struct xref_threadsched *xref,
struct thread_master *m,
- void (*func)(struct thread *), void *arg, int fd,
- struct thread **t_ptr)
+ void (*func)(struct event *), void *arg, int fd,
+ struct event **t_ptr)
{
int dir = xref->thread_type;
- struct thread *thread = NULL;
- struct thread **thread_array;
+ struct event *thread = NULL;
+ struct event **thread_array;
if (dir == THREAD_READ)
frrtrace(9, frr_libfrr, schedule_read, m,
static void _thread_add_timer_timeval(const struct xref_threadsched *xref,
struct thread_master *m,
- void (*func)(struct thread *), void *arg,
+ void (*func)(struct event *), void *arg,
struct timeval *time_relative,
- struct thread **t_ptr)
+ struct event **t_ptr)
{
- struct thread *thread;
+ struct event *thread;
struct timeval t;
assert(m != NULL);
/* Add timer event thread. */
void _thread_add_timer(const struct xref_threadsched *xref,
- struct thread_master *m, void (*func)(struct thread *),
- void *arg, long timer, struct thread **t_ptr)
+ struct thread_master *m, void (*func)(struct event *),
+ void *arg, long timer, struct event **t_ptr)
{
struct timeval trel;
/* Add timer event thread with "millisecond" resolution */
void _thread_add_timer_msec(const struct xref_threadsched *xref,
struct thread_master *m,
- void (*func)(struct thread *), void *arg,
- long timer, struct thread **t_ptr)
+ void (*func)(struct event *), void *arg, long timer,
+ struct event **t_ptr)
{
struct timeval trel;
/* Add timer event thread with "timeval" resolution */
void _thread_add_timer_tv(const struct xref_threadsched *xref,
- struct thread_master *m,
- void (*func)(struct thread *), void *arg,
- struct timeval *tv, struct thread **t_ptr)
+ struct thread_master *m, void (*func)(struct event *),
+ void *arg, struct timeval *tv, struct event **t_ptr)
{
_thread_add_timer_timeval(xref, m, func, arg, tv, t_ptr);
}
/* Add simple event thread. */
void _thread_add_event(const struct xref_threadsched *xref,
- struct thread_master *m, void (*func)(struct thread *),
- void *arg, int val, struct thread **t_ptr)
+ struct thread_master *m, void (*func)(struct event *),
+ void *arg, int val, struct event **t_ptr)
{
- struct thread *thread = NULL;
+ struct event *thread = NULL;
frrtrace(9, frr_libfrr, schedule_event, m,
xref->funcname, xref->xref.file, xref->xref.line,
static void cancel_arg_helper(struct thread_master *master,
const struct cancel_req *cr)
{
- struct thread *t;
+ struct event *t;
nfds_t i;
int fd;
struct pollfd *pfd;
/* Check the timer tasks */
t = thread_timer_list_first(&master->timer);
while (t) {
- struct thread *t_next;
+ struct event *t_next;
t_next = thread_timer_list_next(&master->timer, t);
static void do_thread_cancel(struct thread_master *master)
{
struct thread_list_head *list = NULL;
- struct thread **thread_array = NULL;
- struct thread *thread;
+ struct event **thread_array = NULL;
+ struct event *thread;
struct cancel_req *cr;
struct listnode *ln;
*
* @param thread task to cancel
*/
-void thread_cancel(struct thread **thread)
+void thread_cancel(struct event **thread)
{
struct thread_master *master;
/**
* 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
* serviced.
*
* @param thread pointer to thread to cancel
* @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)
{
assert(!(thread && eventobj) && (thread || eventobj));
if (!thread_timer_list_count(timers))
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);
return timer_val;
}
-static struct thread *thread_run(struct thread_master *m, struct thread *thread,
- struct thread *fetch)
+static struct event *thread_run(struct thread_master *m, struct event *thread,
+ struct event *fetch)
{
*fetch = *thread;
thread_add_unuse(m, thread);
}
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)
{
- struct thread **thread_array;
+ struct event **thread_array;
/*
* poll() clears the .events field, but the pollfd array we
{
struct timeval prev = *timenow;
bool displayed = false;
- struct thread *thread;
+ struct event *thread;
unsigned int ready = 0;
while ((thread = thread_timer_list_first(&m->timer))) {
/* process a list en masse, e.g. for event thread lists */
static unsigned int thread_process(struct thread_list_head *list)
{
- struct thread *thread;
+ struct event *thread;
unsigned int ready = 0;
while ((thread = thread_list_pop(list))) {
/* 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 zerotime = {0, 0};
struct timeval tv;
for CPU time. On balance, wall clock time seems to make sense.
Plus it has the added benefit that gettimeofday should be faster
than calling getrusage. */
-int thread_should_yield(struct thread *thread)
+int thread_should_yield(struct event *thread)
{
int result;
frr_with_mutex (&thread->mtx) {
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) {
thread->yield = yield_time;
* particular, the maximum real and cpu times must be monotonically increasing
* or this code is not correct.
*/
-void thread_call(struct thread *thread)
+void thread_call(struct event *thread)
{
RUSAGE_T before, after;
/* Execute thread */
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)
{
- struct thread *thread;
+ struct event *thread;
/* Get or allocate new thread to execute. */
frr_with_mutex (&m->mtx) {
}
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[] = {
[THREAD_READ] = "read",
static ssize_t printfrr_thread(struct fbuf *buf, struct printfrr_eargs *ea,
const void *ptr)
{
- const struct thread *thread = ptr;
+ const struct event *thread = ptr;
struct timespec remain = {};
if (ea->fmt[0] == 'D') {
struct thread_master {
char *name;
- struct thread **read;
- struct thread **write;
+ struct event **read;
+ struct event **write;
struct thread_timer_list_head timer;
struct thread_list_head event, ready, unuse;
struct list *cancel_req;
};
/* Thread itself. */
-struct thread {
+struct event {
uint8_t type; /* thread type */
uint8_t add_type; /* thread type */
struct thread_list_item threaditem;
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 */
- void (*func)(struct thread *); /* event function */
+ void (*func)(struct event *); /* event function */
void *arg; /* event argument */
union {
int val; /* second argument of the event. */
};
#ifdef _FRR_ATTRIBUTE_PRINTFRR
-#pragma FRR printfrr_ext "%pTH" (struct thread *)
+#pragma FRR printfrr_ext "%pTH"(struct event *)
#endif
struct cpu_thread_history {
- void (*func)(struct thread *);
+ void (*func)(struct event *);
atomic_size_t total_cpu_warn;
atomic_size_t total_wall_warn;
atomic_size_t total_starv_warn;
extern void _thread_add_read_write(const struct xref_threadsched *xref,
struct thread_master *master,
- void (*fn)(struct thread *), void *arg,
- int fd, struct thread **tref);
+ void (*fn)(struct event *), void *arg,
+ int fd, struct event **tref);
extern void _thread_add_timer(const struct xref_threadsched *xref,
struct thread_master *master,
- void (*fn)(struct thread *), void *arg, long t,
- struct thread **tref);
+ void (*fn)(struct event *), void *arg, long t,
+ struct event **tref);
extern void _thread_add_timer_msec(const struct xref_threadsched *xref,
struct thread_master *master,
- void (*fn)(struct thread *), void *arg,
- long t, struct thread **tref);
+ void (*fn)(struct event *), void *arg,
+ long t, struct event **tref);
extern void _thread_add_timer_tv(const struct xref_threadsched *xref,
struct thread_master *master,
- void (*fn)(struct thread *), void *arg,
- struct timeval *tv, struct thread **tref);
+ void (*fn)(struct event *), void *arg,
+ struct timeval *tv, struct event **tref);
extern void _thread_add_event(const struct xref_threadsched *xref,
struct thread_master *master,
- void (*fn)(struct thread *), void *arg, int val,
- struct thread **tref);
+ void (*fn)(struct event *), void *arg, int val,
+ struct event **tref);
extern void _thread_execute(const struct xref_threadsched *xref,
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_async(struct thread_master *, struct thread **,
+extern void thread_cancel(struct event **event);
+extern void thread_cancel_async(struct thread_master *, struct event **,
void *);
/* Cancel ready tasks with an arg matching '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 */
extern void thread_cancel_event(struct thread_master *m, void *arg);
-extern struct thread *thread_fetch(struct thread_master *, struct thread *);
-extern void thread_call(struct thread *);
-extern unsigned long thread_timer_remain_second(struct thread *);
-extern struct timeval thread_timer_remain(struct thread *);
-extern unsigned long thread_timer_remain_msec(struct thread *);
-extern int thread_should_yield(struct thread *);
+extern struct event *thread_fetch(struct thread_master *, struct event *event);
+extern void thread_call(struct event *event);
+extern unsigned long thread_timer_remain_second(struct event *event);
+extern struct timeval thread_timer_remain(struct event *event);
+extern unsigned long thread_timer_remain_msec(struct event *event);
+extern int thread_should_yield(struct event *event);
/* 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 */
extern void thread_getrusage(RUSAGE_T *);
/* only for use in logging functions! */
extern pthread_key_t thread_current;
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)
return true;
/* Debug signal mask */
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
*/
/* 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 */
-static void fpt_finish(struct thread *thread)
+static void fpt_finish(struct event *thread)
{
struct frr_pthread *fpt = THREAD_ARG(thread);
frr_pthread_notify_running(fpt);
- struct thread task;
+ struct event task;
while (atomic_load_explicit(&fpt->running, memory_order_relaxed)) {
pthread_testcancel();
if (thread_fetch(fpt->master, &task)) {
}
}
-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 *cb;
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 *cb;
/* callback integration */
struct cb_core {
- struct thread *thread;
+ struct event *thread;
void *arg;
bool cancelled;
int main(int argc, char **argv)
{
- struct thread thread;
+ struct event event;
master = thread_master_create(NULL);
vty_stdio(vty_do_exit);
/* Fetch next active thread. */
- while (thread_fetch(master, &thread))
- thread_call(&thread);
+ while (thread_fetch(master, &event))
+ thread_call(&event);
/* Not reached. */
exit(0);
uint8_t enabled; /* enabled */
uint8_t state; /* running state */
uint16_t holddown; /* timer value */
- struct thread *t_holddown; /* holddown timer*/
+ struct event *t_holddown; /* holddown timer*/
uint32_t metric[2]; /* isis interface metric */
};
* to read the config in after thread execution starts, so that
* we can match this behavior.
*/
-static void frr_config_read_in(struct thread *t)
+static void frr_config_read_in(struct event *t)
{
hook_call(frr_config_pre, master);
}
}
-static struct thread *daemon_ctl_thread = NULL;
+static struct event *daemon_ctl_thread = NULL;
-static void frr_daemon_ctl(struct thread *t)
+static void frr_daemon_ctl(struct event *t)
{
char buf[1];
ssize_t nr;
/* end fixed stderr startup logging */
zlog_startup_end();
- struct thread thread;
+ struct event thread;
while (thread_fetch(master, &thread))
thread_call(&thread);
}
bool terminal;
enum frr_cli_mode cli_mode;
- struct thread *read_in;
+ struct event *read_in;
const char *config_file;
const char *backup_config_file;
const char *pid_file;
#define THREAD_SCHEDULE_ARGS \
TP_ARGS(struct thread_master *, master, const char *, funcname, \
- const char *, schedfrom, int, fromln, struct thread **, \
+ const char *, schedfrom, int, fromln, struct event **, \
thread_ptr, int, fd, int, val, void *, arg, long, time)
TRACEPOINT_EVENT_CLASS(
fb.pos = buf;
- struct thread *tc;
+ struct event *tc;
tc = pthread_getspecific(thread_current);
if (!tc)
void zlog_thread_info(int log_level)
{
- struct thread *tc;
+ struct event *tc;
tc = pthread_getspecific(thread_current);
if (tc)
struct mgmt_be_client_ctx {
int conn_fd;
struct thread_master *tm;
- struct thread *conn_retry_tmr;
- struct thread *conn_read_ev;
- struct thread *conn_write_ev;
- struct thread *conn_writes_on;
- struct thread *msg_proc_ev;
+ struct event *conn_retry_tmr;
+ struct event *conn_read_ev;
+ struct event *conn_write_ev;
+ struct event *conn_writes_on;
+ struct event *msg_proc_ev;
uint32_t flags;
struct mgmt_msg_state mstate;
mgmtd__be_message__free_unpacked(be_msg, NULL);
}
-static void mgmt_be_client_proc_msgbufs(struct thread *thread)
+static void mgmt_be_client_proc_msgbufs(struct event *thread)
{
struct mgmt_be_client_ctx *client_ctx = THREAD_ARG(thread);
mgmt_be_client_register_event(client_ctx, MGMTD_BE_PROC_MSG);
}
-static void mgmt_be_client_read(struct thread *thread)
+static void mgmt_be_client_read(struct event *thread)
{
struct mgmt_be_client_ctx *client_ctx = THREAD_ARG(thread);
enum mgmt_msg_rsched rv;
return rv;
}
-static void mgmt_be_client_write(struct thread *thread)
+static void mgmt_be_client_write(struct event *thread)
{
struct mgmt_be_client_ctx *client_ctx = THREAD_ARG(thread);
enum mgmt_msg_wsched rv;
assert(rv == MSW_SCHED_NONE);
}
-static void mgmt_be_client_resume_writes(struct thread *thread)
+static void mgmt_be_client_resume_writes(struct event *thread)
{
struct mgmt_be_client_ctx *client_ctx;
client_ctx->client_params.user_data, true);
}
-static void mgmt_be_client_conn_timeout(struct thread *thread)
+static void mgmt_be_client_conn_timeout(struct event *thread)
{
mgmt_be_server_connect(THREAD_ARG(thread));
}
struct mgmt_fe_client_ctx {
int conn_fd;
struct thread_master *tm;
- struct thread *conn_retry_tmr;
- struct thread *conn_read_ev;
- struct thread *conn_write_ev;
- struct thread *conn_writes_on;
- struct thread *msg_proc_ev;
+ struct event *conn_retry_tmr;
+ struct event *conn_read_ev;
+ struct event *conn_write_ev;
+ struct event *conn_writes_on;
+ struct event *msg_proc_ev;
uint32_t flags;
struct mgmt_msg_state mstate;
return rv;
}
-static void mgmt_fe_client_write(struct thread *thread)
+static void mgmt_fe_client_write(struct event *thread)
{
struct mgmt_fe_client_ctx *client_ctx;
enum mgmt_msg_wsched rv;
assert(rv == MSW_SCHED_NONE);
}
-static void mgmt_fe_client_resume_writes(struct thread *thread)
+static void mgmt_fe_client_resume_writes(struct event *thread)
{
struct mgmt_fe_client_ctx *client_ctx;
mgmtd__fe_message__free_unpacked(fe_msg, NULL);
}
-static void mgmt_fe_client_proc_msgbufs(struct thread *thread)
+static void mgmt_fe_client_proc_msgbufs(struct event *thread)
{
struct mgmt_fe_client_ctx *client_ctx;
mgmt_fe_client_register_event(client_ctx, MGMTD_FE_PROC_MSG);
}
-static void mgmt_fe_client_read(struct thread *thread)
+static void mgmt_fe_client_read(struct event *thread)
{
struct mgmt_fe_client_ctx *client_ctx;
enum mgmt_msg_rsched rv;
}
-static void mgmt_fe_client_conn_timeout(struct thread *thread)
+static void mgmt_fe_client_conn_timeout(struct event *thread)
{
mgmt_fe_server_connect(THREAD_ARG(thread));
}
return ret;
}
-static void nb_cli_confirmed_commit_timeout(struct thread *thread)
+static void nb_cli_confirmed_commit_timeout(struct event *thread)
{
struct vty *vty = THREAD_ARG(thread);
static struct thread_master *master;
static struct sockaddr confd_addr;
static int cdb_sub_sock, dp_ctl_sock, dp_worker_sock;
-static struct thread *t_cdb_sub, *t_dp_ctl, *t_dp_worker;
+static struct event *t_cdb_sub, *t_dp_ctl, *t_dp_worker;
static struct confd_daemon_ctx *dctx;
static struct confd_notification_ctx *live_ctx;
static bool confd_connected;
return 0;
}
-static void frr_confd_cdb_read_cb(struct thread *thread)
+static void frr_confd_cdb_read_cb(struct event *thread)
{
int fd = THREAD_FD(thread);
enum cdb_sub_notification cdb_ev;
return 0;
}
-static void frr_confd_dp_ctl_read(struct thread *thread)
+static void frr_confd_dp_ctl_read(struct event *thread)
{
struct confd_daemon_ctx *dctx = THREAD_ARG(thread);
int fd = THREAD_FD(thread);
frr_confd_dp_read(dctx, fd);
}
-static void frr_confd_dp_worker_read(struct thread *thread)
+static void frr_confd_dp_worker_read(struct event *thread)
{
struct confd_daemon_ctx *dctx = THREAD_ARG(thread);
int fd = THREAD_FD(thread);
}
protected:
- virtual CallState run_mainthread(struct thread *thread) = 0;
+ virtual CallState run_mainthread(struct event *thread) = 0;
- static void c_callback(struct thread *thread)
+ static void c_callback(struct event *thread)
{
auto _tag = static_cast<RpcStateBase *>(THREAD_ARG(thread));
/*
©->responder, cq, cq, copy);
}
- CallState run_mainthread(struct thread *thread) override
+ CallState run_mainthread(struct event *thread) override
{
// Unary RPC are always finished, see "Unary" :)
grpc::Status status = this->callback(this);
©->async_responder, cq, cq, copy);
}
- CallState run_mainthread(struct thread *thread) override
+ CallState run_mainthread(struct event *thread) override
{
if (this->callback(this))
return MORE;
* fork. This is done by scheduling this init function as an event task, since
* the event loop doesn't run until after fork.
*/
-static void frr_grpc_module_very_late_init(struct thread *thread)
+static void frr_grpc_module_very_late_init(struct event *thread)
{
const char *args = THIS_MODULE->load_args;
uint port = GRPC_DEFAULT_PORT;
static sr_conn_ctx_t *connection;
static struct nb_transaction *transaction;
-static void frr_sr_read_cb(struct thread *thread);
+static void frr_sr_read_cb(struct event *thread);
static int frr_sr_finish(void);
/* Convert FRR YANG data value to sysrepo YANG data value. */
return NB_OK;
}
-static void frr_sr_read_cb(struct thread *thread)
+static void frr_sr_read_cb(struct event *thread)
{
struct yang_module *module = THREAD_ARG(thread);
int fd = THREAD_FD(thread);
int fd;
struct thread_master *tm;
/* writer == NULL <=> we're idle */
- struct thread *writer;
+ struct event *writer;
void *arg;
void (*fill)(void *, struct pullwr *);
DEFINE_MTYPE_STATIC(LIB, PULLWR_HEAD, "pull-driven write controller");
DEFINE_MTYPE_STATIC(LIB, PULLWR_BUF, "pull-driven write buffer");
-static void pullwr_run(struct thread *t);
+static void pullwr_run(struct event *t);
struct pullwr *_pullwr_new(struct thread_master *tm, int fd,
void *arg,
pullwr_bump(pullwr);
}
-static void pullwr_run(struct thread *t)
+static void pullwr_run(struct event *t)
{
struct pullwr *pullwr = THREAD_ARG(t);
struct iovec iov[2];
struct resolver_state {
ares_channel channel;
struct thread_master *master;
- struct thread *timeout;
+ struct event *timeout;
};
static struct resolver_state state;
int fd;
struct resolver_state *state;
- struct thread *t_read, *t_write;
+ struct event *t_read, *t_write;
};
static int resolver_fd_cmp(const struct resolver_fd *a,
static void resolver_update_timeouts(struct resolver_state *r);
-static void resolver_cb_timeout(struct thread *t)
+static void resolver_cb_timeout(struct event *t)
{
struct resolver_state *r = THREAD_ARG(t);
resolver_update_timeouts(r);
}
-static void resolver_cb_socket_readable(struct thread *t)
+static void resolver_cb_socket_readable(struct event *t)
{
struct resolver_fd *resfd = THREAD_ARG(t);
struct resolver_state *r = resfd->state;
resolver_update_timeouts(r);
}
-static void resolver_cb_socket_writable(struct thread *t)
+static void resolver_cb_socket_writable(struct event *t)
{
struct resolver_fd *resfd = THREAD_ARG(t);
struct resolver_state *r = resfd->state;
callback(query, NULL, i, &addr[0]);
}
-static void resolver_cb_literal(struct thread *t)
+static void resolver_cb_literal(struct event *t)
{
struct resolver_query *query = THREAD_ARG(t);
void (*callback)(struct resolver_query *, const char *, int,
/* used to immediate provide the result if IP literal is passed in */
union sockunion literal_addr;
- struct thread *literal_cb;
+ struct event *literal_cb;
};
void resolver_init(struct thread_master *tm);
/* master signals descriptor struct */
static struct frr_sigevent_master_t {
- struct thread *t;
+ struct event *t;
struct frr_signal_t *signals;
int sigc;
#ifdef SIGEVENT_SCHEDULE_THREAD
/* timer thread to check signals. shouldn't be needed */
-void frr_signal_timer(struct thread *t)
+void frr_signal_timer(struct event *t)
{
struct frr_sigevent_master_t *sigm;
/* State machine */
enum spf_backoff_state state;
- struct thread *t_holddown;
- struct thread *t_timetolearn;
+ struct event *t_holddown;
+ struct event *t_timetolearn;
/* For debugging */
char *name;
XFREE(MTYPE_SPF_BACKOFF, backoff);
}
-static void spf_backoff_timetolearn_elapsed(struct thread *thread)
+static void spf_backoff_timetolearn_elapsed(struct event *thread)
{
struct spf_backoff *backoff = THREAD_ARG(thread);
backoff->name, spf_backoff_state2str(backoff->state));
}
-static void spf_backoff_holddown_elapsed(struct thread *thread)
+static void spf_backoff_holddown_elapsed(struct event *thread)
{
struct spf_backoff *backoff = THREAD_ARG(thread);
static struct thread_master *systemd_master = NULL;
-static void systemd_send_watchdog(struct thread *t)
+static void systemd_send_watchdog(struct event *t)
{
systemd_send_information("WATCHDOG=1");
int sock;
bool vtysh;
- struct thread *t_accept;
+ struct event *t_accept;
};
DECLARE_DLIST(vtyservs, struct vty_serv, itm);
}
/* Read data via vty socket. */
-static void vty_read(struct thread *thread)
+static void vty_read(struct event *thread)
{
int i;
int nbytes;
}
/* Flush buffer to the vty. */
-static void vty_flush(struct thread *thread)
+static void vty_flush(struct event *thread)
{
int erase;
buffer_status_t flushrc;
}
/* Accept connection from the network. */
-static void vty_accept(struct thread *thread)
+static void vty_accept(struct event *thread)
{
struct vty_serv *vtyserv = THREAD_ARG(thread);
int vty_sock;
/* #define VTYSH_DEBUG 1 */
-static void vtysh_accept(struct thread *thread)
+static void vtysh_accept(struct event *thread)
{
struct vty_serv *vtyserv = THREAD_ARG(thread);
int accept_sock = vtyserv->sock;
vty->pass_fd = fd;
}
-static void vtysh_read(struct thread *thread)
+static void vtysh_read(struct event *thread)
{
int ret;
int sock;
vty_event(VTYSH_READ, vty);
}
-static void vtysh_write(struct thread *thread)
+static void vtysh_write(struct event *thread)
{
struct vty *vty = THREAD_ARG(thread);
}
/* When time out occur output message then close connection. */
-static void vty_timeout(struct thread *thread)
+static void vty_timeout(struct event *thread)
{
struct vty *vty;
size_t pending_cmds_bufpos;
/* Confirmed-commit timeout and rollback configuration. */
- struct thread *t_confirmed_commit_timeout;
+ struct event *t_confirmed_commit_timeout;
struct nb_config *confirmed_commit_rollback;
/* qobj object ID (replacement for "index") */
int lines;
/* Read and write thread. */
- struct thread *t_read;
- struct thread *t_write;
+ struct event *t_read;
+ struct event *t_write;
/* Timeout seconds and thread. */
unsigned long v_timeout;
- struct thread *t_timeout;
+ struct event *t_timeout;
/* What address is this vty comming from. */
char address[SU_ADDRSTRLEN];
static int debug_timer_wheel = 0;
-static void wheel_timer_thread(struct thread *t);
+static void wheel_timer_thread(struct event *t);
-static void wheel_timer_thread_helper(struct thread *t)
+static void wheel_timer_thread_helper(struct event *t)
{
struct listnode *node, *nextnode;
unsigned long long curr_slot;
wheel->nexttime * slots_to_skip, &wheel->timer);
}
-static void wheel_timer_thread(struct thread *t)
+static void wheel_timer_thread(struct event *t)
{
struct timer_wheel *wheel;
unsigned int slots_to_skip;
struct list **wheel_slot_lists;
- struct thread *timer;
+ struct event *timer;
/*
* Key to determine what slot the item belongs in
*/
* will reschedule itself if required,
* otherwise work_queue_item_add
*/
-void work_queue_run(struct thread *thread)
+void work_queue_run(struct event *thread)
{
struct work_queue *wq;
struct work_queue_item *item, *titem;
* the following may be read
*/
struct thread_master *master; /* thread master */
- struct thread *thread; /* thread, if one is active */
+ struct event *thread; /* thread, if one is active */
char *name; /* work queue name */
/* Specification for this work queue.
bool work_queue_is_scheduled(struct work_queue *wq);
/* Helpers, exported for thread.c and command.c */
-extern void work_queue_run(struct thread *thread);
+extern void work_queue_run(struct event *thread);
extern void workqueue_cmd_init(void);
#endif
#ifdef HAVE_SYSREPO
sr_subscription_ctx_t *sr_subscription;
- struct thread *sr_thread;
+ struct event *sr_thread;
#endif
};
RB_HEAD(yang_modules, yang_module);
return ZCLIENT_SEND_FAILURE;
}
-static void zclient_flush_data(struct thread *thread)
+static void zclient_flush_data(struct event *thread)
{
struct zclient *zclient = THREAD_ARG(thread);
/* This function is a wrapper function for calling zclient_start from
timer or event thread. */
-static void zclient_connect(struct thread *t)
+static void zclient_connect(struct event *t)
{
struct zclient *zclient;
};
/* Zebra client message read function. */
-static void zclient_read(struct thread *thread)
+static void zclient_read(struct event *thread)
{
size_t already;
uint16_t length, command;
struct buffer *wb;
/* Read and connect thread. */
- struct thread *t_read;
- struct thread *t_connect;
+ struct event *t_read;
+ struct event *t_connect;
/* Thread to write buffered data to zebra. */
- struct thread *t_write;
+ struct event *t_write;
/* Redistribute information. */
uint8_t redist_default; /* clients protocol */
static void zlog_backtrace_msg(const struct xref_logmsg *xref, int prio)
{
- struct thread *tc = pthread_getspecific(thread_current);
+ struct event *tc = pthread_getspecific(thread_current);
const char *uid = xref->xref.xrefdata->uid;
bool found_thread = false;
rcu_free(MTYPE_LOG_5424, oldt, zt.rcu_head);
}
-static void zlog_5424_reconnect(struct thread *t)
+static void zlog_5424_reconnect(struct event *t)
{
struct zlog_cfg_5424 *zcf = THREAD_ARG(t);
int fd = THREAD_FD(t);
#include "zlog_targets.h"
#include "qobj.h"
-struct thread;
+struct event;
struct thread_master;
enum zlog_5424_dst {
/* sockets only - read handler to reconnect on errors */
struct thread_master *master;
- struct thread *t_reconnect;
+ struct event *t_reconnect;
unsigned int reconn_backoff, reconn_backoff_cur, reconn_backoff_max;
int sock_type;
struct sockaddr_storage sa;
mgmtd__be_message__free_unpacked(be_msg, NULL);
}
-static void mgmt_be_adapter_proc_msgbufs(struct thread *thread)
+static void mgmt_be_adapter_proc_msgbufs(struct event *thread)
{
struct mgmt_be_client_adapter *adapter = THREAD_ARG(thread);
mgmt_be_adapter_register_event(adapter, MGMTD_BE_PROC_MSG);
}
-static void mgmt_be_adapter_read(struct thread *thread)
+static void mgmt_be_adapter_read(struct event *thread)
{
struct mgmt_be_client_adapter *adapter;
enum mgmt_msg_rsched rv;
mgmt_be_adapter_register_event(adapter, MGMTD_BE_CONN_READ);
}
-static void mgmt_be_adapter_write(struct thread *thread)
+static void mgmt_be_adapter_write(struct event *thread)
{
struct mgmt_be_client_adapter *adapter = THREAD_ARG(thread);
enum mgmt_msg_wsched rv;
assert(rv == MSW_SCHED_NONE);
}
-static void mgmt_be_adapter_resume_writes(struct thread *thread)
+static void mgmt_be_adapter_resume_writes(struct event *thread)
{
struct mgmt_be_client_adapter *adapter;
nb_config_diff_created(node, seq, root);
}
-static void mgmt_be_adapter_conn_init(struct thread *thread)
+static void mgmt_be_adapter_conn_init(struct event *thread)
{
struct mgmt_be_client_adapter *adapter;
enum mgmt_be_client_id id;
int conn_fd;
union sockunion conn_su;
- struct thread *conn_init_ev;
- struct thread *conn_read_ev;
- struct thread *conn_write_ev;
- struct thread *conn_writes_on;
- struct thread *proc_msg_ev;
+ struct event *conn_init_ev;
+ struct event *conn_read_ev;
+ struct event *conn_write_ev;
+ struct event *conn_writes_on;
+ struct event *proc_msg_ev;
uint32_t flags;
char name[MGMTD_CLIENT_NAME_MAX_LEN];
uint8_t num_xpath_reg;
static int mgmt_be_listen_fd = -1;
static struct thread_master *mgmt_be_listen_tm;
-static struct thread *mgmt_be_listen_ev;
+static struct event *mgmt_be_listen_ev;
static void mgmt_be_server_register_event(enum mgmt_be_event event);
-static void mgmt_be_conn_accept(struct thread *thread)
+static void mgmt_be_conn_accept(struct event *thread)
{
int client_conn_fd;
union sockunion su;
uint8_t ds_write_locked[MGMTD_DS_MAX_ID];
uint8_t ds_read_locked[MGMTD_DS_MAX_ID];
uint8_t ds_locked_implict[MGMTD_DS_MAX_ID];
- struct thread *proc_cfg_txn_clnp;
- struct thread *proc_show_txn_clnp;
+ struct event *proc_cfg_txn_clnp;
+ struct event *proc_show_txn_clnp;
struct mgmt_fe_sessions_item list_linkage;
};
return mgmt_fe_adapter_send_msg(session->adapter, &fe_msg);
}
-static void mgmt_fe_session_cfg_txn_clnup(struct thread *thread)
+static void mgmt_fe_session_cfg_txn_clnup(struct event *thread)
{
struct mgmt_fe_session_ctx *session;
mgmt_fe_session_cfg_txn_cleanup(session);
}
-static void mgmt_fe_session_show_txn_clnup(struct thread *thread)
+static void mgmt_fe_session_show_txn_clnup(struct event *thread)
{
struct mgmt_fe_session_ctx *session;
mgmtd__fe_message__free_unpacked(fe_msg, NULL);
}
-static void mgmt_fe_adapter_proc_msgbufs(struct thread *thread)
+static void mgmt_fe_adapter_proc_msgbufs(struct event *thread)
{
struct mgmt_fe_client_adapter *adapter = THREAD_ARG(thread);
mgmt_fe_adapter_register_event(adapter, MGMTD_FE_PROC_MSG);
}
-static void mgmt_fe_adapter_read(struct thread *thread)
+static void mgmt_fe_adapter_read(struct event *thread)
{
struct mgmt_fe_client_adapter *adapter = THREAD_ARG(thread);
enum mgmt_msg_rsched rv;
mgmt_fe_adapter_register_event(adapter, MGMTD_FE_CONN_READ);
}
-static void mgmt_fe_adapter_write(struct thread *thread)
+static void mgmt_fe_adapter_write(struct event *thread)
{
struct mgmt_fe_client_adapter *adapter = THREAD_ARG(thread);
enum mgmt_msg_wsched rv;
assert(rv == MSW_SCHED_NONE);
}
-static void mgmt_fe_adapter_resume_writes(struct thread *thread)
+static void mgmt_fe_adapter_resume_writes(struct event *thread)
{
struct mgmt_fe_client_adapter *adapter;
struct mgmt_fe_client_adapter {
int conn_fd;
union sockunion conn_su;
- struct thread *conn_read_ev;
- struct thread *conn_write_ev;
- struct thread *conn_writes_on;
- struct thread *proc_msg_ev;
+ struct event *conn_read_ev;
+ struct event *conn_write_ev;
+ struct event *conn_writes_on;
+ struct event *proc_msg_ev;
uint32_t flags;
char name[MGMTD_CLIENT_NAME_MAX_LEN];
static int mgmt_fe_listen_fd = -1;
static struct thread_master *mgmt_fe_listen_tm;
-static struct thread *mgmt_fe_listen_ev;
+static struct event *mgmt_fe_listen_ev;
static void mgmt_fe_server_register_event(enum mgmt_fe_event event);
-static void mgmt_fe_conn_accept(struct thread *thread)
+static void mgmt_fe_conn_accept(struct event *thread)
{
int client_conn_fd;
union sockunion su;
/* struct mgmt_master *mm; */
- struct thread *proc_set_cfg;
- struct thread *proc_comm_cfg;
- struct thread *proc_get_cfg;
- struct thread *proc_get_data;
- struct thread *comm_cfg_timeout;
- struct thread *clnup;
+ struct event *proc_set_cfg;
+ struct event *proc_comm_cfg;
+ struct event *proc_get_cfg;
+ struct event *proc_get_data;
+ struct event *comm_cfg_timeout;
+ struct event *clnup;
/* List of backend adapters involved in this transaction */
struct mgmt_txn_badapters_head be_adapters;
*txn_req = NULL;
}
-static void mgmt_txn_process_set_cfg(struct thread *thread)
+static void mgmt_txn_process_set_cfg(struct event *thread)
{
struct mgmt_txn_ctx *txn;
struct mgmt_txn_req *txn_req;
return 0;
}
-static void mgmt_txn_cfg_commit_timedout(struct thread *thread)
+static void mgmt_txn_cfg_commit_timedout(struct event *thread)
{
struct mgmt_txn_ctx *txn;
return 0;
}
-static void mgmt_txn_process_commit_cfg(struct thread *thread)
+static void mgmt_txn_process_commit_cfg(struct event *thread)
{
struct mgmt_txn_ctx *txn;
struct mgmt_commit_cfg_req *cmtcfg_req;
return 0;
}
-static void mgmt_txn_process_get_cfg(struct thread *thread)
+static void mgmt_txn_process_get_cfg(struct event *thread)
{
struct mgmt_txn_ctx *txn;
struct mgmt_txn_req *txn_req;
}
}
-static void mgmt_txn_process_get_data(struct thread *thread)
+static void mgmt_txn_process_get_data(struct event *thread)
{
struct mgmt_txn_ctx *txn;
struct mgmt_txn_req *txn_req;
mgmt_txn_cleanup_txn(&txn);
}
-static void mgmt_txn_cleanup(struct thread *thread)
+static void mgmt_txn_cleanup(struct event *thread)
{
struct mgmt_txn_ctx *txn;
int netlink_nflog_group;
static int netlink_log_fd = -1;
-static struct thread *netlink_log_thread;
+static struct event *netlink_log_thread;
void netlink_update_binding(struct interface *ifp, union sockunion *proto,
union sockunion *nbma)
nhrp_peer_send_indication(ifp, htons(pkthdr->hw_protocol), &pktpl);
}
-static void netlink_log_recv(struct thread *t)
+static void netlink_log_recv(struct event *t)
{
uint8_t buf[ZNL_BUFFER_SIZE];
int fd = THREAD_FD(t);
create ? nhrp_cache_alloc : NULL);
}
-static void nhrp_cache_do_free(struct thread *t)
+static void nhrp_cache_do_free(struct event *t)
{
struct nhrp_cache *c = THREAD_ARG(t);
nhrp_cache_free(c);
}
-static void nhrp_cache_do_timeout(struct thread *t)
+static void nhrp_cache_do_timeout(struct event *t)
{
struct nhrp_cache *c = THREAD_ARG(t);
nhrp_cache_update_timers(c);
}
-static void nhrp_cache_do_auth_timeout(struct thread *t)
+static void nhrp_cache_do_auth_timeout(struct event *t)
{
struct nhrp_cache *c = THREAD_ARG(t);
c->t_auth = NULL;
struct nhrp_reqid_pool nhrp_event_reqid;
struct event_manager {
- struct thread *t_reconnect, *t_read, *t_write;
+ struct event *t_reconnect, *t_read, *t_write;
struct zbuf ibuf;
struct zbuf_queue obuf;
int fd;
uint8_t ibuf_data[4 * 1024];
};
-static void evmgr_reconnect(struct thread *t);
+static void evmgr_reconnect(struct event *t);
static void evmgr_connection_error(struct event_manager *evmgr)
{
}
}
-static void evmgr_read(struct thread *t)
+static void evmgr_read(struct event *t)
{
struct event_manager *evmgr = THREAD_ARG(t);
struct zbuf *ibuf = &evmgr->ibuf;
thread_add_read(master, evmgr_read, evmgr, evmgr->fd, &evmgr->t_read);
}
-static void evmgr_write(struct thread *t)
+static void evmgr_write(struct event *t)
{
struct event_manager *evmgr = THREAD_ARG(t);
int r;
&evmgr->t_write);
}
-static void evmgr_reconnect(struct thread *t)
+static void evmgr_reconnect(struct event *t)
{
struct event_manager *evmgr = THREAD_ARG(t);
int fd;
int netlink_mcast_nflog_group;
static int netlink_mcast_log_fd = -1;
-static struct thread *netlink_mcast_log_thread;
+static struct event *netlink_mcast_log_thread;
struct mcast_ctx {
struct interface *ifp;
}
}
-static void netlink_mcast_log_recv(struct thread *t)
+static void netlink_mcast_log_recv(struct event *t)
{
uint8_t buf[65535]; /* Max OSPF Packet size */
int fd = THREAD_FD(t);
DEFINE_MTYPE_STATIC(NHRPD, NHRP_NHS, "NHRP next hop server");
DEFINE_MTYPE_STATIC(NHRPD, NHRP_REGISTRATION, "NHRP registration entries");
-static void nhrp_nhs_resolve(struct thread *t);
-static void nhrp_reg_send_req(struct thread *t);
+static void nhrp_nhs_resolve(struct event *t);
+static void nhrp_reg_send_req(struct event *t);
static void nhrp_reg_reply(struct nhrp_reqid *reqid, void *arg)
{
&cie_nbma_nhs);
}
-static void nhrp_reg_timeout(struct thread *t)
+static void nhrp_reg_timeout(struct event *t)
{
struct nhrp_registration *r = THREAD_ARG(t);
struct nhrp_cache *c;
}
}
-static void nhrp_reg_send_req(struct thread *t)
+static void nhrp_reg_send_req(struct event *t)
{
struct nhrp_registration *r = THREAD_ARG(t);
struct nhrp_nhs *nhs = r->nhs;
nhrp_reg_delete(reg);
}
-static void nhrp_nhs_resolve(struct thread *t)
+static void nhrp_nhs_resolve(struct event *t)
{
struct nhrp_nhs *nhs = THREAD_ARG(t);
return -1;
}
-static void nhrp_packet_recvraw(struct thread *t)
+static void nhrp_packet_recvraw(struct event *t)
{
int fd = THREAD_FD(t), ifindex;
struct zbuf *zb;
XFREE(MTYPE_NHRP_PEER, p);
}
-static void nhrp_peer_notify_up(struct thread *t)
+static void nhrp_peer_notify_up(struct event *t)
{
struct nhrp_peer *p = THREAD_ARG(t);
struct nhrp_vc *vc = p->vc;
}
}
-static void nhrp_peer_request_timeout(struct thread *t)
+static void nhrp_peer_request_timeout(struct event *t)
{
struct nhrp_peer *p = THREAD_ARG(t);
struct nhrp_vc *vc = p->vc;
}
}
-static void nhrp_peer_defer_vici_request(struct thread *t)
+static void nhrp_peer_defer_vici_request(struct event *t)
{
struct nhrp_peer *p = THREAD_ARG(t);
struct nhrp_vc *vc = p->vc;
static struct route_table *shortcut_rib[AFI_MAX];
-static void nhrp_shortcut_do_purge(struct thread *t);
+static void nhrp_shortcut_do_purge(struct event *t);
static void nhrp_shortcut_delete(struct nhrp_shortcut *s);
static void nhrp_shortcut_send_resolution_req(struct nhrp_shortcut *s);
}
}
-static void nhrp_shortcut_do_expire(struct thread *t)
+static void nhrp_shortcut_do_expire(struct event *t)
{
struct nhrp_shortcut *s = THREAD_ARG(t);
}
}
-static void nhrp_shortcut_do_purge(struct thread *t)
+static void nhrp_shortcut_do_purge(struct event *t)
{
struct nhrp_shortcut *s = THREAD_ARG(t);
s->t_timer = NULL;
struct notifier_list notifier_list;
struct interface *ifp;
struct nhrp_vc *vc;
- struct thread *t_fallback;
+ struct event *t_fallback;
struct notifier_block vc_notifier, ifp_notifier;
- struct thread *t_timer;
+ struct event *t_timer;
};
struct nhrp_packet_parser {
struct notifier_block newpeer_notifier;
struct notifier_list notifier_list;
struct nhrp_reqid eventid;
- struct thread *t_timeout;
- struct thread *t_auth;
+ struct event *t_timeout;
+ struct event *t_auth;
struct {
enum nhrp_cache_type type;
union sockunion addr;
struct nhrp_reqid reqid;
- struct thread *t_timer;
+ struct event *t_timer;
enum nhrp_cache_type type;
unsigned int holding_time;
union sockunion proto_addr;
const char *nbma_fqdn; /* IP-address or FQDN */
- struct thread *t_resolve;
+ struct event *t_resolve;
struct resolver_query dns_resolve;
struct nhrp_reglist_head reglist_head;
};
struct nhrp_registration {
struct nhrp_reglist_item reglist_entry;
- struct thread *t_register;
+ struct event *t_register;
struct nhrp_nhs *nhs;
struct nhrp_reqid reqid;
unsigned int timeout;
}
struct vici_conn {
- struct thread *t_reconnect, *t_read, *t_write;
+ struct event *t_reconnect, *t_read, *t_write;
struct zbuf ibuf;
struct zbuf_queue obuf;
int fd;
int nsections;
};
-static void vici_reconnect(struct thread *t);
+static void vici_reconnect(struct event *t);
static void vici_submit_request(struct vici_conn *vici, const char *name, ...);
static void vici_zbuf_puts(struct zbuf *obuf, const char *str)
}
}
-static void vici_read(struct thread *t)
+static void vici_read(struct event *t)
{
struct vici_conn *vici = THREAD_ARG(t);
struct zbuf *ibuf = &vici->ibuf;
thread_add_read(master, vici_read, vici, vici->fd, &vici->t_read);
}
-static void vici_write(struct thread *t)
+static void vici_write(struct event *t)
{
struct vici_conn *vici = THREAD_ARG(t);
int r;
return buff;
}
-static void vici_reconnect(struct thread *t)
+static void vici_reconnect(struct event *t)
{
struct vici_conn *vici = THREAD_ARG(t);
int fd;
uint32_t spf_calculation; /* SPF calculation count */
- struct thread *thread_router_lsa;
- struct thread *thread_intra_prefix_lsa;
+ struct event *thread_router_lsa;
+ struct event *thread_intra_prefix_lsa;
uint32_t router_lsa_size_limit;
/* Area announce list */
return lsa;
}
-void ospf6_orig_as_external_lsa(struct thread *thread)
+void ospf6_orig_as_external_lsa(struct event *thread)
{
struct ospf6_interface *oi;
struct ospf6_lsa *lsa;
ROUTEMAP(red) = NULL;
}
-static void ospf6_asbr_routemap_update_timer(struct thread *thread)
+static void ospf6_asbr_routemap_update_timer(struct event *thread)
{
struct ospf6 *ospf6 = THREAD_ARG(thread);
struct ospf6_redist *red;
}
}
-static void ospf6_asbr_summary_process(struct thread *thread)
+static void ospf6_asbr_summary_process(struct event *thread)
{
struct ospf6 *ospf6 = THREAD_ARG(thread);
int operation = 0;
}
/* Handling of grace period expiry. */
-static void ospf6_gr_grace_period_expired(struct thread *thread)
+static void ospf6_gr_grace_period_expired(struct event *thread)
{
struct ospf6 *ospf6 = THREAD_ARG(thread);
* Returns:
* Nothing
*/
-static void ospf6_handle_grace_timer_expiry(struct thread *thread)
+static void ospf6_handle_grace_timer_expiry(struct event *thread)
{
struct ospf6_neighbor *nbr = THREAD_ARG(thread);
#endif /* __FreeBSD__ */
/* Interface State Machine */
-void interface_up(struct thread *thread)
+void interface_up(struct event *thread)
{
struct ospf6_interface *oi;
struct ospf6 *ospf6;
}
}
-void wait_timer(struct thread *thread)
+void wait_timer(struct event *thread)
{
struct ospf6_interface *oi;
ospf6_interface_state_change(dr_election(oi), oi);
}
-void backup_seen(struct thread *thread)
+void backup_seen(struct event *thread)
{
struct ospf6_interface *oi;
ospf6_interface_state_change(dr_election(oi), oi);
}
-void neighbor_change(struct thread *thread)
+void neighbor_change(struct event *thread)
{
struct ospf6_interface *oi;
ospf6_interface_state_change(dr_election(oi), oi);
}
-void interface_down(struct thread *thread)
+void interface_down(struct event *thread)
{
struct ospf6_interface *oi;
struct listnode *node, *nnode;
/* Interface socket setting trial counter, resets on success */
uint8_t sso_try_cnt;
- struct thread *thread_sso;
+ struct event *thread_sso;
/* OSPF6 Interface flag */
char flag;
struct ospf6_lsdb *lsack_list;
/* Ongoing Tasks */
- struct thread *thread_send_hello;
- struct thread *thread_send_lsupdate;
- struct thread *thread_send_lsack;
+ struct event *thread_send_hello;
+ struct event *thread_send_lsupdate;
+ struct event *thread_send_lsack;
- struct thread *thread_network_lsa;
- struct thread *thread_link_lsa;
- struct thread *thread_intra_prefix_lsa;
- struct thread *thread_as_extern_lsa;
- struct thread *thread_wait_timer;
+ struct event *thread_network_lsa;
+ struct event *thread_link_lsa;
+ struct event *thread_intra_prefix_lsa;
+ struct event *thread_as_extern_lsa;
+ struct event *thread_wait_timer;
struct ospf6_route_table *route_connected;
ospf6_interface_get_global_address(struct interface *ifp);
/* interface event */
-extern void interface_up(struct thread *thread);
-extern void interface_down(struct thread *thread);
-extern void wait_timer(struct thread *thread);
-extern void backup_seen(struct thread *thread);
-extern void neighbor_change(struct thread *thread);
+extern void interface_up(struct event *thread);
+extern void interface_down(struct event *thread);
+extern void wait_timer(struct event *thread);
+extern void backup_seen(struct event *thread);
+extern void neighbor_change(struct event *thread);
extern void ospf6_interface_init(void);
extern void ospf6_interface_clear(struct interface *ifp);
return OSPF6_NOT_STUB_ROUTER;
}
-void ospf6_router_lsa_originate(struct thread *thread)
+void ospf6_router_lsa_originate(struct event *thread)
{
struct ospf6_area *oa;
return 0;
}
-void ospf6_network_lsa_originate(struct thread *thread)
+void ospf6_network_lsa_originate(struct event *thread)
{
struct ospf6_interface *oi;
return 0;
}
-void ospf6_link_lsa_originate(struct thread *thread)
+void ospf6_link_lsa_originate(struct event *thread)
{
struct ospf6_interface *oi;
return 0;
}
-void ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
+void ospf6_intra_prefix_lsa_originate_stub(struct event *thread)
{
struct ospf6_area *oa;
}
-void ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
+void ospf6_intra_prefix_lsa_originate_transit(struct event *thread)
{
struct ospf6_interface *oi;
struct ospf6_lsa *lsa);
extern int ospf6_router_is_stub_router(struct ospf6_lsa *lsa);
-extern void ospf6_router_lsa_originate(struct thread *thread);
-extern void ospf6_network_lsa_originate(struct thread *thread);
-extern void ospf6_link_lsa_originate(struct thread *thread);
-extern void ospf6_intra_prefix_lsa_originate_transit(struct thread *thread);
-extern void ospf6_intra_prefix_lsa_originate_stub(struct thread *thread);
+extern void ospf6_router_lsa_originate(struct event *thread);
+extern void ospf6_network_lsa_originate(struct event *thread);
+extern void ospf6_link_lsa_originate(struct event *thread);
+extern void ospf6_intra_prefix_lsa_originate_transit(struct event *thread);
+extern void ospf6_intra_prefix_lsa_originate_stub(struct event *thread);
extern void ospf6_intra_prefix_lsa_add(struct ospf6_lsa *lsa);
extern void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa);
-extern void ospf6_orig_as_external_lsa(struct thread *thread);
+extern void ospf6_orig_as_external_lsa(struct event *thread);
extern void ospf6_intra_route_calculation(struct ospf6_area *oa);
extern void ospf6_intra_brouter_calculation(struct ospf6_area *oa);
extern void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa,
/* ospf6 lsa expiry */
-void ospf6_lsa_expire(struct thread *thread)
+void ospf6_lsa_expire(struct event *thread)
{
struct ospf6_lsa *lsa;
struct ospf6 *ospf6;
assert(OSPF6_LSA_IS_MAXAGE(lsa));
assert(!lsa->refresh);
- lsa->expire = (struct thread *)NULL;
+ lsa->expire = (struct event *)NULL;
if (IS_OSPF6_DEBUG_LSA_TYPE(lsa->header->type)) {
zlog_debug("LSA Expire:");
ospf6_maxage_remove(ospf6);
}
-void ospf6_lsa_refresh(struct thread *thread)
+void ospf6_lsa_refresh(struct event *thread)
{
struct ospf6_lsa *old, *self, *new;
struct ospf6_lsdb *lsdb_self;
old = (struct ospf6_lsa *)THREAD_ARG(thread);
assert(old && old->header);
- old->refresh = (struct thread *)NULL;
+ old->refresh = (struct event *)NULL;
lsdb_self = ospf6_get_scoped_lsdb_self(old);
self = ospf6_lsdb_lookup(old->header->type, old->header->id,
struct timeval received; /* used by MinLSArrival check */
struct timeval installed;
- struct thread *expire;
- struct thread *refresh; /* For self-originated LSA */
+ struct event *expire;
+ struct event *refresh; /* For self-originated LSA */
int retrans_count;
extern struct ospf6_lsa *ospf6_lsa_lock(struct ospf6_lsa *lsa);
extern struct ospf6_lsa *ospf6_lsa_unlock(struct ospf6_lsa *lsa);
-extern void ospf6_lsa_expire(struct thread *thread);
-extern void ospf6_lsa_refresh(struct thread *thread);
+extern void ospf6_lsa_expire(struct event *thread);
+extern void ospf6_lsa_refresh(struct event *thread);
extern unsigned short ospf6_lsa_checksum(struct ospf6_lsa_header *lsah);
extern int ospf6_lsa_checksum_valid(struct ospf6_lsa_header *lsah);
return OSPF6_READ_CONTINUE;
}
-void ospf6_receive(struct thread *thread)
+void ospf6_receive(struct event *thread)
{
int sockfd;
struct ospf6 *ospf6;
return length;
}
-static void ospf6_write(struct thread *thread)
+static void ospf6_write(struct event *thread)
{
struct ospf6 *ospf6 = THREAD_ARG(thread);
struct ospf6_interface *oi;
&ospf6->t_write);
}
-void ospf6_hello_send(struct thread *thread)
+void ospf6_hello_send(struct event *thread)
{
struct ospf6_interface *oi;
struct ospf6_packet *op;
return length;
}
-void ospf6_dbdesc_send(struct thread *thread)
+void ospf6_dbdesc_send(struct event *thread)
{
struct ospf6_neighbor *on;
uint16_t length = OSPF6_HEADER_SIZE;
OSPF6_MESSAGE_WRITE_ON(on->ospf6_if);
}
-void ospf6_dbdesc_send_newone(struct thread *thread)
+void ospf6_dbdesc_send_newone(struct event *thread)
{
struct ospf6_neighbor *on;
struct ospf6_lsa *lsa, *lsanext;
return length;
}
-void ospf6_lsreq_send(struct thread *thread)
+void ospf6_lsreq_send(struct event *thread)
{
struct ospf6_neighbor *on;
struct ospf6_packet *op;
return length;
}
-void ospf6_lsupdate_send_neighbor(struct thread *thread)
+void ospf6_lsupdate_send_neighbor(struct event *thread)
{
struct ospf6_neighbor *on;
struct ospf6_packet *op;
return length;
}
-void ospf6_lsupdate_send_interface(struct thread *thread)
+void ospf6_lsupdate_send_interface(struct event *thread)
{
struct ospf6_interface *oi;
struct ospf6_packet *op;
}
}
-void ospf6_lsack_send_neighbor(struct thread *thread)
+void ospf6_lsack_send_neighbor(struct event *thread)
{
struct ospf6_neighbor *on;
struct ospf6_packet *op;
return length;
}
-void ospf6_lsack_send_interface(struct thread *thread)
+void ospf6_lsack_send_interface(struct event *thread)
{
struct ospf6_interface *oi;
struct ospf6_packet *op;
extern int ospf6_iobuf_size(unsigned int size);
extern void ospf6_message_terminate(void);
-extern void ospf6_receive(struct thread *thread);
-
-extern void ospf6_hello_send(struct thread *thread);
-extern void ospf6_dbdesc_send(struct thread *thread);
-extern void ospf6_dbdesc_send_newone(struct thread *thread);
-extern void ospf6_lsreq_send(struct thread *thread);
-extern void ospf6_lsupdate_send_interface(struct thread *thread);
-extern void ospf6_lsupdate_send_neighbor(struct thread *thread);
-extern void ospf6_lsack_send_interface(struct thread *thread);
-extern void ospf6_lsack_send_neighbor(struct thread *thread);
+extern void ospf6_receive(struct event *thread);
+
+extern void ospf6_hello_send(struct event *thread);
+extern void ospf6_dbdesc_send(struct event *thread);
+extern void ospf6_dbdesc_send_newone(struct event *thread);
+extern void ospf6_lsreq_send(struct event *thread);
+extern void ospf6_lsupdate_send_interface(struct event *thread);
+extern void ospf6_lsupdate_send_neighbor(struct event *thread);
+extern void ospf6_lsack_send_interface(struct event *thread);
+extern void ospf6_lsack_send_neighbor(struct event *thread);
extern int config_write_ospf6_debug_message(struct vty *);
extern void install_element_ospf6_debug_message(void);
return 0;
}
-void hello_received(struct thread *thread)
+void hello_received(struct event *thread)
{
struct ospf6_neighbor *on;
OSPF6_NEIGHBOR_EVENT_HELLO_RCVD);
}
-void twoway_received(struct thread *thread)
+void twoway_received(struct event *thread)
{
struct ospf6_neighbor *on;
&on->thread_send_dbdesc);
}
-void negotiation_done(struct thread *thread)
+void negotiation_done(struct event *thread)
{
struct ospf6_neighbor *on;
struct ospf6_lsa *lsa, *lsanext;
OSPF6_NEIGHBOR_EVENT_NEGOTIATION_DONE);
}
-static void ospf6_neighbor_last_dbdesc_release(struct thread *thread)
+static void ospf6_neighbor_last_dbdesc_release(struct event *thread)
{
struct ospf6_neighbor *on = THREAD_ARG(thread);
memset(&on->dbdesc_last, 0, sizeof(struct ospf6_dbdesc));
}
-void exchange_done(struct thread *thread)
+void exchange_done(struct event *thread)
{
struct ospf6_neighbor *on;
}
}
-void loading_done(struct thread *thread)
+void loading_done(struct event *thread)
{
struct ospf6_neighbor *on;
OSPF6_NEIGHBOR_EVENT_LOADING_DONE);
}
-void adj_ok(struct thread *thread)
+void adj_ok(struct event *thread)
{
struct ospf6_neighbor *on;
}
}
-void seqnumber_mismatch(struct thread *thread)
+void seqnumber_mismatch(struct event *thread)
{
struct ospf6_neighbor *on;
&on->thread_send_dbdesc);
}
-void bad_lsreq(struct thread *thread)
+void bad_lsreq(struct event *thread)
{
struct ospf6_neighbor *on;
}
-void oneway_received(struct thread *thread)
+void oneway_received(struct event *thread)
{
struct ospf6_neighbor *on;
THREAD_OFF(on->thread_adj_ok);
}
-void inactivity_timer(struct thread *thread)
+void inactivity_timer(struct event *thread)
{
struct ospf6_neighbor *on;
* helper until this timer until
* this timer expires.
*/
- struct thread *t_grace_timer;
+ struct event *t_grace_timer;
/* Helper status */
uint32_t gr_helper_status;
struct ospf6_lsa *last_ls_req;
/* Inactivity timer */
- struct thread *inactivity_timer;
+ struct event *inactivity_timer;
/* Timer to release the last dbdesc packet */
- struct thread *last_dbdesc_release_timer;
+ struct event *last_dbdesc_release_timer;
/* Thread for sending message */
- struct thread *thread_send_dbdesc;
- struct thread *thread_send_lsreq;
- struct thread *thread_send_lsupdate;
- struct thread *thread_send_lsack;
- struct thread *thread_exchange_done;
- struct thread *thread_adj_ok;
+ struct event *thread_send_dbdesc;
+ struct event *thread_send_lsreq;
+ struct event *thread_send_lsupdate;
+ struct event *thread_send_lsack;
+ struct event *thread_exchange_done;
+ struct event *thread_adj_ok;
/* BFD information */
struct bfd_session_params *bfd_session;
void ospf6_neighbor_delete(struct ospf6_neighbor *on);
/* Neighbor event */
-extern void hello_received(struct thread *thread);
-extern void twoway_received(struct thread *thread);
-extern void negotiation_done(struct thread *thread);
-extern void exchange_done(struct thread *thread);
-extern void loading_done(struct thread *thread);
-extern void adj_ok(struct thread *thread);
-extern void seqnumber_mismatch(struct thread *thread);
-extern void bad_lsreq(struct thread *thread);
-extern void oneway_received(struct thread *thread);
-extern void inactivity_timer(struct thread *thread);
+extern void hello_received(struct event *thread);
+extern void twoway_received(struct event *thread);
+extern void negotiation_done(struct event *thread);
+extern void exchange_done(struct event *thread);
+extern void loading_done(struct event *thread);
+extern void adj_ok(struct event *thread);
+extern void seqnumber_mismatch(struct event *thread);
+extern void bad_lsreq(struct event *thread);
+extern void oneway_received(struct event *thread);
+extern void inactivity_timer(struct event *thread);
extern void ospf6_check_nbr_loading(struct ospf6_neighbor *on);
extern void ospf6_neighbor_init(void);
}
/* This function performs ABR related processing */
-static void ospf6_abr_task_timer(struct thread *thread)
+static void ospf6_abr_task_timer(struct event *thread)
{
struct ospf6 *ospf6 = THREAD_ARG(thread);
zlog_debug("%s", buffer);
}
-static void ospf6_spf_calculation_thread(struct thread *t)
+static void ospf6_spf_calculation_thread(struct event *t)
{
struct ospf6_area *oa;
struct ospf6 *ospf6;
return 0;
}
-static void ospf6_ase_calculate_timer(struct thread *t)
+static void ospf6_ase_calculate_timer(struct event *t)
{
struct ospf6 *ospf6;
struct ospf6_lsa *lsa;
om6->master = master;
}
-static void ospf6_maxage_remover(struct thread *thread)
+static void ospf6_maxage_remover(struct event *thread)
{
struct ospf6 *o = (struct ospf6 *)THREAD_ARG(thread);
struct ospf6_area *oa;
bool prepare_in_progress;
bool finishing_restart;
uint32_t grace_period;
- struct thread *t_grace_period;
+ struct event *t_grace_period;
};
struct ospf6_gr_helper {
int fd;
/* Threads */
- struct thread *t_spf_calc; /* SPF calculation timer. */
- struct thread *t_ase_calc; /* ASE calculation timer. */
- struct thread *maxage_remover;
- struct thread *t_distribute_update; /* Distirbute update timer. */
- struct thread *t_ospf6_receive; /* OSPF6 receive timer */
- struct thread *t_external_aggr; /* OSPF6 aggregation timer */
+ struct event *t_spf_calc; /* SPF calculation timer. */
+ struct event *t_ase_calc; /* ASE calculation timer. */
+ struct event *maxage_remover;
+ struct event *t_distribute_update; /* Distirbute update timer. */
+ struct event *t_ospf6_receive; /* OSPF6 receive timer */
+ struct event *t_external_aggr; /* OSPF6 aggregation timer */
#define OSPF6_WRITE_INTERFACE_COUNT_DEFAULT 20
- struct thread *t_write;
+ struct event *t_write;
int write_oi_count; /* Num of packets sent per thread invocation */
uint32_t ref_bandwidth;
/* Count of NSSA areas */
uint8_t anyNSSA;
- struct thread *t_abr_task; /* ABR task timer. */
+ struct event *t_abr_task; /* ABR task timer. */
struct list *oi_write_q;
uint32_t redist_count;
* ---------------------------------------------------------
*/
-static void lsa_delete(struct thread *t)
+static void lsa_delete(struct event *t)
{
struct ospf_apiclient *oclient;
struct in_addr area_id;
printf("done, return code is = %d\n", rc);
}
-static void lsa_inject(struct thread *t)
+static void lsa_inject(struct event *t)
{
struct ospf_apiclient *cl;
struct in_addr ifaddr;
/* This thread handles asynchronous messages coming in from the OSPF
API server */
-static void lsa_read(struct thread *thread)
+static void lsa_read(struct event *thread)
{
struct ospf_apiclient *oclient;
int fd;
int main(int argc, char *argv[])
{
- struct thread thread;
+ struct event thread;
args = argv;
* @param thread
* @return 0.
*/
-static void ospf_abr_announce_non_dna_routers(struct thread *thread)
+static void ospf_abr_announce_non_dna_routers(struct event *thread)
{
struct ospf_area *area;
struct listnode *node;
zlog_debug("%s: Stop", __func__);
}
-static void ospf_abr_task_timer(struct thread *thread)
+static void ospf_abr_task_timer(struct event *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
XFREE(MTYPE_APISERVER, apiserv);
}
-void ospf_apiserver_read(struct thread *thread)
+void ospf_apiserver_read(struct event *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
msg_free(msg);
}
-void ospf_apiserver_sync_write(struct thread *thread)
+void ospf_apiserver_sync_write(struct event *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
}
-void ospf_apiserver_async_write(struct thread *thread)
+void ospf_apiserver_async_write(struct event *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
/* Accept connection request from external applications. For each
accepted connection allocate own connection instance. */
-void ospf_apiserver_accept(struct thread *thread)
+void ospf_apiserver_accept(struct event *thread)
{
int accept_sock;
int new_sync_sock;
struct msg_fifo *out_async_fifo;
/* Read and write threads */
- struct thread *t_sync_read;
+ struct event *t_sync_read;
#ifdef USE_ASYNC_READ
- struct thread *t_async_read;
+ struct event *t_async_read;
#endif /* USE_ASYNC_READ */
- struct thread *t_sync_write;
- struct thread *t_async_write;
+ struct event *t_sync_write;
+ struct event *t_async_write;
};
enum ospf_apiserver_event {
extern void ospf_apiserver_event(enum ospf_apiserver_event event, int fd,
struct ospf_apiserver *apiserv);
extern int ospf_apiserver_serv_sock_family(unsigned short port, int family);
-extern void ospf_apiserver_accept(struct thread *thread);
-extern void ospf_apiserver_read(struct thread *thread);
-extern void ospf_apiserver_sync_write(struct thread *thread);
-extern void ospf_apiserver_async_write(struct thread *thread);
+extern void ospf_apiserver_accept(struct event *thread);
+extern void ospf_apiserver_read(struct event *thread);
+extern void ospf_apiserver_sync_write(struct event *thread);
+extern void ospf_apiserver_async_write(struct event *thread);
extern int ospf_apiserver_send_reply(struct ospf_apiserver *apiserv,
uint32_t seqnr, uint8_t rc);
/* If there's redistribution configured, we need to refresh external
* LSAs in order to install Type-7 and flood to all NSSA Areas
*/
-static void ospf_asbr_nssa_redist_update_timer(struct thread *thread)
+static void ospf_asbr_nssa_redist_update_timer(struct event *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
int type;
}
}
-static void ospf_asbr_external_aggr_process(struct thread *thread)
+static void ospf_asbr_external_aggr_process(struct event *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
int operation = 0;
return 0;
}
-static void ospf_ase_calculate_timer(struct thread *t)
+static void ospf_ase_calculate_timer(struct event *t)
{
struct ospf *ospf;
struct ospf_lsa *lsa;
return buf;
}
-const char *ospf_timer_dump(struct thread *t, char *buf, size_t size)
+const char *ospf_timer_dump(struct event *t, char *buf, size_t size)
{
struct timeval result;
if (!t)
extern int ospf_nbr_ism_state(struct ospf_neighbor *nbr);
extern void ospf_nbr_ism_state_message(struct ospf_neighbor *nbr, char *buf,
size_t size);
-extern const char *ospf_timer_dump(struct thread *, char *, size_t);
+extern const char *ospf_timer_dump(struct event *, char *, size_t);
extern const char *ospf_timeval_dump(struct timeval *, char *, size_t);
extern void ospf_packet_dump(struct stream *);
extern void ospf_debug_init(void);
}
/* Handling of grace period expiry. */
-static void ospf_gr_grace_period_expired(struct thread *thread)
+static void ospf_gr_grace_period_expired(struct event *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
* helper until this timer until
* this timer expires.
*/
- struct thread *t_grace_timer;
+ struct event *t_grace_timer;
/* Helper status */
uint32_t gr_helper_status;
* Returns:
* Nothing
*/
-static void ospf_handle_grace_timer_expiry(struct thread *thread)
+static void ospf_handle_grace_timer_expiry(struct event *thread)
{
struct ospf_neighbor *nbr = THREAD_ARG(thread);
uint32_t v_ls_ack; /* Delayed Link State Acknowledgment */
/* Threads. */
- struct thread *t_hello; /* timer */
- struct thread *t_wait; /* timer */
- struct thread *t_ls_ack; /* timer */
- struct thread *t_ls_ack_direct; /* event */
- struct thread *t_ls_upd_event; /* event */
- struct thread *t_opaque_lsa_self; /* Type-9 Opaque-LSAs */
+ struct event *t_hello; /* timer */
+ struct event *t_wait; /* timer */
+ struct event *t_ls_ack; /* timer */
+ struct event *t_ls_ack_direct; /* event */
+ struct event *t_ls_upd_event; /* event */
+ struct event *t_opaque_lsa_self; /* Type-9 Opaque-LSAs */
int on_write_q;
}
-void ospf_hello_timer(struct thread *thread)
+void ospf_hello_timer(struct event *thread)
{
struct ospf_interface *oi;
OSPF_HELLO_TIMER_ON(oi);
}
-static void ospf_wait_timer(struct thread *thread)
+static void ospf_wait_timer(struct event *thread)
{
struct ospf_interface *oi;
}
/* Execute ISM event process. */
-void ospf_ism_event(struct thread *thread)
+void ospf_ism_event(struct event *thread)
{
int event;
int next_state;
thread_execute(master, ospf_ism_event, (I), (E))
/* Prototypes. */
-extern void ospf_ism_event(struct thread *thread);
+extern void ospf_ism_event(struct event *thread);
extern void ism_change_status(struct ospf_interface *, int);
-extern void ospf_hello_timer(struct thread *thread);
+extern void ospf_hello_timer(struct event *thread);
extern int ospf_dr_election(struct ospf_interface *oi);
DECLARE_HOOK(ospf_ism_change,
/*
* LDP-SYNC holddown timer routines
*/
-static void ospf_ldp_sync_holddown_timer(struct thread *thread)
+static void ospf_ldp_sync_holddown_timer(struct event *thread)
{
struct interface *ifp;
struct ospf_if_params *params;
stream_putw_at(*s, putp, cnt);
}
-static void ospf_stub_router_timer(struct thread *t)
+static void ospf_stub_router_timer(struct event *t)
{
struct ospf_area *area = THREAD_ARG(t);
}
-void ospf_maxage_lsa_remover(struct thread *thread)
+void ospf_maxage_lsa_remover(struct event *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct ospf_lsa *lsa, *old;
}
/* Periodical check of MaxAge LSA. */
-void ospf_lsa_maxage_walker(struct thread *thread)
+void ospf_lsa_maxage_walker(struct event *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct route_node *rn;
struct ospf_lsa *lsa;
};
-static void ospf_lsa_action(struct thread *t)
+static void ospf_lsa_action(struct event *t)
{
struct lsa_action *data;
}
}
-void ospf_lsa_refresh_walker(struct thread *t)
+void ospf_lsa_refresh_walker(struct event *t)
{
struct list *refresh_list;
struct listnode *node, *nnode;
extern void ospf_lsa_maxage(struct ospf *, struct ospf_lsa *);
extern uint32_t get_metric(uint8_t *);
-extern void ospf_lsa_maxage_walker(struct thread *thread);
+extern void ospf_lsa_maxage_walker(struct event *thread);
extern struct ospf_lsa *ospf_lsa_refresh(struct ospf *, struct ospf_lsa *);
extern void ospf_external_lsa_refresh_default(struct ospf *);
extern void ospf_refresher_register_lsa(struct ospf *, struct ospf_lsa *);
extern void ospf_refresher_unregister_lsa(struct ospf *, struct ospf_lsa *);
-extern void ospf_lsa_refresh_walker(struct thread *thread);
+extern void ospf_lsa_refresh_walker(struct event *thread);
extern void ospf_lsa_maxage_delete(struct ospf *, struct ospf_lsa *);
struct ospf_lsa *lsa);
extern void ospf_flush_lsa_from_area(struct ospf *ospf, struct in_addr area_id,
int type);
-extern void ospf_maxage_lsa_remover(struct thread *thread);
+extern void ospf_maxage_lsa_remover(struct event *thread);
extern bool ospf_check_dna_lsa(const struct ospf_lsa *lsa);
extern void ospf_refresh_area_self_lsas(struct ospf_area *area);
uint32_t v_ls_upd;
/* Threads. */
- struct thread *t_inactivity;
- struct thread *t_db_desc;
- struct thread *t_ls_req;
- struct thread *t_ls_upd;
- struct thread *t_hello_reply;
+ struct event *t_inactivity;
+ struct event *t_db_desc;
+ struct event *t_ls_req;
+ struct event *t_ls_upd;
+ struct event *t_hello_reply;
/* NBMA configured neighbour */
struct ospf_nbr_nbma *nbr_nbma;
static void nsm_clear_adj(struct ospf_neighbor *);
/* OSPF NSM Timer functions. */
-static void ospf_inactivity_timer(struct thread *thread)
+static void ospf_inactivity_timer(struct event *thread)
{
struct ospf_neighbor *nbr;
}
}
-static void ospf_db_desc_timer(struct thread *thread)
+static void ospf_db_desc_timer(struct event *thread)
{
struct ospf_neighbor *nbr;
}
/* Execute NSM event process. */
-void ospf_nsm_event(struct thread *thread)
+void ospf_nsm_event(struct event *thread)
{
int event;
int next_state;
thread_execute(master, ospf_nsm_event, (N), (E))
/* Prototypes. */
-extern void ospf_nsm_event(struct thread *);
+extern void ospf_nsm_event(struct event *);
extern void ospf_check_nbr_loading(struct ospf_neighbor *);
extern int ospf_db_summary_isempty(struct ospf_neighbor *);
extern int ospf_db_summary_count(struct ospf_neighbor *);
* to (re-)originate their own Opaque-LSAs out-of-sync with others.
* This thread is prepared for that specific purpose.
*/
- struct thread *t_opaque_lsa_self;
+ struct event *t_opaque_lsa_self;
/*
* Backpointer to an "owner" which is LSA-type dependent.
uint32_t opaque_id;
/* Thread for refresh/flush scheduling for this opaque-type/id. */
- struct thread *t_opaque_lsa_self;
+ struct event *t_opaque_lsa_self;
/* Backpointer to Opaque-LSA control information per opaque-type. */
struct opaque_info_per_type *opqctl_type;
* Following are Opaque-LSA origination/refresh management functions.
*------------------------------------------------------------------------*/
-static void ospf_opaque_type9_lsa_originate(struct thread *t);
-static void ospf_opaque_type10_lsa_originate(struct thread *t);
-static void ospf_opaque_type11_lsa_originate(struct thread *t);
+static void ospf_opaque_type9_lsa_originate(struct event *t);
+static void ospf_opaque_type10_lsa_originate(struct event *t);
+static void ospf_opaque_type11_lsa_originate(struct event *t);
static void ospf_opaque_lsa_reoriginate_resume(struct list *listtop, void *arg);
void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
*delay0 = delay;
}
-static void ospf_opaque_type9_lsa_originate(struct thread *t)
+static void ospf_opaque_type9_lsa_originate(struct event *t)
{
struct ospf_interface *oi;
opaque_lsa_originate_callback(ospf_opaque_type9_funclist, oi);
}
-static void ospf_opaque_type10_lsa_originate(struct thread *t)
+static void ospf_opaque_type10_lsa_originate(struct event *t)
{
struct ospf_area *area;
opaque_lsa_originate_callback(ospf_opaque_type10_funclist, area);
}
-static void ospf_opaque_type11_lsa_originate(struct thread *t)
+static void ospf_opaque_type11_lsa_originate(struct event *t)
{
struct ospf *top;
static struct ospf_lsa *pseudo_lsa(struct ospf_interface *oi,
struct ospf_area *area, uint8_t lsa_type,
uint8_t opaque_type);
-static void ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t);
-static void ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t);
-static void ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t);
-static void ospf_opaque_lsa_refresh_timer(struct thread *t);
+static void ospf_opaque_type9_lsa_reoriginate_timer(struct event *t);
+static void ospf_opaque_type10_lsa_reoriginate_timer(struct event *t);
+static void ospf_opaque_type11_lsa_reoriginate_timer(struct event *t);
+static void ospf_opaque_lsa_refresh_timer(struct event *t);
void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
uint8_t lsa_type, uint8_t opaque_type)
struct ospf_lsa *lsa;
struct opaque_info_per_type *oipt;
- void (*func)(struct thread * t) = NULL;
+ void (*func)(struct event * t) = NULL;
int delay;
switch (lsa_type) {
return &lsa;
}
-static void ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
+static void ospf_opaque_type9_lsa_reoriginate_timer(struct event *t)
{
struct opaque_info_per_type *oipt;
struct ospf_opaque_functab *functab;
(*functab->lsa_originator)(oi);
}
-static void ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
+static void ospf_opaque_type10_lsa_reoriginate_timer(struct event *t)
{
struct opaque_info_per_type *oipt;
struct ospf_opaque_functab *functab;
(*functab->lsa_originator)(area);
}
-static void ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t)
+static void ospf_opaque_type11_lsa_reoriginate_timer(struct event *t)
{
struct opaque_info_per_type *oipt;
struct ospf_opaque_functab *functab;
return;
}
-static void ospf_opaque_lsa_refresh_timer(struct thread *t)
+static void ospf_opaque_lsa_refresh_timer(struct event *t)
{
struct opaque_info_per_id *oipi;
struct ospf_opaque_functab *functab;
}
-static void ospf_ls_req_timer(struct thread *thread)
+static void ospf_ls_req_timer(struct event *thread)
{
struct ospf_neighbor *nbr;
/* Cyclic timer function. Fist registered in ospf_nbr_new () in
ospf_neighbor.c */
-void ospf_ls_upd_timer(struct thread *thread)
+void ospf_ls_upd_timer(struct event *thread)
{
struct ospf_neighbor *nbr;
OSPF_NSM_TIMER_ON(nbr->t_ls_upd, ospf_ls_upd_timer, nbr->v_ls_upd);
}
-void ospf_ls_ack_timer(struct thread *thread)
+void ospf_ls_ack_timer(struct event *thread)
{
struct ospf_interface *oi;
}
#endif /* WANT_OSPF_WRITE_FRAGMENT */
-static void ospf_write(struct thread *thread)
+static void ospf_write(struct event *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct ospf_interface *oi;
}
/* Starting point of packet process function. */
-void ospf_read(struct thread *thread)
+void ospf_read(struct event *thread)
{
struct ospf *ospf;
int32_t count = 0;
ospf_hello_send_sub(oi, nbr_nbma->addr.s_addr);
}
-void ospf_poll_timer(struct thread *thread)
+void ospf_poll_timer(struct event *thread)
{
struct ospf_nbr_nbma *nbr_nbma;
}
-void ospf_hello_reply_timer(struct thread *thread)
+void ospf_hello_reply_timer(struct event *thread)
{
struct ospf_neighbor *nbr;
ospf_packet_add(oi, op);
/* Call ospf_write() right away to send ospf packets to neighbors */
if (send_lsupd_now) {
- struct thread os_packet_thd;
+ struct event os_packet_thd;
os_packet_thd.arg = (void *)oi->ospf;
if (oi->on_write_q == 0) {
}
}
-static void ospf_ls_upd_send_queue_event(struct thread *thread)
+static void ospf_ls_upd_send_queue_event(struct event *thread)
{
struct ospf_interface *oi = THREAD_ARG(thread);
struct route_node *rn;
OSPF_ISM_WRITE_ON(oi->ospf);
}
-static void ospf_ls_ack_send_event(struct thread *thread)
+static void ospf_ls_ack_send_event(struct event *thread)
{
struct ospf_interface *oi = THREAD_ARG(thread);
extern void ospf_fifo_flush(struct ospf_fifo *);
extern void ospf_fifo_free(struct ospf_fifo *);
-extern void ospf_read(struct thread *thread);
+extern void ospf_read(struct event *thread);
extern void ospf_hello_send(struct ospf_interface *);
extern void ospf_db_desc_send(struct ospf_neighbor *);
extern void ospf_db_desc_resend(struct ospf_neighbor *);
extern void ospf_ls_retransmit(struct ospf_interface *, struct ospf_lsa *);
extern void ospf_ls_req_event(struct ospf_neighbor *);
-extern void ospf_ls_upd_timer(struct thread *thread);
-extern void ospf_ls_ack_timer(struct thread *thread);
-extern void ospf_poll_timer(struct thread *thread);
-extern void ospf_hello_reply_timer(struct thread *thread);
+extern void ospf_ls_upd_timer(struct event *thread);
+extern void ospf_ls_ack_timer(struct event *thread);
+extern void ospf_poll_timer(struct event *thread);
+extern void ospf_hello_reply_timer(struct event *thread);
extern const struct message ospf_packet_type_str[];
extern const size_t ospf_packet_type_str_max;
}
/* Worker for SPF calculation scheduler. */
-static void ospf_spf_calculate_schedule_worker(struct thread *thread)
+static void ospf_spf_calculate_schedule_worker(struct event *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct route_table *new_table, *new_rtrs;
*
* @return 1 on success
*/
-static void sr_start_label_manager(struct thread *start)
+static void sr_start_label_manager(struct event *start)
{
struct ospf *ospf;
uint8_t msd;
/* Thread timer to start Label Manager */
- struct thread *t_start_lm;
+ struct event *t_start_lm;
};
/* Structure aggregating all received SR info from LSAs by node */
* Function to originate or flush default after applying
* route-map on all ei.
*/
-static void ospf_external_lsa_default_routemap_timer(struct thread *thread)
+static void ospf_external_lsa_default_routemap_timer(struct event *thread)
{
struct list *ext_list;
struct ospf *ospf = THREAD_ARG(thread);
}
/* distribute-list update timer. */
-static void ospf_distribute_list_update_timer(struct thread *thread)
+static void ospf_distribute_list_update_timer(struct event *thread)
{
struct route_node *rn;
struct external_info *ei;
}
/* Timer thread for G-R */
-static void ospf_deferred_shutdown_timer(struct thread *t)
+static void ospf_deferred_shutdown_timer(struct event *t)
{
struct ospf *ospf = THREAD_ARG(t);
bool prepare_in_progress;
bool finishing_restart;
uint32_t grace_period;
- struct thread *t_grace_period;
+ struct event *t_grace_period;
};
/* OSPF instance structure. */
int redistribute; /* Num of redistributed protocols. */
/* Threads. */
- struct thread *t_abr_task; /* ABR task timer. */
- struct thread *t_abr_fr; /* ABR FR timer. */
- struct thread *t_asbr_check; /* ASBR check timer. */
- struct thread *t_asbr_nssa_redist_update; /* ASBR NSSA redistribution
+ struct event *t_abr_task; /* ABR task timer. */
+ struct event *t_abr_fr; /* ABR FR timer. */
+ struct event *t_asbr_check; /* ASBR check timer. */
+ struct event *t_asbr_nssa_redist_update; /* ASBR NSSA redistribution
update timer. */
- struct thread *t_distribute_update; /* Distirbute list update timer. */
- struct thread *t_spf_calc; /* SPF calculation timer. */
- struct thread *t_ase_calc; /* ASE calculation timer. */
- struct thread
- *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
- struct thread *t_sr_update; /* Segment Routing update timer */
+ struct event *t_distribute_update; /* Distirbute list update timer. */
+ struct event *t_spf_calc; /* SPF calculation timer. */
+ struct event *t_ase_calc; /* ASE calculation timer. */
+ struct event *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
+ struct event *t_sr_update; /* Segment Routing update timer */
unsigned int maxage_delay; /* Delay on Maxage remover timer, sec */
- struct thread *t_maxage; /* MaxAge LSA remover timer. */
- struct thread *t_maxage_walker; /* MaxAge LSA checking timer. */
+ struct event *t_maxage; /* MaxAge LSA remover timer. */
+ struct event *t_maxage_walker; /* MaxAge LSA checking timer. */
- struct thread
+ struct event
*t_deferred_shutdown; /* deferred/stub-router shutdown timer*/
- struct thread *t_write;
+ struct event *t_write;
#define OSPF_WRITE_INTERFACE_COUNT_DEFAULT 20
- struct thread *t_default_routemap_timer;
+ struct event *t_default_routemap_timer;
int write_oi_count; /* Num of packets sent per thread invocation */
- struct thread *t_read;
+ struct event *t_read;
int fd;
struct stream *ibuf;
struct list *oi_write_q;
struct list *qs[OSPF_LSA_REFRESHER_SLOTS];
} lsa_refresh_queue;
- struct thread *t_lsa_refresher;
+ struct event *t_lsa_refresher;
time_t lsa_refresher_started;
#define OSPF_LSA_REFRESH_INTERVAL_DEFAULT 10
uint16_t lsa_refresh_interval;
/* delay timer to process external routes
* with summary address.
*/
- struct thread *t_external_aggr;
+ struct event *t_external_aggr;
/* delay interval in seconds */
uint16_t aggr_delay_interval;
struct p_spaces_head *p_spaces;
/* Threads. */
- struct thread *t_stub_router; /* Stub-router timer */
- struct thread *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
+ struct event *t_stub_router; /* Stub-router timer */
+ struct event *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
/* Statistics field. */
uint32_t spf_calculation; /* SPF Calculation Count. */
uint32_t v_poll;
/* Poll timer thread. */
- struct thread *t_poll;
+ struct event *t_poll;
/* State change. */
uint32_t state_change;
/* Internal Functions Called From Main Thread */
static int pcep_ctrl_halt_cb(struct frr_pthread *fpt, void **res);
-static void pcep_refine_path_event_cb(struct thread *thread);
+static void pcep_refine_path_event_cb(struct event *thread);
/* Internal Functions Called From Controller Thread */
-static void pcep_thread_finish_event_handler(struct thread *thread);
+static void pcep_thread_finish_event_handler(struct event *thread);
/* Controller Thread Timer Handler */
static int schedule_thread_timer(struct ctrl_state *ctrl_state, int pcc_id,
enum pcep_ctrl_timer_type timer_type,
enum pcep_ctrl_timeout_type timeout_type,
uint32_t delay, void *payload,
- struct thread **thread);
+ struct event **thread);
static int schedule_thread_timer_with_cb(
struct ctrl_state *ctrl_state, int pcc_id,
enum pcep_ctrl_timer_type timer_type,
enum pcep_ctrl_timeout_type timeout_type, uint32_t delay, void *payload,
- struct thread **thread, pcep_ctrl_thread_callback timer_cb);
-static void pcep_thread_timer_handler(struct thread *thread);
+ struct event **thread, pcep_ctrl_thread_callback timer_cb);
+static void pcep_thread_timer_handler(struct event *thread);
/* Controller Thread Socket read/write Handler */
static int schedule_thread_socket(struct ctrl_state *ctrl_state, int pcc_id,
enum pcep_ctrl_socket_type type, bool is_read,
- void *payload, int fd, struct thread **thread,
+ void *payload, int fd, struct event **thread,
pcep_ctrl_thread_callback cb);
/* Controller Thread Event Handler */
enum pcep_ctrl_event_type type,
uint32_t sub_type, void *payload,
pcep_ctrl_thread_callback event_cb);
-static void pcep_thread_event_handler(struct thread *thread);
+static void pcep_thread_event_handler(struct event *thread);
static int pcep_thread_event_update_pcc_options(struct ctrl_state *ctrl_state,
struct pcc_opts *opts);
static int pcep_thread_event_update_pce_options(struct ctrl_state *ctrl_state,
/* Main Thread Event Handler */
static int send_to_main(struct ctrl_state *ctrl_state, int pcc_id,
enum pcep_main_event_type type, void *payload);
-static void pcep_main_event_handler(struct thread *thread);
+static void pcep_main_event_handler(struct event *thread);
/* Helper functions */
static void set_ctrl_state(struct frr_pthread *fpt,
return 0;
}
-void pcep_refine_path_event_cb(struct thread *thread)
+void pcep_refine_path_event_cb(struct event *thread)
{
struct pcep_refine_path_event_data *data = THREAD_ARG(thread);
assert(data != NULL);
void pcep_thread_schedule_sync_best_pce(struct ctrl_state *ctrl_state,
int pcc_id, int delay,
- struct thread **thread)
+ struct event **thread)
{
schedule_thread_timer(ctrl_state, pcc_id, TM_CALCULATE_BEST_PCE,
TO_UNDEFINED, delay, NULL, thread);
}
-void pcep_thread_cancel_timer(struct thread **thread)
+void pcep_thread_cancel_timer(struct event **thread)
{
if (thread == NULL || *thread == NULL) {
return;
}
void pcep_thread_schedule_reconnect(struct ctrl_state *ctrl_state, int pcc_id,
- int retry_count, struct thread **thread)
+ int retry_count, struct event **thread)
{
uint32_t delay = backoff_delay(MAX_RECONNECT_DELAY, 1, retry_count);
PCEP_DEBUG("Schedule RECONNECT_PCC for %us (retry %u)", delay,
void pcep_thread_schedule_timeout(struct ctrl_state *ctrl_state, int pcc_id,
enum pcep_ctrl_timeout_type timeout_type,
uint32_t delay, void *param,
- struct thread **thread)
+ struct event **thread)
{
assert(timeout_type > TO_UNDEFINED);
assert(timeout_type < TO_MAX);
void pcep_thread_schedule_pceplib_timer(struct ctrl_state *ctrl_state,
int delay, void *payload,
- struct thread **thread,
+ struct event **thread,
pcep_ctrl_thread_callback timer_cb)
{
PCEP_DEBUG("Schedule PCEPLIB_TIMER for %us", delay);
void pcep_thread_schedule_session_timeout(struct ctrl_state *ctrl_state,
int pcc_id, int delay,
- struct thread **thread)
+ struct event **thread)
{
PCEP_DEBUG("Schedule session_timeout interval for %us", delay);
schedule_thread_timer(ctrl_state, pcc_id, TM_SESSION_TIMEOUT_PCC,
/* ------------ Internal Functions Called From Controller Thread ------------ */
-void pcep_thread_finish_event_handler(struct thread *thread)
+void pcep_thread_finish_event_handler(struct event *thread)
{
int i;
struct frr_pthread *fpt = THREAD_ARG(thread);
enum pcep_ctrl_timer_type timer_type,
enum pcep_ctrl_timeout_type timeout_type,
uint32_t delay, void *payload,
- struct thread **thread,
+ struct event **thread,
pcep_ctrl_thread_callback timer_cb)
{
assert(thread != NULL);
int schedule_thread_timer(struct ctrl_state *ctrl_state, int pcc_id,
enum pcep_ctrl_timer_type timer_type,
enum pcep_ctrl_timeout_type timeout_type,
- uint32_t delay, void *payload, struct thread **thread)
+ uint32_t delay, void *payload, struct event **thread)
{
return schedule_thread_timer_with_cb(ctrl_state, pcc_id, timer_type,
timeout_type, delay, payload,
thread, pcep_thread_timer_handler);
}
-void pcep_thread_timer_handler(struct thread *thread)
+void pcep_thread_timer_handler(struct event *thread)
{
/* data unpacking */
struct pcep_ctrl_timer_data *data = THREAD_ARG(thread);
}
}
-void pcep_thread_pcep_event(struct thread *thread)
+void pcep_thread_pcep_event(struct event *thread)
{
struct pcep_ctrl_event_data *data = THREAD_ARG(thread);
assert(data != NULL);
int schedule_thread_socket(struct ctrl_state *ctrl_state, int pcc_id,
enum pcep_ctrl_socket_type type, bool is_read,
- void *payload, int fd, struct thread **thread,
+ void *payload, int fd, struct event **thread,
pcep_ctrl_thread_callback socket_cb)
{
assert(thread != NULL);
struct ctrl_state *ctrl_state = ((struct frr_pthread *)fpt)->data;
return schedule_thread_socket(ctrl_state, 0, SOCK_PCEPLIB, false,
- payload, fd, (struct thread **)thread,
+ payload, fd, (struct event **)thread,
socket_cb);
}
struct ctrl_state *ctrl_state = ((struct frr_pthread *)fpt)->data;
return schedule_thread_socket(ctrl_state, 0, SOCK_PCEPLIB, true,
- payload, fd, (struct thread **)thread,
+ payload, fd, (struct event **)thread,
socket_cb);
}
return 0;
}
-void pcep_thread_event_handler(struct thread *thread)
+void pcep_thread_event_handler(struct event *thread)
{
/* data unpacking */
struct pcep_ctrl_event_data *data = THREAD_ARG(thread);
return 0;
}
-void pcep_main_event_handler(struct thread *thread)
+void pcep_main_event_handler(struct event *thread)
{
/* data unpacking */
struct pcep_main_event_data *data = THREAD_ARG(thread);
void *payload;
};
-typedef void (*pcep_ctrl_thread_callback)(struct thread *);
+typedef void (*pcep_ctrl_thread_callback)(struct event *);
/* PCC connection information, populated in a thread-safe
* manner with pcep_ctrl_get_pcc_info() */
struct path *path);
void pcep_thread_initiate_path(struct ctrl_state *ctrl_state, int pcc_id,
struct path *path);
-void pcep_thread_cancel_timer(struct thread **thread);
+void pcep_thread_cancel_timer(struct event **thread);
void pcep_thread_schedule_reconnect(struct ctrl_state *ctrl_state, int pcc_id,
- int retry_count, struct thread **thread);
+ int retry_count, struct event **thread);
void pcep_thread_schedule_timeout(struct ctrl_state *ctrl_state, int pcc_id,
enum pcep_ctrl_timeout_type type,
uint32_t delay, void *param,
- struct thread **thread);
+ struct event **thread);
void pcep_thread_schedule_session_timeout(struct ctrl_state *ctrl_state,
int pcc_id, int delay,
- struct thread **thread);
+ struct event **thread);
void pcep_thread_remove_candidate_path_segments(struct ctrl_state *ctrl_state,
struct pcc_state *pcc_state);
void pcep_thread_schedule_sync_best_pce(struct ctrl_state *ctrl_state,
int pcc_id, int delay,
- struct thread **thread);
+ struct event **thread);
void pcep_thread_schedule_pceplib_timer(struct ctrl_state *ctrl_state,
int delay, void *payload,
- struct thread **thread,
+ struct event **thread,
pcep_ctrl_thread_callback cb);
int pcep_thread_socket_read(void *fpt, void **thread, int fd, void *payload,
pcep_ctrl_thread_callback cb);
int pcep_thread_send_ctrl_event(void *fpt, void *payload,
pcep_ctrl_thread_callback cb);
-void pcep_thread_pcep_event(struct thread *thread);
+void pcep_thread_pcep_event(struct event *thread);
int pcep_thread_pcc_count(struct ctrl_state *ctrl_state);
/* Called by the PCC to refine a path in the main thread */
int pcep_thread_refine_path(struct ctrl_state *ctrl_state, int pcc_id,
void *payload);
static int pcep_lib_pceplib_socket_write_cb(void *fpt, void **thread, int fd,
void *payload);
-static void pcep_lib_socket_read_ready(struct thread *thread);
-static void pcep_lib_socket_write_ready(struct thread *thread);
+static void pcep_lib_socket_read_ready(struct event *thread);
+static void pcep_lib_socket_write_ready(struct event *thread);
/* pceplib pcep_event callbacks */
static void pcep_lib_pceplib_event_cb(void *fpt, pcep_event *event);
/* Callbacks called by path_pcep_controller when a socket is ready to read/write
*/
-void pcep_lib_socket_write_ready(struct thread *thread)
+void pcep_lib_socket_write_ready(struct event *thread)
{
struct pcep_ctrl_socket_data *data = THREAD_ARG(thread);
assert(data != NULL);
XFREE(MTYPE_PCEP, data);
}
-void pcep_lib_socket_read_ready(struct thread *thread)
+void pcep_lib_socket_read_ready(struct event *thread)
{
struct pcep_ctrl_socket_data *data = THREAD_ARG(thread);
assert(data != NULL);
struct req_entry {
RB_ENTRY(req_entry) entry;
- struct thread *t_retry;
+ struct event *t_retry;
int retry_count;
bool was_sent;
struct path *path;
pcep_session *sess;
uint32_t retry_count;
bool synchronized;
- struct thread *t_reconnect;
- struct thread *t_update_best;
- struct thread *t_session_timeout;
+ struct event *t_reconnect;
+ struct event *t_update_best;
+ struct event *t_session_timeout;
uint32_t next_reqid;
uint32_t next_plspid;
struct plspid_map_head plspid_map;
static uint32_t path_ted_start_importing_igp(const char *daemon_str);
static uint32_t path_ted_stop_importing_igp(void);
static enum zclient_send_status path_ted_link_state_sync(void);
-static void path_ted_timer_handler_sync(struct thread *thread);
-static void path_ted_timer_handler_refresh(struct thread *thread);
+static void path_ted_timer_handler_sync(struct event *thread);
+static void path_ted_timer_handler_refresh(struct event *thread);
static int path_ted_cli_debug_config_write(struct vty *vty);
static int path_ted_cli_debug_set_all(uint32_t flags, bool set);
*
* @return status
*/
-void path_ted_timer_handler_sync(struct thread *thread)
+void path_ted_timer_handler_sync(struct event *thread)
{
/* data unpacking */
struct ted_state *data = THREAD_ARG(thread);
*
* @return status
*/
-void path_ted_timer_handler_refresh(struct thread *thread)
+void path_ted_timer_handler_refresh(struct event *thread)
{
if (!path_ted_is_initialized())
return;
/* The TED itself as in link_state.h */
struct ls_ted *ted;
/* Timer for ted sync */
- struct thread *t_link_state_sync;
+ struct event *t_link_state_sync;
/* Timer for refresh sid in segment list */
- struct thread *t_segment_list_refresh;
+ struct event *t_segment_list_refresh;
/* delay interval in seconds */
uint32_t link_state_delay_interval;
/* delay interval refresh in seconds */
static void trigger_pathd_candidate_created(struct srte_candidate *candidate);
-static void trigger_pathd_candidate_created_timer(struct thread *thread);
+static void trigger_pathd_candidate_created_timer(struct event *thread);
static void trigger_pathd_candidate_updated(struct srte_candidate *candidate);
-static void trigger_pathd_candidate_updated_timer(struct thread *thread);
+static void trigger_pathd_candidate_updated_timer(struct event *thread);
static void trigger_pathd_candidate_removed(struct srte_candidate *candidate);
static const char *
srte_candidate_metric_name(enum srte_candidate_metric_type type);
(void *)candidate, HOOK_DELAY, &candidate->hook_timer);
}
-void trigger_pathd_candidate_created_timer(struct thread *thread)
+void trigger_pathd_candidate_created_timer(struct event *thread)
{
struct srte_candidate *candidate = THREAD_ARG(thread);
candidate->hook_timer = NULL;
(void *)candidate, HOOK_DELAY, &candidate->hook_timer);
}
-void trigger_pathd_candidate_updated_timer(struct thread *thread)
+void trigger_pathd_candidate_updated_timer(struct event *thread)
{
struct srte_candidate *candidate = THREAD_ARG(thread);
candidate->hook_timer = NULL;
uint32_t affinity_filters[MAX_AFFINITY_FILTER_TYPE];
/* Hooks delaying timer */
- struct thread *hook_timer;
+ struct event *hook_timer;
};
RB_HEAD(srte_candidate_head, srte_candidate);
DEFINE_MTYPE_STATIC(PIMD, GM_GRP_PENDING, "MLD group query state");
DEFINE_MTYPE_STATIC(PIMD, GM_GSQ_PENDING, "MLD group/source query aggregate");
-static void gm_t_query(struct thread *t);
+static void gm_t_query(struct event *t);
static void gm_trigger_specific(struct gm_sg *sg);
static void gm_sg_timer_start(struct gm_if *gm_ifp, struct gm_sg *sg,
struct timeval expire_wait);
* its own path too and won't hit this. This is really only triggered when a
* host straight up disappears.
*/
-static void gm_t_expire(struct thread *t)
+static void gm_t_expire(struct event *t)
{
struct gm_if *gm_ifp = THREAD_ARG(t);
struct gm_packet_state *pkt;
gm_ifp->n_pending, &pend->expiry);
}
-static void gm_t_sg_expire(struct thread *t)
+static void gm_t_sg_expire(struct event *t)
{
struct gm_sg *sg = THREAD_ARG(t);
struct gm_if *gm_ifp = sg->iface;
}
}
-static void gm_t_grp_expire(struct thread *t)
+static void gm_t_grp_expire(struct event *t)
{
/* if we're here, that means when we received the group-specific query
* there was one or more active S,G for this group. For *,G the timer
thread_execute(router->master, gm_t_query, gm_ifp, 0);
}
-static void gm_t_other_querier(struct thread *t)
+static void gm_t_other_querier(struct event *t)
{
struct gm_if *gm_ifp = THREAD_ARG(t);
struct pim_interface *pim_ifp = gm_ifp->ifp->info;
return false;
}
-static void gm_t_recv(struct thread *t)
+static void gm_t_recv(struct event *t)
{
struct pim_instance *pim = THREAD_ARG(t);
union {
}
}
-static void gm_t_query(struct thread *t)
+static void gm_t_query(struct event *t)
{
struct gm_if *gm_ifp = THREAD_ARG(t);
unsigned int timer_ms = gm_ifp->cur_query_intv;
gm_send_query(gm_ifp, PIMADDR_ANY, NULL, 0, false);
}
-static void gm_t_sg_query(struct thread *t)
+static void gm_t_sg_query(struct event *t)
{
struct gm_sg *sg = THREAD_ARG(t);
XFREE(MTYPE_GM_GSQ_PENDING, pend_gsq);
}
-static void gm_t_gsq_pend(struct thread *t)
+static void gm_t_gsq_pend(struct event *t)
{
struct gm_gsq_pending *pend_gsq = THREAD_ARG(t);
#include "typesafe.h"
#include "pim_addr.h"
-struct thread;
+struct event;
struct pim_instance;
struct gm_packet_sg;
struct gm_if;
* (implies we haven't received any report yet, since it's cancelled
* by that)
*/
- struct thread *t_sg_expire;
+ struct event *t_sg_expire;
/* last-member-left triggered queries (group/group-source specific)
*
* this timer will be running even if we aren't the elected querier,
* in case the election result changes midway through.
*/
- struct thread *t_sg_query;
+ struct event *t_sg_query;
/* we must keep sending (QRV) queries even if we get a positive
* response, to make sure other routers are updated. query_sbit
pim_addr grp;
struct timeval query;
- struct thread *t_expire;
+ struct event *t_expire;
};
/* guaranteed MTU for IPv6 is 1280 bytes. IPv6 header is 40 bytes, MLDv2
struct gm_gsq_pends_item itm;
struct gm_if *iface;
- struct thread *t_send;
+ struct event *t_send;
pim_addr grp;
bool s_bit;
struct gm_if {
struct interface *ifp;
struct pim_instance *pim;
- struct thread *t_query, *t_other_querier, *t_expire;
+ struct event *t_query, *t_other_querier, *t_expire;
bool stopping;
return pim_assert_do(ch, metric);
}
-static void on_assert_timer(struct thread *t)
+static void on_assert_timer(struct event *t)
{
struct pim_ifchannel *ch;
struct interface *ifp;
return bsgrp;
}
-static void pim_on_bs_timer(struct thread *t)
+static void pim_on_bs_timer(struct event *t)
{
struct route_node *rn;
struct bsm_scope *scope;
return true;
}
-static void pim_on_g2rp_timer(struct thread *t)
+static void pim_on_g2rp_timer(struct event *t)
{
struct bsm_rpinfo *bsrp;
struct bsm_rpinfo *bsrp_node;
struct bsm_frags_head bsm_frags[1];
struct route_table *bsrp_table; /* group2rp mapping rcvd from BSR */
- struct thread *bs_timer; /* Boot strap timer */
+ struct event *bs_timer; /* Boot strap timer */
};
/* BSM packet (= fragment) - this is stored as list in bsm_frags inside scope
uint16_t rp_holdtime; /* RP holdtime - g2rp timer value */
pim_addr rp_address; /* RP Address */
struct bsgrp_node *bsgrp_node; /* Back ptr to bsgrp_node */
- struct thread *g2rp_timer; /* Run only for elected RP node */
+ struct event *g2rp_timer; /* Run only for elected RP node */
};
extern int pim_bsm_rpinfo_cmp(const struct bsm_rpinfo *a,
struct gm_if *mld;
int pim_sock_fd; /* PIM socket file descriptor */
- struct thread *t_pim_sock_read; /* thread for reading PIM socket */
+ struct event *t_pim_sock_read; /* thread for reading PIM socket */
int64_t pim_sock_creation; /* timestamp of PIM socket creation */
- struct thread *t_pim_hello_timer;
+ struct event *t_pim_hello_timer;
int pim_hello_period;
int pim_default_holdtime;
int pim_triggered_hello_delay;
delete_on_noinfo(ch);
}
-static void on_ifjoin_expiry_timer(struct thread *t)
+static void on_ifjoin_expiry_timer(struct event *t)
{
struct pim_ifchannel *ch;
/* ch may have been deleted */
}
-static void on_ifjoin_prune_pending_timer(struct thread *t)
+static void on_ifjoin_prune_pending_timer(struct event *t)
{
struct pim_ifchannel *ch;
int send_prune_echo; /* boolean */
/* Per-interface (S,G) Join/Prune State (Section 4.1.4 of RFC4601) */
enum pim_ifjoin_state ifjoin_state;
- struct thread *t_ifjoin_expiry_timer;
- struct thread *t_ifjoin_prune_pending_timer;
+ struct event *t_ifjoin_expiry_timer;
+ struct event *t_ifjoin_prune_pending_timer;
int64_t ifjoin_creation; /* Record uptime of ifjoin state */
/* Per-interface (S,G) Assert State (Section 4.6.1 of RFC4601) */
enum pim_ifassert_state ifassert_state;
- struct thread *t_ifassert_timer;
+ struct event *t_ifassert_timer;
pim_addr ifassert_winner;
struct pim_assert_metric ifassert_winner_metric;
int64_t ifassert_creation; /* Record uptime of ifassert state */
#include "pim_tib.h"
static void group_timer_off(struct gm_group *group);
-static void pim_igmp_general_query(struct thread *t);
+static void pim_igmp_general_query(struct event *t);
void igmp_anysource_forward_start(struct pim_instance *pim,
struct gm_group *group)
return NULL;
}
-static void pim_igmp_other_querier_expire(struct thread *t)
+static void pim_igmp_other_querier_expire(struct event *t)
{
struct gm_sock *igmp;
}
/* Issue IGMP general query */
-static void pim_igmp_general_query(struct thread *t)
+static void pim_igmp_general_query(struct event *t)
{
struct gm_sock *igmp;
struct in_addr dst_addr;
static void igmp_read_on(struct gm_sock *igmp);
-static void pim_igmp_read(struct thread *t)
+static void pim_igmp_read(struct event *t)
{
uint8_t buf[10000];
struct gm_sock *igmp = (struct gm_sock *)THREAD_ARG(t);
source records. Source records whose timers are zero (from the
previous EXCLUDE mode) are deleted.
*/
-static void igmp_group_timer(struct thread *t)
+static void igmp_group_timer(struct event *t)
{
struct gm_group *group;
pim_addr ifaddr;
time_t sock_creation;
- struct thread *t_igmp_read; /* read: IGMP sockets */
- struct thread
- *t_igmp_query_timer; /* timer: issue IGMP general queries */
- struct thread *t_other_querier_timer; /* timer: other querier present */
+ struct event *t_igmp_read; /* read: IGMP sockets */
+ /* timer: issue IGMP general queries */
+ struct event *t_igmp_query_timer;
+ struct event *t_other_querier_timer; /* timer: other querier present */
pim_addr querier_addr; /* IP address of the querier */
int querier_query_interval; /* QQI */
int querier_robustness_variable; /* QRV */
struct gm_source {
pim_addr source_addr;
- struct thread *t_source_timer;
+ struct event *t_source_timer;
struct gm_group *source_group; /* back pointer */
time_t source_creation;
uint32_t source_flags;
represents the time for the *filter-mode* of the group to expire and
switch to INCLUDE mode.
*/
- struct thread *t_group_timer;
+ struct event *t_group_timer;
/* Shared between group-specific and
group-and-source-specific retransmissions */
- struct thread *t_group_query_retransmit_timer;
+ struct event *t_group_query_retransmit_timer;
/* Counter exclusive for group-specific retransmissions
(not used by group-and-source-specific retransmissions,
igmp_group_timer_on(group, group_membership_interval_msec, ifp->name);
}
-static void igmp_source_timer(struct thread *t)
+static void igmp_source_timer(struct event *t)
{
struct gm_source *source;
struct gm_group *group;
return num_retransmit_sources_left;
}
-static void igmp_group_retransmit(struct thread *t)
+static void igmp_group_retransmit(struct event *t)
{
struct gm_group *group;
int num_retransmit_sources_left;
/* Holds the client data(unencoded) that need to be pushed to MCLAGD*/
struct stream_fifo *mlag_fifo;
struct stream *mlag_stream;
- struct thread *zpthread_mlag_write;
+ struct event *zpthread_mlag_write;
struct in_addr anycast_vtep_ip;
struct in_addr local_vtep_ip;
struct pim_mlag_stats mlag_stats;
int send_v6_secondary;
- struct thread *thread;
+ struct event *thread;
int mroute_socket;
int reg_sock; /* Socket to send register msg */
int64_t mroute_socket_creation;
unsigned int gm_socket_if_count;
int gm_socket;
- struct thread *t_gm_recv;
+ struct event *t_gm_recv;
unsigned int gm_group_count;
unsigned int gm_watermark_limit;
uint64_t bsm_dropped;
/* If we need to rescan all our upstreams */
- struct thread *rpf_cache_refresher;
+ struct event *rpf_cache_refresher;
int64_t rpf_cache_refresh_requests;
int64_t rpf_cache_refresh_events;
int64_t rpf_cache_refresh_last;
return 0;
}
-static void pim_mlag_register_handler(struct thread *thread)
+static void pim_mlag_register_handler(struct event *thread)
{
uint32_t bit_mask = 0;
NULL);
}
-static void pim_mlag_deregister_handler(struct thread *thread)
+static void pim_mlag_deregister_handler(struct event *thread)
{
if (!zclient)
return;
return 0;
}
-static void mroute_read(struct thread *t)
+static void mroute_read(struct event *t)
{
struct pim_instance *pim;
static long long count;
}
/* RFC-3618:Sec-5.1 - global active source advertisement timer */
-static void pim_msdp_sa_adv_timer_cb(struct thread *t)
+static void pim_msdp_sa_adv_timer_cb(struct event *t)
{
struct pim_instance *pim = THREAD_ARG(t);
}
/* RFC-3618:Sec-5.3 - SA cache state timer */
-static void pim_msdp_sa_state_timer_cb(struct thread *t)
+static void pim_msdp_sa_state_timer_cb(struct event *t)
{
struct pim_msdp_sa *sa;
}
/* RFC-3618:Sec-5.4 - peer hold timer */
-static void pim_msdp_peer_hold_timer_cb(struct thread *t)
+static void pim_msdp_peer_hold_timer_cb(struct event *t)
{
struct pim_msdp_peer *mp;
/* RFC-3618:Sec-5.5 - peer keepalive timer */
-static void pim_msdp_peer_ka_timer_cb(struct thread *t)
+static void pim_msdp_peer_ka_timer_cb(struct event *t)
{
struct pim_msdp_peer *mp;
}
/* RFC-3618:Sec-5.6 - connection retry on active peer */
-static void pim_msdp_peer_cr_timer_cb(struct thread *t)
+static void pim_msdp_peer_cr_timer_cb(struct event *t)
{
struct pim_msdp_peer *mp;
/* rfc-3618 is missing default value for SA-hold-down-Period. pulled
* this number from industry-standards */
#define PIM_MSDP_SA_HOLD_TIME ((3*60)+30)
- struct thread *sa_state_timer; // 5.6
+ struct event *sa_state_timer; // 5.6
int64_t uptime;
struct pim_upstream *up;
/* protocol timers */
#define PIM_MSDP_PEER_HOLD_TIME 75
- struct thread *hold_timer; // 5.4
+ struct event *hold_timer; // 5.4
#define PIM_MSDP_PEER_KA_TIME 60
- struct thread *ka_timer; // 5.5
+ struct event *ka_timer; // 5.5
#define PIM_MSDP_PEER_CONNECT_RETRY_TIME 30
- struct thread *cr_timer; // 5.6
+ struct event *cr_timer; // 5.6
/* packet thread and buffers */
uint32_t packet_size;
struct stream *ibuf;
struct stream_fifo *obuf;
- struct thread *t_read;
- struct thread *t_write;
+ struct event *t_read;
+ struct event *t_write;
/* stats */
uint32_t conn_attempts;
struct pim_msdp_listener {
int fd;
union sockunion su;
- struct thread *thread;
+ struct event *thread;
};
struct pim_msdp {
/* MSDP active-source info */
#define PIM_MSDP_SA_ADVERTISMENT_TIME 60
- struct thread *sa_adv_timer; // 5.6
+ struct event *sa_adv_timer; // 5.6
struct hash *sa_hash;
struct list *sa_list;
uint32_t local_cnt;
void pim_msdp_peer_pkt_rxed(struct pim_msdp_peer *mp);
void pim_msdp_peer_stop_tcp_conn(struct pim_msdp_peer *mp, bool chg_state);
void pim_msdp_peer_reset_tcp_conn(struct pim_msdp_peer *mp, const char *rc_str);
-void pim_msdp_write(struct thread *thread);
+void pim_msdp_write(struct event *thread);
int pim_msdp_config_write(struct pim_instance *pim, struct vty *vty,
const char *spaces);
bool pim_msdp_peer_config_write(struct vty *vty, struct pim_instance *pim,
}
}
-void pim_msdp_write(struct thread *thread)
+void pim_msdp_write(struct event *thread)
{
struct pim_msdp_peer *mp;
struct stream *s;
return 0;
}
-void pim_msdp_read(struct thread *thread)
+void pim_msdp_read(struct event *thread)
{
struct pim_msdp_peer *mp;
int rc;
#define PIM_MSDP_PKT_TYPE_STRLEN 16
void pim_msdp_pkt_ka_tx(struct pim_msdp_peer *mp);
-void pim_msdp_read(struct thread *thread);
+void pim_msdp_read(struct event *thread);
void pim_msdp_pkt_sa_tx(struct pim_instance *pim);
void pim_msdp_pkt_sa_tx_one(struct pim_msdp_sa *sa);
void pim_msdp_pkt_sa_tx_to_one_peer(struct pim_msdp_peer *mp);
}
/* passive peer socket accept */
-static void pim_msdp_sock_accept(struct thread *thread)
+static void pim_msdp_sock_accept(struct event *thread)
{
union sockunion su;
struct pim_instance *pim = THREAD_ARG(thread);
}
}
-static void on_neighbor_timer(struct thread *t)
+static void on_neighbor_timer(struct event *t)
{
struct pim_neighbor *neigh;
struct interface *ifp;
neigh->holdtime, &neigh->t_expire_timer);
}
-static void on_neighbor_jp_timer(struct thread *t)
+static void on_neighbor_jp_timer(struct event *t)
{
struct pim_neighbor *neigh = THREAD_ARG(t);
struct pim_rpf rpf;
uint32_t dr_priority;
uint32_t generation_id;
struct list *prefix_list; /* list of struct prefix */
- struct thread *t_expire_timer;
+ struct event *t_expire_timer;
struct interface *interface;
- struct thread *jp_timer;
+ struct event *jp_timer;
struct list *upstream_jp_agg;
struct bfd_session_params *bfd_session;
};
#include "pim_bsm.h"
#include <lib/lib_errors.h>
-static void on_pim_hello_send(struct thread *t);
+static void on_pim_hello_send(struct event *t);
static const char *pim_pim_msgtype2str(enum pim_msg_type type)
{
static void pim_sock_read_on(struct interface *ifp);
-static void pim_sock_read(struct thread *t)
+static void pim_sock_read(struct event *t)
{
struct interface *ifp, *orig_ifp;
struct pim_interface *pim_ifp;
/*
Periodic hello timer
*/
-static void on_pim_hello_send(struct thread *t)
+static void on_pim_hello_send(struct event *t)
{
struct pim_interface *pim_ifp;
struct interface *ifp;
#include "pim_vxlan.h"
#include "pim_addr.h"
-struct thread *send_test_packet_timer = NULL;
+struct event *send_test_packet_timer = NULL;
void pim_register_join(struct pim_upstream *up)
{
return 0;
}
-static void ssmpingd_sock_read(struct thread *t)
+static void ssmpingd_sock_read(struct event *t)
{
struct ssmpingd_sock *ss;
struct pim_instance *pim;
int sock_fd; /* socket */
- struct thread *t_sock_read; /* thread for reading socket */
+ struct event *t_sock_read; /* thread for reading socket */
pim_addr source_addr; /* source address */
int64_t creation; /* timestamp of socket creation */
int64_t requests; /* counter */
return wr != 8;
}
-void pim_time_timer_to_mmss(char *buf, int buf_size, struct thread *t_timer)
+void pim_time_timer_to_mmss(char *buf, int buf_size, struct event *t_timer)
{
if (t_timer) {
pim_time_mmss(buf, buf_size,
}
}
-void pim_time_timer_to_hhmmss(char *buf, int buf_size, struct thread *t_timer)
+void pim_time_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
{
if (t_timer) {
pim_time_hhmmss(buf, buf_size,
snprintf(buf, buf_size, "--:--:--");
}
-long pim_time_timer_remain_msec(struct thread *t_timer)
+long pim_time_timer_remain_msec(struct event *t_timer)
{
/* no timer thread running means timer has expired: return 0 */
int64_t pim_time_monotonic_dsec(void);
int64_t pim_time_monotonic_usec(void);
int pim_time_mmss(char *buf, int buf_size, long sec);
-void pim_time_timer_to_mmss(char *buf, int buf_size, struct thread *t);
-void pim_time_timer_to_hhmmss(char *buf, int buf_size, struct thread *t);
+void pim_time_timer_to_mmss(char *buf, int buf_size, struct event *t);
+void pim_time_timer_to_hhmmss(char *buf, int buf_size, struct event *t);
void pim_time_uptime(char *buf, int buf_size, int64_t uptime_sec);
void pim_time_uptime_begin(char *buf, int buf_size, int64_t now, int64_t begin);
-long pim_time_timer_remain_msec(struct thread *t_timer);
+long pim_time_timer_remain_msec(struct event *t_timer);
#endif /* PIM_TIME_H */
pim_jp_agg_single_upstream_send(&up->rpf, up, 1 /* join */);
}
-static void on_join_timer(struct thread *t)
+static void on_join_timer(struct event *t)
{
struct pim_upstream *up;
return up;
}
-static void pim_upstream_keep_alive_timer(struct thread *t)
+static void pim_upstream_keep_alive_timer(struct event *t)
{
struct pim_upstream *up;
}
/* MSDP on RP needs to know if a source is registerable to this RP */
-static void pim_upstream_msdp_reg_timer(struct thread *t)
+static void pim_upstream_msdp_reg_timer(struct event *t)
{
struct pim_upstream *up = THREAD_ARG(t);
struct pim_instance *pim = up->channel_oil->pim;
return state_str;
}
-static void pim_upstream_register_stop_timer(struct thread *t)
+static void pim_upstream_register_stop_timer(struct event *t)
{
struct pim_interface *pim_ifp;
struct pim_instance *pim;
struct pim_up_mlag mlag;
- struct thread *t_join_timer;
+ struct event *t_join_timer;
/*
* RST(S,G)
*/
- struct thread *t_rs_timer;
+ struct event *t_rs_timer;
#define PIM_REGISTER_SUPPRESSION_PERIOD (60)
#define PIM_REGISTER_PROBE_PERIOD (5)
/*
* KAT(S,G)
*/
- struct thread *t_ka_timer;
+ struct event *t_ka_timer;
#define PIM_KEEPALIVE_PERIOD (210)
#define PIM_RP_KEEPALIVE_PERIOD \
(3 * router->register_suppress_time + router->register_probe_time)
/* on the RP we restart a timer to indicate if registers are being rxed
* for
* SG. This is needed by MSDP to determine its local SA cache */
- struct thread *t_msdp_reg_timer;
+ struct event *t_msdp_reg_timer;
#define PIM_MSDP_REG_RXED_PERIOD (3 * (1.5 * router->register_suppress_time))
int64_t state_transition; /* Record current state uptime */
pim_vxlan_del_work(vxlan_sg);
}
-static void pim_vxlan_work_timer_cb(struct thread *t)
+static void pim_vxlan_work_timer_cb(struct event *t)
{
pim_vxlan_do_reg_work();
pim_vxlan_work_timer_setup(true /* start */);
struct pim_vxlan {
enum pim_vxlan_flags flags;
- struct thread *work_timer;
+ struct event *work_timer;
struct list *work_list;
struct listnode *next_work;
int max_work_cnt;
pim_upstream_mroute_iif_update(c_oil, __func__);
}
-static void on_rpf_cache_refresh(struct thread *t)
+static void on_rpf_cache_refresh(struct event *t)
{
struct pim_instance *pim = THREAD_ARG(t);
#include "pim_addr.h"
static struct zclient *zlookup = NULL;
-struct thread *zlookup_read;
+struct event *zlookup_read;
static void zclient_lookup_sched(struct zclient *zlookup, int delay);
-static void zclient_lookup_read_pipe(struct thread *thread);
+static void zclient_lookup_read_pipe(struct event *thread);
/* Connect to zebra for nexthop lookup. */
-static void zclient_lookup_connect(struct thread *t)
+static void zclient_lookup_connect(struct event *t)
{
struct zclient *zlookup;
return zclient_read_nexthop(pim, zlookup, nexthop_tab, tab_size, addr);
}
-void zclient_lookup_read_pipe(struct thread *thread)
+void zclient_lookup_read_pipe(struct event *thread)
{
struct zclient *zlookup = THREAD_ARG(thread);
struct pim_instance *pim = pim_get_pim_instance(VRF_DEFAULT);
* Thsi thread reads the clients data from the Gloabl queue and encodes with
* protobuf and pass on to the MLAG socket.
*/
-static void pim_mlag_zthread_handler(struct thread *event)
+static void pim_mlag_zthread_handler(struct event *event)
{
struct stream *read_s;
uint32_t wr_count = 0;
}
/* Join to multicast group and send request to the interface. */
-static void rip_interface_wakeup(struct thread *t)
+static void rip_interface_wakeup(struct event *t)
{
struct interface *ifp;
struct rip_interface *ri;
}
/* RIP peer is timeout. */
-static void rip_peer_timeout(struct thread *t)
+static void rip_peer_timeout(struct event *t)
{
struct rip_peer *peer;
/* Prototypes. */
static void rip_output_process(struct connected *, struct sockaddr_in *, int,
uint8_t);
-static void rip_triggered_update(struct thread *);
+static void rip_triggered_update(struct event *);
static int rip_update_jitter(unsigned long);
static void rip_distance_table_node_cleanup(struct route_table *table,
struct route_node *node);
}
/* RIP route garbage collect timer. */
-static void rip_garbage_collect(struct thread *t)
+static void rip_garbage_collect(struct event *t)
{
struct rip_info *rinfo;
struct route_node *rp;
}
/* Timeout RIP routes. */
-static void rip_timeout(struct thread *t)
+static void rip_timeout(struct event *t)
{
struct rip_info *rinfo = THREAD_ARG(t);
struct rip *rip = rip_info_get_instance(rinfo);
}
/* First entry point of RIP packet. */
-static void rip_read(struct thread *t)
+static void rip_read(struct event *t)
{
struct rip *rip = THREAD_ARG(t);
int sock;
}
/* RIP's periodical timer. */
-static void rip_update(struct thread *t)
+static void rip_update(struct event *t)
{
struct rip *rip = THREAD_ARG(t);
}
/* Triggered update interval timer. */
-static void rip_triggered_interval(struct thread *t)
+static void rip_triggered_interval(struct event *t)
{
struct rip *rip = THREAD_ARG(t);
}
/* Execute triggered update. */
-static void rip_triggered_update(struct thread *t)
+static void rip_triggered_update(struct event *t)
{
struct rip *rip = THREAD_ARG(t);
int interval;
struct tm tm;
#define TIME_BUF 25
char timebuf[TIME_BUF];
- struct thread *thread;
+ struct event *thread;
if ((thread = rinfo->t_timeout) != NULL) {
clock = thread_timer_remain_second(thread);
struct list *peer_list;
/* RIP threads. */
- struct thread *t_read;
+ struct event *t_read;
/* Update and garbage timer. */
- struct thread *t_update;
+ struct event *t_update;
/* Triggered update hack. */
int trigger;
- struct thread *t_triggered_update;
- struct thread *t_triggered_interval;
+ struct event *t_triggered_update;
+ struct event *t_triggered_interval;
/* RIP timer values. */
uint32_t update_time;
uint8_t flags;
/* Garbage collect timer. */
- struct thread *t_timeout;
- struct thread *t_garbage_collect;
+ struct event *t_timeout;
+ struct event *t_garbage_collect;
/* Route-map futures - this variables can be changed. */
struct in_addr nexthop_out;
struct route_map *routemap[RIP_FILTER_MAX];
/* Wake up thread. */
- struct thread *t_wakeup;
+ struct event *t_wakeup;
/* Interface statistics. */
int recv_badpackets;
int recv_badroutes;
/* Timeout thread. */
- struct thread *t_timeout;
+ struct event *t_timeout;
};
struct rip_distance {
}
/* Wake up interface. */
-static void ripng_interface_wakeup(struct thread *t)
+static void ripng_interface_wakeup(struct event *t)
{
struct interface *ifp;
struct ripng_interface *ri;
/* RIPng peer is timeout.
* Garbage collector.
**/
-static void ripng_peer_timeout(struct thread *t)
+static void ripng_peer_timeout(struct event *t)
{
struct ripng_peer *peer;
static void ripng_instance_enable(struct ripng *ripng, struct vrf *vrf,
int sock);
static void ripng_instance_disable(struct ripng *ripng);
-static void ripng_triggered_update(struct thread *);
+static void ripng_triggered_update(struct event *);
static void ripng_if_rmap_update(struct if_rmap_ctx *ctx,
struct if_rmap *if_rmap);
}
/* RIPng route garbage collect timer. */
-static void ripng_garbage_collect(struct thread *t)
+static void ripng_garbage_collect(struct event *t)
{
struct ripng_info *rinfo;
struct agg_node *rp;
}
/* Timeout RIPng routes. */
-static void ripng_timeout(struct thread *t)
+static void ripng_timeout(struct event *t)
{
struct ripng_info *rinfo = THREAD_ARG(t);
struct ripng *ripng = ripng_info_get_instance(rinfo);
}
/* First entry point of reading RIPng packet. */
-static void ripng_read(struct thread *thread)
+static void ripng_read(struct event *thread)
{
struct ripng *ripng = THREAD_ARG(thread);
int len;
/* Regular update of RIPng route. Send all routing formation to RIPng
enabled interface. */
-static void ripng_update(struct thread *t)
+static void ripng_update(struct event *t)
{
struct ripng *ripng = THREAD_ARG(t);
struct interface *ifp;
}
/* Triggered update interval timer. */
-static void ripng_triggered_interval(struct thread *t)
+static void ripng_triggered_interval(struct event *t)
{
struct ripng *ripng = THREAD_ARG(t);
}
/* Execute triggered update. */
-void ripng_triggered_update(struct thread *t)
+void ripng_triggered_update(struct event *t)
{
struct ripng *ripng = THREAD_ARG(t);
struct interface *ifp;
struct tm tm;
#define TIME_BUF 25
char timebuf[TIME_BUF];
- struct thread *thread;
+ struct event *thread;
if ((thread = rinfo->t_timeout) != NULL) {
clock = thread_timer_remain_second(thread);
struct list *offset_list_master;
/* RIPng threads. */
- struct thread *t_read;
- struct thread *t_update;
+ struct event *t_read;
+ struct event *t_update;
/* Triggered update hack. */
int trigger;
- struct thread *t_triggered_update;
- struct thread *t_triggered_interval;
+ struct event *t_triggered_update;
+ struct event *t_triggered_interval;
/* RIPng ECMP flag */
bool ecmp;
uint8_t flags;
/* Garbage collect timer. */
- struct thread *t_timeout;
- struct thread *t_garbage_collect;
+ struct event *t_timeout;
+ struct event *t_garbage_collect;
/* Route-map features - this variables can be changed. */
struct in6_addr nexthop_out;
uint8_t default_only;
/* Wake up thread. */
- struct thread *t_wakeup;
+ struct event *t_wakeup;
/* Passive interface. */
int passive;
int recv_badroutes;
/* Timeout thread. */
- struct thread *t_timeout;
+ struct event *t_timeout;
};
/* All RIPng events. */
extern struct thread_master *master;
-static void logpump_done(struct thread *thread)
+static void logpump_done(struct event *thread)
{
double x;
{
struct peer *peer;
int i, j;
- struct thread t;
+ struct event t;
qobj_init();
bgp_attr_init();
}
static int timer_count;
-static void test_timer(struct thread *thread)
+static void test_timer(struct event *thread)
{
int *count = THREAD_ARG(thread);
int vty_port = 4000;
int daemon_mode = 0;
char *progname;
- struct thread thread;
+ struct event thread;
char *config_file = NULL;
/* Set umask before anything for security */
{
char *p;
char *progname;
- struct thread thread;
+ struct event thread;
bool debug = false;
/* Set umask before anything for security */
/* main routine. */
int main(int argc, char **argv)
{
- struct thread thread;
+ struct event thread;
size_t yangcount;
/* Set umask before anything for security */
/* main routine. */
int main(int argc, char **argv)
{
- struct thread thread;
+ struct event thread;
unsigned int num_vrfs = 2;
unsigned int num_interfaces = 4;
unsigned int num_routes = 6;
&frr_staticd_info, &frr_vrf_info,
};
-static void grpc_thread_stop(struct thread *thread);
+static void grpc_thread_stop(struct event *thread);
static void _err_print(const void *cookie, const char *errstr)
{
return NULL;
}
-static void grpc_thread_start(struct thread *thread)
+static void grpc_thread_start(struct event *thread)
{
struct frr_pthread_attr client = {
.start = grpc_client_test_start,
frr_pthread_wait_running(pth);
}
-static void grpc_thread_stop(struct thread *thread)
+static void grpc_thread_stop(struct event *thread)
{
std::cout << __func__ << ": frr_pthread_stop_all" << std::endl;
frr_pthread_stop_all();
thread_add_event(master, grpc_thread_start, NULL, 0, NULL);
/* Event Loop */
- struct thread thread;
+ struct event thread;
while (thread_fetch(master, &thread))
thread_call(&thread);
return 0;
printf("%s did %d, x = %g\n", str, i, x);
}
-static void clear_something(struct thread *thread)
+static void clear_something(struct event *thread)
{
struct work_state *ws = THREAD_ARG(thread);
func2(6, buf);
}
-static void threadfunc(struct thread *thread)
+static void threadfunc(struct event *thread)
{
func3();
}
}};
struct thread_master *master;
-struct thread t;
+struct event t;
int main(void)
{
static struct prng *prng;
-static struct thread **timers;
+static struct event **timers;
static int timers_pending;
exit(exit_code);
}
-static void timer_func(struct thread *thread)
+static void timer_func(struct event *thread)
{
int rv;
int main(int argc, char **argv)
{
int i, j;
- struct thread t;
+ struct event t;
struct timeval **alarms;
master = thread_master_create(NULL);
struct thread_master *master;
-static void dummy_func(struct thread *thread)
+static void dummy_func(struct event *thread)
{
}
{
struct prng *prng;
int i;
- struct thread **timers;
+ struct event **timers;
struct timeval tv_start, tv_lap, tv_stop;
unsigned long t_schedule, t_remove;
{
void *zmqsock;
char dummy = 0;
- struct thread t;
+ struct event t;
master = thread_master_create(NULL);
signal_init(master, array_size(sigs), sigs);
{
char *p;
char *progname;
- struct thread thread;
+ struct event thread;
bool debug = false;
/* Set umask before anything for security */
/* Forward decls */
static void vrrp_change_state(struct vrrp_router *r, int to);
-static void vrrp_adver_timer_expire(struct thread *thread);
-static void vrrp_master_down_timer_expire(struct thread *thread);
+static void vrrp_adver_timer_expire(struct event *thread);
+static void vrrp_master_down_timer_expire(struct event *thread);
/*
* Finds the first connected address of the appropriate family on a VRRP
/*
* Read and process next IPvX datagram.
*/
-static void vrrp_read(struct thread *thread)
+static void vrrp_read(struct event *thread)
{
struct vrrp_router *r = THREAD_ARG(thread);
/*
* Called when Adver_Timer expires.
*/
-static void vrrp_adver_timer_expire(struct thread *thread)
+static void vrrp_adver_timer_expire(struct event *thread)
{
struct vrrp_router *r = THREAD_ARG(thread);
/*
* Called when Master_Down_Timer expires.
*/
-static void vrrp_master_down_timer_expire(struct thread *thread)
+static void vrrp_master_down_timer_expire(struct event *thread)
{
struct vrrp_router *r = THREAD_ARG(thread);
uint32_t trans_cnt;
} stats;
- struct thread *t_master_down_timer;
- struct thread *t_adver_timer;
- struct thread *t_read;
- struct thread *t_write;
+ struct event *t_master_down_timer;
+ struct event *t_adver_timer;
+ struct event *t_read;
+ struct event *t_write;
};
/*
char path[MAXPATHLEN];
struct vtysh_client *next;
- struct thread *log_reader;
+ struct event *log_reader;
int log_fd;
uint32_t lost_msgs;
};
text + textpos);
}
-static void vtysh_log_read(struct thread *thread)
+static void vtysh_log_read(struct event *thread)
{
struct vtysh_client *vclient = THREAD_ARG(thread);
struct {
bool vtysh_loop_exited;
-static struct thread *vtysh_rl_read_thread;
+static struct event *vtysh_rl_read_thread;
-static void vtysh_rl_read(struct thread *thread)
+static void vtysh_rl_read(struct event *thread)
{
thread_add_read(master, vtysh_rl_read, NULL, STDIN_FILENO,
&vtysh_rl_read_thread);
/* Read a string, and return a pointer to it. Returns NULL on EOF. */
static void vtysh_rl_run(void)
{
- struct thread thread;
+ struct event thread;
master = thread_master_create(NULL);
pid_t pid;
struct timeval time;
long interval;
- struct thread *t_kill;
+ struct event *t_kill;
int kills;
};
static struct global_state {
enum restart_phase phase;
- struct thread *t_phase_hanging;
- struct thread *t_startup_timeout;
- struct thread *t_operational;
+ struct event *t_phase_hanging;
+ struct event *t_startup_timeout;
+ struct event *t_operational;
const char *vtydir;
long period;
long timeout;
int fd;
struct timeval echo_sent;
unsigned int connect_tries;
- struct thread *t_wakeup;
- struct thread *t_read;
- struct thread *t_write;
+ struct event *t_wakeup;
+ struct event *t_read;
+ struct event *t_write;
struct daemon *next;
struct restart_info restart;
{NULL, 0, NULL, 0}};
static int try_connect(struct daemon *dmn);
-static void wakeup_send_echo(struct thread *t_wakeup);
+static void wakeup_send_echo(struct event *t_wakeup);
static void try_restart(struct daemon *dmn);
static void phase_check(void);
static void restart_done(struct daemon *dmn);
return result;
}
-static void restart_kill(struct thread *t_kill)
+static void restart_kill(struct event *t_kill)
{
struct restart_info *restart = THREAD_ARG(t_kill);
struct timeval delay;
FUZZY(gs.period), &(DMN)->t_wakeup); \
} while (0);
-static void wakeup_down(struct thread *t_wakeup)
+static void wakeup_down(struct event *t_wakeup)
{
struct daemon *dmn = THREAD_ARG(t_wakeup);
try_restart(dmn);
}
-static void wakeup_init(struct thread *t_wakeup)
+static void wakeup_init(struct event *t_wakeup)
{
struct daemon *dmn = THREAD_ARG(t_wakeup);
SET_WAKEUP_DOWN(dmn);
}
-static void daemon_restarting_operational(struct thread *thread)
+static void daemon_restarting_operational(struct event *thread)
{
systemd_send_status("FRR Operational");
}
phase_check();
}
-static void handle_read(struct thread *t_read)
+static void handle_read(struct event *t_read)
{
struct daemon *dmn = THREAD_ARG(t_read);
static const char resp[sizeof(PING_TOKEN) + 4] = PING_TOKEN "\n";
phase_check();
}
-static void check_connect(struct thread *t_write)
+static void check_connect(struct event *t_write)
{
struct daemon *dmn = THREAD_ARG(t_write);
int sockerr;
daemon_up(dmn, "delayed connect succeeded");
}
-static void wakeup_connect_hanging(struct thread *t_wakeup)
+static void wakeup_connect_hanging(struct event *t_wakeup)
{
struct daemon *dmn = THREAD_ARG(t_wakeup);
char why[100];
return 1;
}
-static void phase_hanging(struct thread *t_hanging)
+static void phase_hanging(struct event *t_hanging)
{
gs.t_phase_hanging = NULL;
flog_err(EC_WATCHFRR_CONNECTION,
run_job(&gs.restart, "restart", gs.restart_command, 0, 1);
}
-static void wakeup_unresponsive(struct thread *t_wakeup)
+static void wakeup_unresponsive(struct event *t_wakeup)
{
struct daemon *dmn = THREAD_ARG(t_wakeup);
}
}
-static void wakeup_no_answer(struct thread *t_wakeup)
+static void wakeup_no_answer(struct event *t_wakeup)
{
struct daemon *dmn = THREAD_ARG(t_wakeup);
try_restart(dmn);
}
-static void wakeup_send_echo(struct thread *t_wakeup)
+static void wakeup_send_echo(struct event *t_wakeup)
{
static const char echocmd[] = "echo " PING_TOKEN;
ssize_t rc;
return res;
}
-static void startup_timeout(struct thread *t_wakeup)
+static void startup_timeout(struct event *t_wakeup)
{
daemon_send_ready(1);
}
/* data plane events. */
struct zebra_dplane_provider *prov;
struct frr_pthread *fthread;
- struct thread *t_connect;
- struct thread *t_read;
- struct thread *t_write;
- struct thread *t_event;
- struct thread *t_nhg;
- struct thread *t_dequeue;
+ struct event *t_connect;
+ struct event *t_read;
+ struct event *t_write;
+ struct event *t_event;
+ struct event *t_nhg;
+ struct event *t_dequeue;
/* zebra events. */
- struct thread *t_lspreset;
- struct thread *t_lspwalk;
- struct thread *t_nhgreset;
- struct thread *t_nhgwalk;
- struct thread *t_ribreset;
- struct thread *t_ribwalk;
- struct thread *t_rmacreset;
- struct thread *t_rmacwalk;
+ struct event *t_lspreset;
+ struct event *t_lspwalk;
+ struct event *t_nhgreset;
+ struct event *t_nhgwalk;
+ struct event *t_ribreset;
+ struct event *t_ribwalk;
+ struct event *t_rmacreset;
+ struct event *t_rmacwalk;
/* Statistic counters. */
struct {
/*
* Prototypes.
*/
-static void fpm_process_event(struct thread *t);
+static void fpm_process_event(struct event *t);
static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx);
-static void fpm_lsp_send(struct thread *t);
-static void fpm_lsp_reset(struct thread *t);
-static void fpm_nhg_send(struct thread *t);
-static void fpm_nhg_reset(struct thread *t);
-static void fpm_rib_send(struct thread *t);
-static void fpm_rib_reset(struct thread *t);
-static void fpm_rmac_send(struct thread *t);
-static void fpm_rmac_reset(struct thread *t);
+static void fpm_lsp_send(struct event *t);
+static void fpm_lsp_reset(struct event *t);
+static void fpm_nhg_send(struct event *t);
+static void fpm_nhg_reset(struct event *t);
+static void fpm_rib_send(struct event *t);
+static void fpm_rib_reset(struct event *t);
+static void fpm_rmac_send(struct event *t);
+static void fpm_rmac_reset(struct event *t);
/*
* CLI.
/*
* FPM functions.
*/
-static void fpm_connect(struct thread *t);
+static void fpm_connect(struct event *t);
static void fpm_reconnect(struct fpm_nl_ctx *fnc)
{
&fnc->t_connect);
}
-static void fpm_read(struct thread *t)
+static void fpm_read(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
fpm_msg_hdr_t fpm;
stream_reset(fnc->ibuf);
}
-static void fpm_write(struct thread *t)
+static void fpm_write(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
socklen_t statuslen;
}
}
-static void fpm_connect(struct thread *t)
+static void fpm_connect(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
struct sockaddr_in *sin = (struct sockaddr_in *)&fnc->addr;
return HASHWALK_CONTINUE;
}
-static void fpm_lsp_send(struct thread *t)
+static void fpm_lsp_send(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
struct zebra_vrf *zvrf = vrf_info_lookup(VRF_DEFAULT);
return HASHWALK_CONTINUE;
}
-static void fpm_nhg_send(struct thread *t)
+static void fpm_nhg_send(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
struct fpm_nhg_arg fna;
/**
* Send all RIB installed routes to the connected data plane.
*/
-static void fpm_rib_send(struct thread *t)
+static void fpm_rib_send(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
rib_dest_t *dest;
hash_iterate(zl3vni->rmac_table, fpm_enqueue_rmac_table, zl3vni);
}
-static void fpm_rmac_send(struct thread *t)
+static void fpm_rmac_send(struct event *t)
{
struct fpm_rmac_arg fra;
UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_FPM);
}
-static void fpm_nhg_reset(struct thread *t)
+static void fpm_nhg_reset(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
UNSET_FLAG(lsp->flags, LSP_FLAG_FPM);
}
-static void fpm_lsp_reset(struct thread *t)
+static void fpm_lsp_reset(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
struct zebra_vrf *zvrf = vrf_info_lookup(VRF_DEFAULT);
/**
* Resets the RIB FPM flags so we send all routes again.
*/
-static void fpm_rib_reset(struct thread *t)
+static void fpm_rib_reset(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
rib_dest_t *dest;
hash_iterate(zl3vni->rmac_table, fpm_unset_rmac_table, zl3vni);
}
-static void fpm_rmac_reset(struct thread *t)
+static void fpm_rmac_reset(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
&fnc->t_rmacwalk);
}
-static void fpm_process_queue(struct thread *t)
+static void fpm_process_queue(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
struct zebra_dplane_ctx *ctx;
/**
* Handles external (e.g. CLI, data plane or others) events.
*/
-static void fpm_process_event(struct thread *t)
+static void fpm_process_event(struct event *t)
{
struct fpm_nl_ctx *fnc = THREAD_ARG(t);
enum fpm_nl_events event = THREAD_VAL(t);
static void if_down_del_nbr_connected(struct interface *ifp);
-static void if_zebra_speed_update(struct thread *thread)
+static void if_zebra_speed_update(struct event *thread)
{
struct interface *ifp = THREAD_ARG(thread);
struct zebra_if *zif = ifp->info;
struct interface *link;
uint8_t speed_update_count;
- struct thread *speed_update;
+ struct event *speed_update;
/*
* Does this interface have a v6 to v4 ll neighbor entry
#define IF_SHUTDOWN (1<<6)
struct interface *ifp;
- struct thread *t_advertise;
+ struct event *t_advertise;
unsigned long irdp_sent;
uint16_t Lifetime;
extern void irdp_if_init(void);
extern int irdp_sock_init(void);
extern int irdp_config_write(struct vty *, struct interface *);
-extern void irdp_send_thread(struct thread *t_advert);
+extern void irdp_send_thread(struct event *t_advert);
extern void irdp_advert_off(struct interface *ifp);
extern void process_solicit(struct interface *ifp);
-extern void irdp_read_raw(struct thread *r);
+extern void irdp_read_raw(struct event *r);
extern void send_packet(struct interface *ifp, struct stream *s, uint32_t dst,
struct prefix *p, uint32_t ttl);
extern struct zebra_privs_t zserv_privs;
-struct thread *t_irdp_raw;
+struct event *t_irdp_raw;
/* Timer interval of irdp. */
int irdp_timer_interval = IRDP_DEFAULT_INTERVAL;
stream_free(s);
}
-void irdp_send_thread(struct thread *t_advert)
+void irdp_send_thread(struct event *t_advert)
{
uint32_t timer, tmp;
struct interface *ifp = THREAD_ARG(t_advert);
int irdp_sock = -1;
-extern struct thread *t_irdp_raw;
+extern struct event *t_irdp_raw;
static void parse_irdp_packet(char *p, int len, struct interface *ifp)
{
return ret;
}
-void irdp_read_raw(struct thread *r)
+void irdp_read_raw(struct event *r)
{
struct interface *ifp;
struct zebra_if *zi;
return 0;
}
-static void kernel_read(struct thread *thread)
+static void kernel_read(struct event *thread)
{
struct zebra_ns *zns = (struct zebra_ns *)THREAD_ARG(thread);
struct zebra_dplane_info dp_info;
#endif /* RTAX_MAX */
/* Kernel routing table and interface updates via routing socket. */
-static void kernel_read(struct thread *thread)
+static void kernel_read(struct event *thread)
{
int sock;
int nbytes;
* Final shutdown step for the zebra main thread. This is run after all
* async update processing has completed.
*/
-void zebra_finalize(struct thread *dummy)
+void zebra_finalize(struct event *dummy)
{
zlog_info("Zebra final shutdown");
extern void rib_update(enum rib_update_event event);
extern void rib_update_table(struct route_table *table,
enum rib_update_event event, int rtype);
-extern void rib_sweep_route(struct thread *t);
+extern void rib_sweep_route(struct event *t);
extern void rib_sweep_table(struct route_table *table);
extern void rib_close_table(struct route_table *table);
extern void rib_init(void);
zif->ra_sent++;
}
-static void rtadv_timer(struct thread *thread)
+static void rtadv_timer(struct event *thread)
{
struct zebra_vrf *zvrf = THREAD_ARG(thread);
struct vrf *vrf;
return;
}
-static void rtadv_read(struct thread *thread)
+static void rtadv_read(struct event *thread)
{
int sock;
int len;
struct adv_if_list_head adv_if;
struct adv_if_list_head adv_msec_if;
- struct thread *ra_read;
- struct thread *ra_timer;
+ struct event *ra_read;
+ struct event *ra_timer;
};
PREDECL_RBTREE_UNIQ(rtadv_prefixes);
struct zebra_dplane_info info;
/* Request data from the OS */
- struct thread *t_request;
+ struct event *t_request;
/* Read event */
- struct thread *t_read;
+ struct event *t_read;
/* List linkage */
struct zns_info_list_item link;
struct thread_master *dg_master;
/* Event/'thread' pointer for queued updates */
- struct thread *dg_t_update;
+ struct event *dg_t_update;
/* Event pointer for pending shutdown check loop */
- struct thread *dg_t_shutdown_check;
+ struct event *dg_t_shutdown_check;
} zdplane_info;
#define DPLANE_PROV_UNLOCK(p) pthread_mutex_unlock(&((p)->dp_mutex))
/* Prototypes */
-static void dplane_thread_loop(struct thread *event);
+static void dplane_thread_loop(struct event *event);
static enum zebra_dplane_result lsp_update_internal(struct zebra_lsp *lsp,
enum dplane_op_e op);
static enum zebra_dplane_result pw_update_internal(struct zebra_pw *pw,
* Callback when an OS (netlink) incoming event read is ready. This runs
* in the dplane pthread.
*/
-static void dplane_incoming_read(struct thread *event)
+static void dplane_incoming_read(struct event *event)
{
struct dplane_zns_info *zi = THREAD_ARG(event);
* Callback in the dataplane pthread that requests info from the OS and
* initiates netlink reads.
*/
-static void dplane_incoming_request(struct thread *event)
+static void dplane_incoming_request(struct event *event)
{
struct dplane_zns_info *zi = THREAD_ARG(event);
* final zebra shutdown.
* This runs in the dplane pthread context.
*/
-static void dplane_check_shutdown_status(struct thread *event)
+static void dplane_check_shutdown_status(struct event *event)
{
struct dplane_zns_info *zi;
* pthread can look for other pending work - such as i/o work on behalf of
* providers.
*/
-static void dplane_thread_loop(struct thread *event)
+static void dplane_thread_loop(struct event *event)
{
struct dplane_ctx_list_head work_list;
struct dplane_ctx_list_head error_list;
return buf;
}
-static void zebra_evpn_dad_mac_auto_recovery_exp(struct thread *t)
+static void zebra_evpn_dad_mac_auto_recovery_exp(struct event *t)
{
struct zebra_vrf *zvrf = NULL;
struct zebra_mac *mac = NULL;
* external neighmgr daemon to probe existing hosts to independently
* establish their presence on the ES.
*/
-static void zebra_evpn_mac_hold_exp_cb(struct thread *t)
+static void zebra_evpn_mac_hold_exp_cb(struct event *t)
{
struct zebra_mac *mac;
bool old_bgp_ready;
/* Duplicate mac detection */
uint32_t dad_count;
- struct thread *dad_mac_auto_recovery_timer;
+ struct event *dad_mac_auto_recovery_timer;
struct timeval detect_start_time;
time_t dad_dup_detect_time;
/* used for ageing out the PEER_ACTIVE flag */
- struct thread *hold_timer;
+ struct event *hold_timer;
/* number of neigh entries (using this mac) that have
* ZEBRA_MAC_ES_PEER_ACTIVE or ZEBRA_NEIGH_ES_PEER_PROXY
zebra_evpn_acc_vl_adv_svi_mac_all();
}
-static void zebra_evpn_es_df_delay_exp_cb(struct thread *t)
+static void zebra_evpn_es_df_delay_exp_cb(struct event *t)
{
struct zebra_evpn_es *es;
new_protodown);
}
-static void zebra_evpn_mh_startup_delay_exp_cb(struct thread *t)
+static void zebra_evpn_mh_startup_delay_exp_cb(struct event *t)
{
if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
zlog_debug("startup-delay expired");
* imported before running the DF election.
*/
#define ZEBRA_EVPN_MH_DF_DELAY_TIME 3 /* seconds */
- struct thread *df_delay_timer;
+ struct event *df_delay_timer;
};
RB_HEAD(zebra_es_rb_head, zebra_evpn_es);
RB_PROTOTYPE(zebra_es_rb_head, zebra_evpn_es, rb_node, zebra_es_rb_cmp);
*/
int startup_delay_time; /* seconds */
#define ZEBRA_EVPN_MH_STARTUP_DELAY_DEF (3 * 60)
- struct thread *startup_delay_timer;
+ struct event *startup_delay_timer;
/* Number of configured uplinks */
uint32_t uplink_cfg_cnt;
* external neighmgr daemon to probe existing hosts to independently
* establish their presence on the ES.
*/
-static void zebra_evpn_neigh_hold_exp_cb(struct thread *t)
+static void zebra_evpn_neigh_hold_exp_cb(struct event *t)
{
struct zebra_neigh *n;
bool old_bgp_ready;
return 0;
}
-static void zebra_evpn_dad_ip_auto_recovery_exp(struct thread *t)
+static void zebra_evpn_dad_ip_auto_recovery_exp(struct event *t)
{
struct zebra_vrf *zvrf = NULL;
struct zebra_neigh *nbr = NULL;
/* Duplicate ip detection */
uint32_t dad_count;
- struct thread *dad_ip_auto_recovery_timer;
+ struct event *dad_ip_auto_recovery_timer;
struct timeval detect_start_time;
time_t uptime;
/* used for ageing out the PEER_ACTIVE flag */
- struct thread *hold_timer;
+ struct event *hold_timer;
};
/*
/*
* Threads for I/O.
*/
- struct thread *t_connect;
- struct thread *t_write;
- struct thread *t_read;
+ struct event *t_connect;
+ struct event *t_write;
+ struct event *t_read;
/*
* Thread to clean up after the TCP connection to the FPM goes down
* and the state that belongs to it.
*/
- struct thread *t_conn_down;
+ struct event *t_conn_down;
struct {
struct zfpm_rnodes_iter iter;
* Thread to take actions once the TCP conn to the FPM comes up, and
* the state that belongs to it.
*/
- struct thread *t_conn_up;
+ struct event *t_conn_up;
struct {
struct zfpm_rnodes_iter iter;
/*
* Stats interval timer.
*/
- struct thread *t_stats;
+ struct event *t_stats;
/*
* If non-zero, the last time when statistics were cleared.
static int zfpm_trigger_update(struct route_node *rn, const char *reason);
-static void zfpm_read_cb(struct thread *thread);
-static void zfpm_write_cb(struct thread *thread);
+static void zfpm_read_cb(struct event *thread);
+static void zfpm_write_cb(struct event *thread);
static void zfpm_set_state(enum zfpm_state state, const char *reason);
static void zfpm_start_connect_timer(const char *reason);
/*
* zfpm_thread_should_yield
*/
-static inline int zfpm_thread_should_yield(struct thread *t)
+static inline int zfpm_thread_should_yield(struct event *t)
{
return thread_should_yield(t);
}
* Callback for actions to be taken when the connection to the FPM
* comes up.
*/
-static void zfpm_conn_up_thread_cb(struct thread *thread)
+static void zfpm_conn_up_thread_cb(struct event *thread)
{
struct route_node *rnode;
struct zfpm_rnodes_iter *iter;
* Callback that is invoked to clean up state after the TCP connection
* to the FPM goes down.
*/
-static void zfpm_conn_down_thread_cb(struct thread *thread)
+static void zfpm_conn_down_thread_cb(struct event *thread)
{
struct route_node *rnode;
struct zfpm_rnodes_iter *iter;
/*
* zfpm_read_cb
*/
-static void zfpm_read_cb(struct thread *thread)
+static void zfpm_read_cb(struct event *thread)
{
size_t already;
struct stream *ibuf;
/*
* zfpm_write_cb
*/
-static void zfpm_write_cb(struct thread *thread)
+static void zfpm_write_cb(struct event *thread)
{
struct stream *s;
int num_writes;
/*
* zfpm_connect_cb
*/
-static void zfpm_connect_cb(struct thread *t)
+static void zfpm_connect_cb(struct event *t)
{
int sock, ret;
struct sockaddr_in serv;
/*
* struct zfpm_statsimer_cb
*/
-static void zfpm_stats_timer_cb(struct thread *t)
+static void zfpm_stats_timer_cb(struct event *t)
{
zfpm_g->t_stats = NULL;
* Forward declaration.
*/
static struct zserv *zebra_gr_find_stale_client(struct zserv *client);
-static void zebra_gr_route_stale_delete_timer_expiry(struct thread *thread);
+static void zebra_gr_route_stale_delete_timer_expiry(struct event *thread);
static int32_t zebra_gr_delete_stale_routes(struct client_gr_info *info);
static void zebra_gr_process_client_stale_routes(struct zserv *client,
vrf_id_t vrf_id);
* Delete all the stale routes that have not been refreshed
* post restart.
*/
-static void zebra_gr_route_stale_delete_timer_expiry(struct thread *thread)
+static void zebra_gr_route_stale_delete_timer_expiry(struct event *thread)
{
struct client_gr_info *info = THREAD_ARG(thread);
int32_t cnt = 0;
static bool test_mlag_in_progress;
static int zebra_mlag_signal_write_thread(void);
-static void zebra_mlag_terminate_pthread(struct thread *event);
-static void zebra_mlag_post_data_from_main_thread(struct thread *thread);
+static void zebra_mlag_terminate_pthread(struct event *event);
+static void zebra_mlag_post_data_from_main_thread(struct event *thread);
static void zebra_mlag_publish_process_state(struct zserv *client,
zebra_message_types_t msg_type);
* This thread reads the clients data from the Global queue and encodes with
* protobuf and pass on to the MLAG socket.
*/
-static void zebra_mlag_client_msg_handler(struct thread *event)
+static void zebra_mlag_client_msg_handler(struct event *event)
{
struct stream *s;
uint32_t wr_count = 0;
* main thread, because for that access was needed for clients list.
* so instead of forcing the locks, messages will be posted from main thread.
*/
-static void zebra_mlag_post_data_from_main_thread(struct thread *thread)
+static void zebra_mlag_post_data_from_main_thread(struct event *thread)
{
struct stream *s = THREAD_ARG(thread);
struct stream *zebra_s = NULL;
* all clients are un-registered for MLAG Updates, terminate the
* MLAG write thread
*/
-static void zebra_mlag_terminate_pthread(struct thread *event)
+static void zebra_mlag_terminate_pthread(struct event *event)
{
if (IS_ZEBRA_DEBUG_MLAG)
zlog_debug("Zebra MLAG write thread terminate called");
static struct thread_master *zmlag_master;
static int mlag_socket;
-static void zebra_mlag_connect(struct thread *thread);
-static void zebra_mlag_read(struct thread *thread);
+static void zebra_mlag_connect(struct event *thread);
+static void zebra_mlag_read(struct event *thread);
/*
* Write the data to MLAGD
&zrouter.mlag_info.t_read);
}
-static void zebra_mlag_read(struct thread *thread)
+static void zebra_mlag_read(struct event *thread)
{
static uint32_t mlag_rd_buf_offset;
uint32_t *msglen;
zebra_mlag_sched_read();
}
-static void zebra_mlag_connect(struct thread *thread)
+static void zebra_mlag_connect(struct event *thread)
{
struct sockaddr_un svr = {0};
#define ZEBRA_NS_POLLING_MAX_RETRIES 200
DEFINE_MTYPE_STATIC(ZEBRA, NETNS_MISC, "ZebraNetNSInfo");
-static struct thread *zebra_netns_notify_current;
+static struct event *zebra_netns_notify_current;
struct zebra_netns_info {
const char *netnspath;
unsigned int retries;
};
-static void zebra_ns_ready_read(struct thread *t);
+static void zebra_ns_ready_read(struct event *t);
static void zebra_ns_notify_create_context_from_entry_name(const char *name);
static int zebra_ns_continue_read(struct zebra_netns_info *zns_info,
int stop_retry);
-static void zebra_ns_notify_read(struct thread *t);
+static void zebra_ns_notify_read(struct event *t);
static struct vrf *vrf_handler_create(struct vty *vty, const char *vrfname)
{
return false;
}
-static void zebra_ns_ready_read(struct thread *t)
+static void zebra_ns_ready_read(struct event *t)
{
struct zebra_netns_info *zns_info = THREAD_ARG(t);
const char *netnspath;
zebra_ns_continue_read(zns_info, 1);
}
-static void zebra_ns_notify_read(struct thread *t)
+static void zebra_ns_notify_read(struct event *t)
{
int fd_monitor = THREAD_FD(t);
struct inotify_event *event;
}
}
-static void zebra_nhg_timer(struct thread *thread)
+static void zebra_nhg_timer(struct event *thread)
{
struct nhg_hash_entry *nhe = THREAD_ARG(thread);
*/
struct nhg_connected_tree_head nhg_depends, nhg_dependents;
- struct thread *timer;
+ struct event *timer;
/*
* Is this nexthop group valid, ie all nexthops are fully resolved.
*/
struct nlsock netlink_dplane_out;
struct nlsock netlink_dplane_in;
- struct thread *t_netlink;
+ struct event *t_netlink;
#endif
struct route_table *if_table;
struct thread_master *master;
/* Event/'thread' pointer for queued zapi messages */
- struct thread *t_msgs;
+ struct event *t_msgs;
/* Input fifo queue to the module, and lock to protect it. */
pthread_mutex_t mutex;
/* Prototypes */
/* Main event loop, processing incoming message queue */
-static void process_messages(struct thread *event);
+static void process_messages(struct event *event);
static int handle_opq_registration(const struct zmsghdr *hdr,
struct stream *msg);
static int handle_opq_unregistration(const struct zmsghdr *hdr,
/*
* Pthread event loop, process the incoming message queue.
*/
-static void process_messages(struct thread *event)
+static void process_messages(struct event *event)
{
struct stream_fifo fifo;
struct stream *msg;
struct zebra_ptm_cb ptm_cb;
static int zebra_ptm_socket_init(void);
-void zebra_ptm_sock_read(struct thread *thread);
+void zebra_ptm_sock_read(struct event *thread);
static void zebra_ptm_install_commands(void);
static int zebra_ptm_handle_msg_cb(void *arg, void *in_ctxt);
void zebra_bfd_peer_replay_req(void);
close(ptm_cb.ptm_sock);
}
-static void zebra_ptm_flush_messages(struct thread *thread)
+static void zebra_ptm_flush_messages(struct event *thread)
{
ptm_cb.t_write = NULL;
return 0;
}
-void zebra_ptm_connect(struct thread *t)
+void zebra_ptm_connect(struct event *t)
{
int init = 0;
}
}
-void zebra_ptm_sock_read(struct thread *thread)
+void zebra_ptm_sock_read(struct event *thread)
{
int sock;
int rc;
struct buffer *wb; /* Buffer of data waiting to be written to ptm. */
- struct thread *t_read; /* Thread for read */
- struct thread *t_write; /* Thread for write */
- struct thread *t_timer; /* Thread for timer */
+ struct event *t_read; /* Thread for read */
+ struct event *t_write; /* Thread for write */
+ struct event *t_timer; /* Thread for timer */
char *out_data;
char *in_data;
void zebra_ptm_init(void);
void zebra_ptm_finish(void);
-void zebra_ptm_connect(struct thread *t);
+void zebra_ptm_connect(struct event *t);
void zebra_ptm_write(struct vty *vty);
int zebra_ptm_get_enable_state(void);
static int zebra_pw_enabled(struct zebra_pw *);
static void zebra_pw_install(struct zebra_pw *);
static void zebra_pw_uninstall(struct zebra_pw *);
-static void zebra_pw_install_retry(struct thread *thread);
+static void zebra_pw_install_retry(struct event *thread);
static int zebra_pw_check_reachability(const struct zebra_pw *);
static void zebra_pw_update_status(struct zebra_pw *, int);
zebra_pw_update_status(pw, pwstatus);
}
-static void zebra_pw_install_retry(struct thread *thread)
+static void zebra_pw_install_retry(struct event *thread)
{
struct zebra_pw *pw = THREAD_ARG(thread);
uint8_t protocol;
struct zserv *client;
struct rnh *rnh;
- struct thread *install_retry_timer;
+ struct event *install_retry_timer;
QOBJ_FIELDS;
};
DECLARE_QOBJ_TYPE(zebra_pw);
* Event, list, and mutex for delivery of dataplane results
*/
static pthread_mutex_t dplane_mutex;
-static struct thread *t_dplane;
+static struct event *t_dplane;
static struct dplane_ctx_list_head rib_dplane_q;
DEFINE_HOOK(rib_update, (struct route_node * rn, const char *reason),
XFREE(MTYPE_RIB_UPDATE_CTX, *ctx);
}
-static void rib_update_handler(struct thread *thread)
+static void rib_update_handler(struct event *thread)
{
struct rib_update_ctx *ctx;
* Thread list to ensure we don't schedule a ton of events
* if interfaces are flapping for instance.
*/
-static struct thread *t_rib_update_threads[RIB_UPDATE_MAX];
+static struct event *t_rib_update_threads[RIB_UPDATE_MAX];
/* Schedule a RIB update event for all vrfs */
void rib_update(enum rib_update_event event)
}
/* Sweep all RIB tables. */
-void rib_sweep_route(struct thread *t)
+void rib_sweep_route(struct event *t)
{
struct vrf *vrf;
struct zebra_vrf *zvrf;
* Handle results from the dataplane system. Dequeue update context
* structs, dispatch to appropriate internal handlers.
*/
-static void rib_process_dplane_results(struct thread *thread)
+static void rib_process_dplane_results(struct event *thread)
{
struct zebra_dplane_ctx *ctx;
struct dplane_ctx_list_head ctxlist;
#include "zebra/zebra_routemap_clippy.c"
static uint32_t zebra_rmap_update_timer = ZEBRA_RMAP_DEFAULT_UPDATE_TIMER;
-static struct thread *zebra_t_rmap_update = NULL;
+static struct event *zebra_t_rmap_update = NULL;
char *zebra_import_table_routemap[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
struct nh_rmap_obj {
zebra_nht_rm_update(rmap_name);
}
-static void zebra_route_map_update_timer(struct thread *thread)
+static void zebra_route_map_update_timer(struct event *thread)
{
if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("Event driven route-map update triggered");
* so no issues.
*
*/
- struct thread *t_read;
+ struct event *t_read;
/* Event for MLAG write */
- struct thread *t_write;
+ struct event *t_write;
};
struct zebra_router {
* Time for when we sweep the rib from old routes
*/
time_t startup_time;
- struct thread *sweeper;
+ struct event *sweeper;
/*
* The hash of nexthop groups associated with this router
* allows us to expose information about input and output queues to the user in
* terms of number of packets rather than size of data.
*/
-static void zserv_write(struct thread *thread)
+static void zserv_write(struct event *thread)
{
struct zserv *client = THREAD_ARG(thread);
struct stream *msg;
*
* Any failure in any of these actions is handled by terminating the client.
*/
-static void zserv_read(struct thread *thread)
+static void zserv_read(struct event *thread)
{
struct zserv *client = THREAD_ARG(thread);
int sock;
* rely on the read thread to handle queuing this task enough times to process
* everything on the input queue.
*/
-static void zserv_process_messages(struct thread *thread)
+static void zserv_process_messages(struct event *thread)
{
struct zserv *client = THREAD_ARG(thread);
struct stream *msg;
* - Free associated resources
* - Free client structure
*
- * This does *not* take any action on the struct thread * fields. These are
+ * This does *not* take any action on the struct event * fields. These are
* managed by the owning pthread and any tasks associated with them must have
* been stopped prior to invoking this function.
*/
* already have been closed and the thread will most likely have died, but its
* resources still need to be cleaned up.
*/
-static void zserv_handle_client_fail(struct thread *thread)
+static void zserv_handle_client_fail(struct event *thread)
{
struct zserv *client = THREAD_ARG(thread);
/*
* Accept socket connection.
*/
-static void zserv_accept(struct thread *thread)
+static void zserv_accept(struct event *thread)
{
int accept_sock;
int client_sock;
/* Book keeping */
struct prefix *current_prefix;
void *stale_client_ptr;
- struct thread *t_stale_removal;
+ struct event *t_stale_removal;
TAILQ_ENTRY(client_gr_info) gr_info;
};
struct buffer *wb;
/* Threads for read/write. */
- struct thread *t_read;
- struct thread *t_write;
+ struct event *t_read;
+ struct event *t_write;
/* Event for message processing, for the main pthread */
- struct thread *t_process;
+ struct event *t_process;
/* Event for the main pthread */
- struct thread *t_cleanup;
+ struct event *t_cleanup;
/* This client's redistribute flag. */
struct redist_proto mi_redist[AFI_MAX][ZEBRA_ROUTE_MAX];
struct zmsghdr *hdr);
/* TODO */
-__attribute__((__noreturn__)) void zebra_finalize(struct thread *event);
+__attribute__((__noreturn__)) void zebra_finalize(struct event *event);
/*
* Graceful restart functions.