*: Convert struct event_master to struct event_loop

Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-03-07 14:14:41 -05:00
parent ce50d11c4d
commit cd9d053741
197 changed files with 330 additions and 338 deletions

View File

@ -37,7 +37,7 @@ static void babel_exit_properly(void);
static void babel_save_state_file(void);
struct event_master *master; /* quagga's threads handler */
struct event_loop *master; /* quagga's threads handler */
struct timeval babel_now; /* current time */
unsigned char myid[8]; /* unique id (mac address of an interface) */

View File

@ -9,7 +9,7 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
#include "vty.h"
extern struct timeval babel_now; /* current time */
extern struct event_master *master; /* quagga's threads handler */
extern struct event_loop *master; /* quagga's threads handler */
extern int debug;
extern int resend_delay;

View File

@ -686,7 +686,7 @@ void bfd_key_iterate(hash_iter_func hif, void *arg);
unsigned long bfd_get_session_count(void);
/* Export callback functions for `event.c`. */
extern struct event_master *master;
extern struct event_loop *master;
void bfd_recvtimer_cb(struct event *t);
void bfd_echo_recvtimer_cb(struct event *t);

View File

@ -32,7 +32,7 @@ DEFINE_MTYPE(BFDD, BFDD_CONTROL, "long-lived control socket memory");
DEFINE_MTYPE(BFDD, BFDD_NOTIFICATION, "short-lived control notification data");
/* Master of threads. */
struct event_master *master;
struct event_loop *master;
/* BFDd privileges */
static zebra_capabilities_t _caps_p[] = {ZCAP_BIND, ZCAP_SYS_ADMIN, ZCAP_NET_RAW};

View File

@ -609,7 +609,7 @@ DEFUN(no_neighbor_bfd_profile, no_neighbor_bfd_profile_cmd,
}
#endif /* HAVE_BFDD */
void bgp_bfd_init(struct event_master *tm)
void bgp_bfd_init(struct event_loop *tm)
{
/* Initialize BFD client functions */
bfd_protocol_integration_init(zclient, tm);

View File

@ -12,7 +12,7 @@
((((peer)->sort == BGP_PEER_IBGP) && !(peer)->shared_network) \
|| is_ebgp_multihop_configured((peer)))
extern void bgp_bfd_init(struct event_master *tm);
extern void bgp_bfd_init(struct event_loop *tm);
extern void bgp_bfd_peer_config_write(struct vty *vty, const struct peer *peer,
const char *addr);

View File

@ -2526,7 +2526,7 @@ static int bmp_config_write(struct bgp *bgp, struct vty *vty)
return 0;
}
static int bgp_bmp_init(struct event_master *tm)
static int bgp_bmp_init(struct event_loop *tm)
{
install_node(&bmp_node);
install_default(BMP_NODE);

View File

@ -177,7 +177,7 @@ static void lp_chunk_free(void *goner)
XFREE(MTYPE_BGP_LABEL_CHUNK, goner);
}
void bgp_lp_init(struct event_master *master, struct labelpool *pool)
void bgp_lp_init(struct event_loop *master, struct labelpool *pool)
{
if (BGP_DEBUG(labelpool, LABELPOOL))
zlog_debug("%s: entry", __func__);

View File

@ -31,7 +31,7 @@ struct labelpool {
uint32_t next_chunksize; /* request this many labels */
};
extern void bgp_lp_init(struct event_master *master, struct labelpool *pool);
extern void bgp_lp_init(struct event_loop *master, struct labelpool *pool);
extern void bgp_lp_finish(void);
extern void bgp_lp_get(int type, void *labelid,
int (*cbfunc)(mpls_label_t label, void *labelid, bool allocated));

View File

@ -591,7 +591,7 @@ err:
}
static int bgp_rpki_init(struct event_master *master)
static int bgp_rpki_init(struct event_loop *master)
{
rpki_debug = false;
rtr_is_running = false;

View File

@ -30,7 +30,7 @@
#include "bgpd/bgp_snmp_bgp4v2.h"
#include "bgpd/bgp_mplsvpn_snmp.h"
static int bgp_snmp_init(struct event_master *tm)
static int bgp_snmp_init(struct event_loop *tm)
{
smux_init(tm);
bgp_snmp_bgp4_init(tm);

View File

@ -791,7 +791,7 @@ int bgpTrapBackwardTransition(struct peer *peer)
return 0;
}
int bgp_snmp_bgp4_init(struct event_master *tm)
int bgp_snmp_bgp4_init(struct event_loop *tm)
{
REGISTER_MIB("mibII/bgp", bgp_variables, variable, bgp_oid);
return 0;

View File

@ -71,6 +71,6 @@
extern int bgpTrapEstablished(struct peer *peer);
extern int bgpTrapBackwardTransition(struct peer *peer);
extern int bgp_snmp_bgp4_init(struct event_master *tm);
extern int bgp_snmp_bgp4_init(struct event_loop *tm);
#endif /* _FRR_BGP_SNMP_BGP4_H_ */

View File

@ -1394,7 +1394,7 @@ static struct variable bgpv2_variables[] = {
{1, 9, 1, BGP4V2_NLRI_PATH_ATTR_UNKNOWN, 2, 16}},
};
int bgp_snmp_bgp4v2_init(struct event_master *tm)
int bgp_snmp_bgp4v2_init(struct event_loop *tm)
{
REGISTER_MIB("mibII/bgpv2", bgpv2_variables, variable, bgpv2_oid);
return 0;

View File

@ -81,6 +81,6 @@
#define BGP4V2_ESTABLISHED_NOTIFICATION 1
#define BGP4V2_BACKWARD_TRANSITION_NOTIFICATION 2
extern int bgp_snmp_bgp4v2_init(struct event_master *tm);
extern int bgp_snmp_bgp4v2_init(struct event_loop *tm);
#endif /* _FRR_BGP_SNMP_BGP4V2_H_ */

View File

@ -3443,7 +3443,7 @@ void bgp_if_init(void)
hook_register_prio(if_del, 0, bgp_if_delete_hook);
}
void bgp_zebra_init(struct event_master *master, unsigned short instance)
void bgp_zebra_init(struct event_loop *master, unsigned short instance)
{
zclient_num_connects = 0;

View File

@ -18,8 +18,7 @@
/* Default weight for next hop, if doing weighted ECMP. */
#define BGP_ZEBRA_DEFAULT_NHOP_WEIGHT 1
extern void bgp_zebra_init(struct event_master *master,
unsigned short instance);
extern void bgp_zebra_init(struct event_loop *master, unsigned short instance);
extern void bgp_if_init(void);
extern void bgp_zebra_init_tm_connect(struct bgp *bgp);
extern uint32_t bgp_zebra_tm_get_id(void);

View File

@ -8010,7 +8010,7 @@ char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
return buf;
}
void bgp_master_init(struct event_master *master, const int buffer_size,
void bgp_master_init(struct event_loop *master, const int buffer_size,
struct list *addresses)
{
qobj_init();

View File

@ -98,7 +98,7 @@ struct bgp_master {
struct list *bgp;
/* BGP thread master. */
struct event_master *master;
struct event_loop *master;
/* Listening sockets */
struct list *listen_sockets;
@ -2156,7 +2156,7 @@ extern char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
extern int bgp_config_write(struct vty *);
extern void bgp_master_init(struct event_master *master, const int buffer_size,
extern void bgp_master_init(struct event_loop *master, const int buffer_size,
struct list *addresses);
extern void bgp_init(unsigned short instance);

View File

@ -335,7 +335,7 @@ struct rfapi_rfp_cfg {
* return value:
* rfp_start_val rfp returned value passed on rfp_stop and other rfapi calls
--------------------------------------------*/
extern void *rfp_start(struct event_master *master, struct rfapi_rfp_cfg **cfgp,
extern void *rfp_start(struct event_loop *master, struct rfapi_rfp_cfg **cfgp,
struct rfapi_rfp_cb_methods **cbmp);
/*------------------------------------------

View File

@ -14,7 +14,7 @@
#include "bgpd/bgp_nexthop.h"
extern void rfapi_init(void);
extern void vnc_zebra_init(struct event_master *master);
extern void vnc_zebra_init(struct event_loop *master);
extern void vnc_zebra_destroy(void);
extern void rfapi_delete(struct bgp *);

View File

@ -890,7 +890,7 @@ static zclient_handler *const vnc_handlers[] = {
* Modeled after bgp_zebra.c'bgp_zebra_init()
* Charriere asks, "Is it possible to carry two?"
*/
void vnc_zebra_init(struct event_master *master)
void vnc_zebra_init(struct event_loop *master)
{
/* Set default values. */
zclient_vnc = zclient_new(master, &zclient_options_default,

View File

@ -17,7 +17,7 @@
struct rfp_instance_t {
struct rfapi_rfp_cfg rfapi_config;
struct rfapi_rfp_cb_methods rfapi_callbacks;
struct event_master *master;
struct event_loop *master;
uint32_t config_var;
};
@ -271,7 +271,7 @@ static int rfp_cfg_write_cb(struct vty *vty, void *rfp_start_val)
* rfp_start_val rfp returned value passed on rfp_stop and rfp_cfg_write
*
--------------------------------------------*/
void *rfp_start(struct event_master *master, struct rfapi_rfp_cfg **cfgp,
void *rfp_start(struct event_loop *master, struct rfapi_rfp_cfg **cfgp,
struct rfapi_rfp_cb_methods **cbmp)
{
memset(&global_rfi, 0, sizeof(global_rfi));

View File

@ -58,7 +58,7 @@ Basic boilerplate:
#include "libfrr.h"
#include "event.h"
static int module_late_init(struct event_master *master)
static int module_late_init(struct event_loop *master)
{
/* Do initialization stuff here */
return 0;

View File

@ -47,7 +47,7 @@ section. For now it provides basic information necessary to understand the
interplay between the event system and kernel threads.
The core event system is implemented in :file:`lib/thread.[ch]`. The primary
structure is ``struct event_master``, hereafter referred to as a
structure is ``struct event_loop``, hereafter referred to as a
``threadmaster``. A ``threadmaster`` is a global state object, or context, that
holds all the tasks currently pending execution as well as statistics on tasks
that have already executed. The event system is driven by adding tasks to this
@ -95,7 +95,7 @@ irrelevant for the time being) for the specific type. For example, to add a
::
event_add_read(struct event_master *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref);
event_add_read(struct event_loop *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref);
The ``struct event`` is then created and added to the appropriate internal
datastructure within the ``threadmaster``. Note that the ``READ`` and

View File

@ -76,7 +76,7 @@ struct zebra_privs_t eigrpd_privs = {
struct option longopts[] = {{0}};
/* Master of threads. */
struct event_master *master;
struct event_loop *master;
/* Forward declaration of daemon info structure. */
static struct frr_daemon_info eigrpd_di;

View File

@ -49,7 +49,7 @@ static int eigrp_zebra_read_route(ZAPI_CALLBACK_ARGS);
struct zclient *zclient = NULL;
/* For registering threads. */
extern struct event_master *master;
extern struct event_loop *master;
struct in_addr router_id_zebra;
/* Router-id update message from zebra. */

View File

@ -35,7 +35,7 @@ struct eigrp_master {
struct list *eigrp;
/* EIGRP thread master. */
struct event_master *master;
struct event_loop *master;
/* Zebra interface list. */
struct list *iflist;
@ -51,7 +51,7 @@ struct eigrp_master {
/* Extern variables. */
extern struct zclient *zclient;
extern struct event_master *master;
extern struct event_loop *master;
extern struct eigrp_master *eigrp_om;
extern struct zebra_privs_t eigrpd_privs;

View File

@ -209,7 +209,7 @@ static int bfd_handle_circuit_add_addr(struct isis_circuit *circuit)
return 0;
}
void isis_bfd_init(struct event_master *tm)
void isis_bfd_init(struct event_loop *tm)
{
bfd_protocol_integration_init(zclient, tm);

View File

@ -7,10 +7,10 @@
#define ISIS_BFD_H
struct isis_circuit;
struct event_master;
struct event_loop;
void isis_bfd_circuit_cmd(struct isis_circuit *circuit);
void isis_bfd_init(struct event_master *tm);
void isis_bfd_init(struct event_loop *tm);
#endif

View File

@ -77,7 +77,7 @@ static const struct option longopts[] = {
{0}};
/* Master of threads. */
struct event_master *master;
struct event_loop *master;
/*
* Prototypes.

View File

@ -2797,7 +2797,7 @@ static uint8_t *isis_snmp_find_isadj_prot_supp(struct variable *v, oid *name,
/* Register ISIS-MIB. */
static int isis_snmp_init(struct event_master *tm)
static int isis_snmp_init(struct event_loop *tm)
{
struct isis_func_to_prefix *h2f = isis_func_to_prefix_arr;
struct variable *v;

View File

@ -828,7 +828,7 @@ static zclient_handler *const isis_handlers[] = {
[ZEBRA_CLIENT_CLOSE_NOTIFY] = isis_zebra_client_close_notify,
};
void isis_zebra_init(struct event_master *master, int instance)
void isis_zebra_init(struct event_loop *master, int instance)
{
/* Initialize asynchronous zclient. */
zclient = zclient_new(master, &zclient_options_default, isis_handlers,

View File

@ -20,7 +20,7 @@ struct label_chunk {
};
#define CHUNK_SIZE 64
void isis_zebra_init(struct event_master *master, int instance);
void isis_zebra_init(struct event_loop *master, int instance);
void isis_zebra_stop(void);
struct isis_route_info;

View File

@ -166,7 +166,7 @@ struct isis *isis_lookup_by_sysid(const uint8_t *sysid)
return NULL;
}
void isis_master_init(struct event_master *master)
void isis_master_init(struct event_loop *master)
{
memset(&isis_master, 0, sizeof(isis_master));
im = &isis_master;

View File

@ -71,7 +71,7 @@ struct isis_master {
/* ISIS instance. */
struct list *isis;
/* ISIS thread master. */
struct event_master *master;
struct event_loop *master;
uint8_t options;
};
#define F_ISIS_UNIT_TEST 0x01
@ -252,7 +252,7 @@ DECLARE_MTYPE(ISIS_PLIST_NAME);
DECLARE_HOOK(isis_area_overload_bit_update, (struct isis_area * area), (area));
void isis_terminate(void);
void isis_master_init(struct event_master *master);
void isis_master_init(struct event_loop *master);
void isis_vrf_link(struct isis *isis, struct vrf *vrf);
void isis_vrf_unlink(struct isis *isis, struct vrf *vrf);
struct isis *isis_lookup_by_vrfid(vrf_id_t vrf_id);
@ -329,7 +329,7 @@ void config_end_lsp_generate(struct isis_area *area);
#define ISIS_SR "/frr-isisd:isis/instance/segment-routing"
/* Master of threads. */
extern struct event_master *master;
extern struct event_loop *master;
extern unsigned long debug_adj_pkt;
extern unsigned long debug_snp_pkt;

View File

@ -1173,7 +1173,7 @@ static int ldp_snmp_nbr_state_change(struct nbr * nbr, int old_state)
return 0;
}
static int ldp_snmp_init(struct event_master *tm)
static int ldp_snmp_init(struct event_loop *tm)
{
hook_register(agentx_enabled, ldp_snmp_agentx_enabled);
@ -1182,7 +1182,7 @@ static int ldp_snmp_init(struct event_master *tm)
return 0;
}
static int ldp_snmp_register_mib(struct event_master *tm)
static int ldp_snmp_register_mib(struct event_loop *tm)
{
static int registered = 0;

View File

@ -690,7 +690,7 @@ static zclient_handler *const ldp_handlers[] = {
[ZEBRA_OPAQUE_MESSAGE] = ldp_zebra_opaque_msg_handler,
};
void ldp_zebra_init(struct event_master *master)
void ldp_zebra_init(struct event_loop *master)
{
if_zapi_callbacks(ldp_ifp_create, ldp_ifp_up,
ldp_ifp_down, ldp_ifp_destroy);

View File

@ -77,7 +77,7 @@ static pid_t lde_pid;
static struct frr_daemon_info ldpd_di;
DEFINE_HOOK(ldp_register_mib, (struct event_master * tm), (tm));
DEFINE_HOOK(ldp_register_mib, (struct event_loop * tm), (tm));
static void ldp_load_module(const char *name)
{
@ -104,7 +104,7 @@ enum ldpd_process ldpd_process;
#define LDP_VTY_PORT 2612
/* Master of threads. */
struct event_master *master;
struct event_loop *master;
/* ldpd privileges */
static zebra_capabilities_t _caps_p [] =

View File

@ -883,11 +883,11 @@ const char *pw_type_name(uint16_t);
const char *pw_error_code(uint8_t);
/* quagga */
extern struct event_master *master;
extern struct event_loop *master;
extern char ctl_sock_path[MAXPATHLEN];
/* ldp_zebra.c */
void ldp_zebra_init(struct event_master *m);
void ldp_zebra_init(struct event_loop *m);
void ldp_zebra_destroy(void);
int ldp_sync_zebra_send_state_update(struct ldp_igp_sync_if_state *);
int ldp_zebra_send_rlfa_labels(struct zapi_rlfa_response *
@ -904,7 +904,7 @@ void ldp_zebra_regdereg_zebra_info(bool want_register);
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_INTFACELOCAL))
#endif
DECLARE_HOOK(ldp_register_mib, (struct event_master * tm), (tm));
DECLARE_HOOK(ldp_register_mib, (struct event_loop * tm), (tm));
extern void ldp_agentx_enabled(void);

View File

@ -27,7 +27,7 @@ DEFINE_HOOK(agentx_enabled, (), ());
static bool agentx_enabled = false;
static struct event_master *agentx_tm;
static struct event_loop *agentx_tm;
static struct event *timeout_thr = NULL;
static struct list *events = NULL;
@ -244,7 +244,7 @@ bool smux_enabled(void)
return agentx_enabled;
}
void smux_init(struct event_master *tm)
void smux_init(struct event_loop *tm)
{
agentx_tm = tm;

View File

@ -111,7 +111,7 @@ struct bfd_sessions_global {
struct bfd_source_list source_list;
/** Pointer to FRR's event manager. */
struct event_master *tm;
struct event_loop *tm;
/** Pointer to zebra client data structure. */
struct zclient *zc;
@ -1039,7 +1039,7 @@ static int bfd_protocol_integration_finish(void)
return 0;
}
void bfd_protocol_integration_init(struct zclient *zc, struct event_master *tm)
void bfd_protocol_integration_init(struct zclient *zc, struct event_loop *tm)
{
/* Initialize data structure. */
TAILQ_INIT(&bsglobal.bsplist);

View File

@ -348,7 +348,7 @@ void bfd_sess_show(struct vty *vty, struct json_object *json,
* Initializes the BFD integration library. This function executes the
* following actions:
*
* - Copy the `struct event_master` pointer to use as "thread" to execute
* - Copy the `struct event_loop` pointer to use as "thread" to execute
* the BFD session parameters installation.
* - Copy the `struct zclient` pointer to install its callbacks.
* - Initializes internal data structures.
@ -356,7 +356,7 @@ void bfd_sess_show(struct vty *vty, struct json_object *json,
* \param tm normally the daemon main thread event manager.
* \param zc the zebra client of the daemon.
*/
void bfd_protocol_integration_init(struct zclient *zc, struct event_master *tm);
void bfd_protocol_integration_init(struct zclient *zc, struct event_loop *tm);
/**
* BFD session registration arguments.

View File

@ -73,7 +73,7 @@ pthread_key_t thread_current;
static pthread_mutex_t masters_mtx = PTHREAD_MUTEX_INITIALIZER;
static struct list *masters;
static void thread_free(struct event_master *master, struct event *thread);
static void thread_free(struct event_loop *master, struct event *thread);
#ifndef EXCLUDE_CPU_TIME
#define EXCLUDE_CPU_TIME 0
@ -185,7 +185,7 @@ static void cpu_record_print(struct vty *vty, uint8_t filter)
{
struct cpu_event_history tmp;
void *args[3] = {&tmp, vty, &filter};
struct event_master *m;
struct event_loop *m;
struct listnode *ln;
if (!cputime_enabled)
@ -263,7 +263,7 @@ static void cpu_record_hash_clear(struct hash_bucket *bucket, void *args[])
static void cpu_record_clear(uint8_t filter)
{
uint8_t *tmp = &filter;
struct event_master *m;
struct event_loop *m;
struct listnode *ln;
frr_with_mutex (&masters_mtx) {
@ -395,7 +395,7 @@ ALIAS (service_walltime_warning,
"Set up miscellaneous service\n"
"Warn for tasks exceeding total wallclock threshold\n")
static void show_thread_poll_helper(struct vty *vty, struct event_master *m)
static void show_thread_poll_helper(struct vty *vty, struct event_loop *m)
{
const char *name = m->name ? m->name : "main";
char underline[strlen(name) + 1];
@ -444,7 +444,7 @@ DEFUN_NOSH (show_thread_poll,
"Show poll FD's and information\n")
{
struct listnode *node;
struct event_master *m;
struct event_loop *m;
frr_with_mutex (&masters_mtx) {
for (ALL_LIST_ELEMENTS_RO(masters, node, m)) {
@ -481,7 +481,7 @@ DEFUN (clear_thread_cpu,
return CMD_SUCCESS;
}
static void show_thread_timers_helper(struct vty *vty, struct event_master *m)
static void show_thread_timers_helper(struct vty *vty, struct event_loop *m)
{
const char *name = m->name ? m->name : "main";
char underline[strlen(name) + 1];
@ -506,7 +506,7 @@ DEFPY_NOSH (show_thread_timers,
"Show all timers and how long they have in the system\n")
{
struct listnode *node;
struct event_master *m;
struct event_loop *m;
frr_with_mutex (&masters_mtx) {
for (ALL_LIST_ELEMENTS_RO(masters, node, m))
@ -544,14 +544,14 @@ static void initializer(void)
pthread_key_create(&thread_current, NULL);
}
struct event_master *event_master_create(const char *name)
struct event_loop *event_master_create(const char *name)
{
struct event_master *rv;
struct event_loop *rv;
struct rlimit limit;
pthread_once(&init_once, &initializer);
rv = XCALLOC(MTYPE_EVENT_MASTER, sizeof(struct event_master));
rv = XCALLOC(MTYPE_EVENT_MASTER, sizeof(struct event_loop));
/* Initialize master mutex */
pthread_mutex_init(&rv->mtx, NULL);
@ -623,7 +623,7 @@ struct event_master *event_master_create(const char *name)
return rv;
}
void event_master_set_name(struct event_master *master, const char *name)
void event_master_set_name(struct event_loop *master, const char *name)
{
frr_with_mutex (&master->mtx) {
XFREE(MTYPE_EVENT_MASTER, master->name);
@ -634,7 +634,7 @@ void event_master_set_name(struct event_master *master, const char *name)
#define EVENT_UNUSED_DEPTH 10
/* Move thread to unuse list. */
static void thread_add_unuse(struct event_master *m, struct event *thread)
static void thread_add_unuse(struct event_loop *m, struct event *thread)
{
pthread_mutex_t mtxc = thread->mtx;
@ -656,8 +656,7 @@ static void thread_add_unuse(struct event_master *m, struct event *thread)
}
/* Free all unused thread. */
static void thread_list_free(struct event_master *m,
struct event_list_head *list)
static void thread_list_free(struct event_loop *m, struct event_list_head *list)
{
struct event *t;
@ -665,8 +664,7 @@ static void thread_list_free(struct event_master *m,
thread_free(m, t);
}
static void thread_array_free(struct event_master *m,
struct event **thread_array)
static void thread_array_free(struct event_loop *m, struct event **thread_array)
{
struct event *t;
int index;
@ -689,7 +687,7 @@ static void thread_array_free(struct event_master *m,
* If we are shutting down, Free up unused threads
* So we can see if we forget to shut anything off
*/
void event_master_free_unused(struct event_master *m)
void event_master_free_unused(struct event_loop *m)
{
frr_with_mutex (&m->mtx) {
struct event *t;
@ -699,7 +697,7 @@ void event_master_free_unused(struct event_master *m)
}
/* Stop thread scheduler. */
void event_master_free(struct event_master *m)
void event_master_free(struct event_loop *m)
{
struct event *t;
@ -791,7 +789,7 @@ char *event_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
}
/* Get new thread. */
static struct event *thread_get(struct event_master *m, uint8_t type,
static struct event *thread_get(struct event_loop *m, uint8_t type,
void (*func)(struct event *), void *arg,
const struct xref_eventsched *xref)
{
@ -838,7 +836,7 @@ static struct event *thread_get(struct event_master *m, uint8_t type,
return thread;
}
static void thread_free(struct event_master *master, struct event *thread)
static void thread_free(struct event_loop *master, struct event *thread)
{
/* Update statistics. */
assert(master->alloc > 0);
@ -849,7 +847,7 @@ static void thread_free(struct event_master *master, struct event *thread)
XFREE(MTYPE_THREAD, thread);
}
static int fd_poll(struct event_master *m, const struct timeval *timer_wait,
static int fd_poll(struct event_loop *m, const struct timeval *timer_wait,
bool *eintr_p)
{
sigset_t origsigs;
@ -948,7 +946,7 @@ done:
/* Add new read thread. */
void _event_add_read_write(const struct xref_eventsched *xref,
struct event_master *m, void (*func)(struct event *),
struct event_loop *m, void (*func)(struct event *),
void *arg, int fd, struct event **t_ptr)
{
int dir = xref->event_type;
@ -1027,7 +1025,7 @@ void _event_add_read_write(const struct xref_eventsched *xref,
}
static void _event_add_timer_timeval(const struct xref_eventsched *xref,
struct event_master *m,
struct event_loop *m,
void (*func)(struct event *), void *arg,
struct timeval *time_relative,
struct event **t_ptr)
@ -1080,9 +1078,9 @@ static void _event_add_timer_timeval(const struct xref_eventsched *xref,
/* Add timer event thread. */
void _event_add_timer(const struct xref_eventsched *xref,
struct event_master *m, void (*func)(struct event *),
void *arg, long timer, struct event **t_ptr)
void _event_add_timer(const struct xref_eventsched *xref, struct event_loop *m,
void (*func)(struct event *), void *arg, long timer,
struct event **t_ptr)
{
struct timeval trel;
@ -1096,7 +1094,7 @@ void _event_add_timer(const struct xref_eventsched *xref,
/* Add timer event thread with "millisecond" resolution */
void _event_add_timer_msec(const struct xref_eventsched *xref,
struct event_master *m, void (*func)(struct event *),
struct event_loop *m, void (*func)(struct event *),
void *arg, long timer, struct event **t_ptr)
{
struct timeval trel;
@ -1111,16 +1109,16 @@ void _event_add_timer_msec(const struct xref_eventsched *xref,
/* Add timer event thread with "timeval" resolution */
void _event_add_timer_tv(const struct xref_eventsched *xref,
struct event_master *m, void (*func)(struct event *),
struct event_loop *m, void (*func)(struct event *),
void *arg, struct timeval *tv, struct event **t_ptr)
{
_event_add_timer_timeval(xref, m, func, arg, tv, t_ptr);
}
/* Add simple event thread. */
void _event_add_event(const struct xref_eventsched *xref,
struct event_master *m, void (*func)(struct event *),
void *arg, int val, struct event **t_ptr)
void _event_add_event(const struct xref_eventsched *xref, struct event_loop *m,
void (*func)(struct event *), void *arg, int val,
struct event **t_ptr)
{
struct event *thread = NULL;
@ -1166,7 +1164,7 @@ void _event_add_event(const struct xref_eventsched *xref,
* - POLLIN
* - POLLOUT
*/
static void event_cancel_rw(struct event_master *master, int fd, short state,
static void event_cancel_rw(struct event_loop *master, int fd, short state,
int idx_hint)
{
bool found = false;
@ -1232,7 +1230,7 @@ static void event_cancel_rw(struct event_master *master, int fd, short state,
* Process task cancellation given a task argument: iterate through the
* various lists of tasks, looking for any that match the argument.
*/
static void cancel_arg_helper(struct event_master *master,
static void cancel_arg_helper(struct event_loop *master,
const struct cancel_req *cr)
{
struct event *t;
@ -1325,7 +1323,7 @@ static void cancel_arg_helper(struct event_master *master,
* @param master the thread master to process
* @REQUIRE master->mtx
*/
static void do_event_cancel(struct event_master *master)
static void do_event_cancel(struct event_loop *master)
{
struct event_list_head *list = NULL;
struct event **thread_array = NULL;
@ -1407,7 +1405,7 @@ static void do_event_cancel(struct event_master *master)
/*
* Helper function used for multiple flavors of arg-based cancellation.
*/
static void cancel_event_helper(struct event_master *m, void *arg, int flags)
static void cancel_event_helper(struct event_loop *m, void *arg, int flags)
{
struct cancel_req *cr;
@ -1436,7 +1434,7 @@ static void cancel_event_helper(struct event_master *m, void *arg, int flags)
* @param m the event_master to cancel from
* @param arg the argument passed when creating the event
*/
void event_cancel_event(struct event_master *master, void *arg)
void event_cancel_event(struct event_loop *master, void *arg)
{
cancel_event_helper(master, arg, 0);
}
@ -1449,7 +1447,7 @@ void event_cancel_event(struct event_master *master, void *arg)
* @param m the event_master to cancel from
* @param arg the argument passed when creating the event
*/
void event_cancel_event_ready(struct event_master *m, void *arg)
void event_cancel_event_ready(struct event_loop *m, void *arg)
{
/* Only cancel ready/event tasks */
@ -1465,7 +1463,7 @@ void event_cancel_event_ready(struct event_master *m, void *arg)
*/
void event_cancel(struct event **thread)
{
struct event_master *master;
struct event_loop *master;
if (thread == NULL || *thread == NULL)
return;
@ -1514,7 +1512,7 @@ void event_cancel(struct event **thread)
* @param thread pointer to thread to cancel
* @param eventobj the event
*/
void event_cancel_async(struct event_master *master, struct event **thread,
void event_cancel_async(struct event_loop *master, struct event **thread,
void *eventobj)
{
assert(!(thread && eventobj) && (thread || eventobj));
@ -1567,7 +1565,7 @@ static struct timeval *thread_timer_wait(struct event_timer_list_head *timers,
return timer_val;
}
static struct event *thread_run(struct event_master *m, struct event *thread,
static struct event *thread_run(struct event_loop *m, struct event *thread,
struct event *fetch)
{
*fetch = *thread;
@ -1575,9 +1573,8 @@ static struct event *thread_run(struct event_master *m, struct event *thread,
return fetch;
}
static int thread_process_io_helper(struct event_master *m,
struct event *thread, short state,
short actual_state, int pos)
static int thread_process_io_helper(struct event_loop *m, struct event *thread,
short state, short actual_state, int pos)
{
struct event **thread_array;
@ -1623,7 +1620,7 @@ static int thread_process_io_helper(struct event_master *m,
* @param m the thread master
* @param num the number of active file descriptors (return value of poll())
*/
static void thread_process_io(struct event_master *m, unsigned int num)
static void thread_process_io(struct event_loop *m, unsigned int num)
{
unsigned int ready = 0;
struct pollfd *pfds = m->handler.copy;
@ -1681,7 +1678,7 @@ static void thread_process_io(struct event_master *m, unsigned int num)
}
/* Add all timers that have popped to the ready list. */
static unsigned int thread_process_timers(struct event_master *m,
static unsigned int thread_process_timers(struct event_loop *m,
struct timeval *timenow)
{
struct timeval prev = *timenow;
@ -1738,7 +1735,7 @@ static unsigned int thread_process(struct event_list_head *list)
/* Fetch next ready thread. */
struct event *event_fetch(struct event_master *m, struct event *fetch)
struct event *event_fetch(struct event_loop *m, struct event *fetch)
{
struct event *thread = NULL;
struct timeval now;
@ -2055,7 +2052,7 @@ void event_call(struct event *thread)
}
/* Execute thread */
void _event_execute(const struct xref_eventsched *xref, struct event_master *m,
void _event_execute(const struct xref_eventsched *xref, struct event_loop *m,
void (*func)(struct event *), void *arg, int val)
{
struct event *thread;

View File

@ -66,7 +66,7 @@ struct xref_eventsched {
};
/* Master of the theads. */
struct event_master {
struct event_loop {
char *name;
struct event **read;
@ -109,7 +109,7 @@ struct event {
struct event_list_item eventitem;
struct event_timer_list_item timeritem;
struct event **ref; /* external reference (if given) */
struct event_master *master; /* pointer to the struct event_master */
struct event_loop *master; /* pointer to the struct event_loop */
void (*func)(struct event *); /* event function */
void *arg; /* event argument */
union {
@ -209,48 +209,48 @@ struct cpu_event_history {
}) /* end */
/* Prototypes. */
extern struct event_master *event_master_create(const char *name);
void event_master_set_name(struct event_master *master, const char *name);
extern void event_master_free(struct event_master *m);
extern void event_master_free_unused(struct event_master *m);
extern struct event_loop *event_master_create(const char *name);
void event_master_set_name(struct event_loop *master, const char *name);
extern void event_master_free(struct event_loop *m);
extern void event_master_free_unused(struct event_loop *m);
extern void _event_add_read_write(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*fn)(struct event *), void *arg, int fd,
struct event **tref);
extern void _event_add_timer(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*fn)(struct event *), void *arg, long t,
struct event **tref);
extern void _event_add_timer_msec(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*fn)(struct event *), void *arg, long t,
struct event **tref);
extern void _event_add_timer_tv(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*fn)(struct event *), void *arg,
struct timeval *tv, struct event **tref);
extern void _event_add_event(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*fn)(struct event *), void *arg, int val,
struct event **tref);
extern void _event_execute(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*fn)(struct event *), void *arg, int val);
extern void event_cancel(struct event **event);
extern void event_cancel_async(struct event_master *m, struct event **eptr,
extern void event_cancel_async(struct event_loop *m, struct event **eptr,
void *data);
/* Cancel ready tasks with an arg matching 'arg' */
extern void event_cancel_event_ready(struct event_master *m, void *arg);
extern void event_cancel_event_ready(struct event_loop *m, void *arg);
/* Cancel all tasks with an arg matching 'arg', including timers and io */
extern void event_cancel_event(struct event_master *m, void *arg);
extern struct event *event_fetch(struct event_master *m, struct event *event);
extern void event_cancel_event(struct event_loop *m, void *arg);
extern struct event *event_fetch(struct event_loop *m, struct event *event);
extern void event_call(struct event *event);
extern unsigned long event_timer_remain_second(struct event *event);
extern struct timeval event_timer_remain(struct event *event);

View File

@ -41,7 +41,7 @@ struct frr_pthread {
struct rcu_thread *rcu_thread;
/* thread master for this pthread's thread.c event loop */
struct event_master *master;
struct event_loop *master;
/* caller-specified data; start & stop funcs, name, id */
struct frr_pthread_attr attr;

View File

@ -150,7 +150,7 @@ out_err:
}
int _frrzmq_event_add_read(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*msgfunc)(void *arg, void *zmqsock),
void (*partfunc)(void *arg, void *zmqsock,
zmq_msg_t *msg, unsigned partnum),
@ -258,7 +258,7 @@ out_err:
}
int _frrzmq_event_add_write(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*msgfunc)(void *arg, void *zmqsock),
void (*errfunc)(void *arg, void *zmqsock),
void *arg, void *zmqsock, struct frrzmq_cb **cbp)
@ -342,7 +342,7 @@ void frrzmq_check_events(struct frrzmq_cb **cbp, struct cb_core *core,
if (zmq_getsockopt(cb->zmqsock, ZMQ_EVENTS, &events, &len))
return;
if ((events & event) && core->thread && !core->cancelled) {
struct event_master *tm = core->thread->master;
struct event_loop *tm = core->thread->master;
event_cancel(&core->thread);

View File

@ -109,14 +109,14 @@ struct frrzmq_cb;
*/
extern int
_frrzmq_event_add_read(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*msgfunc)(void *arg, void *zmqsock),
void (*partfunc)(void *arg, void *zmqsock,
zmq_msg_t *msg, unsigned partnum),
void (*errfunc)(void *arg, void *zmqsock), void *arg,
void *zmqsock, struct frrzmq_cb **cb);
extern int _frrzmq_event_add_write(const struct xref_eventsched *xref,
struct event_master *master,
struct event_loop *master,
void (*msgfunc)(void *arg, void *zmqsock),
void (*errfunc)(void *arg, void *zmqsock),
void *arg, void *zmqsock,

View File

@ -23,7 +23,7 @@ static void vty_do_exit(int isexit)
exit(0);
}
struct event_master *master;
struct event_loop *master;
int main(int argc, char **argv)
{

View File

@ -33,10 +33,10 @@
#include "frrscript.h"
#include "systemd.h"
DEFINE_HOOK(frr_early_init, (struct event_master * tm), (tm));
DEFINE_HOOK(frr_late_init, (struct event_master * tm), (tm));
DEFINE_HOOK(frr_config_pre, (struct event_master * tm), (tm));
DEFINE_HOOK(frr_config_post, (struct event_master * tm), (tm));
DEFINE_HOOK(frr_early_init, (struct event_loop * tm), (tm));
DEFINE_HOOK(frr_late_init, (struct event_loop * tm), (tm));
DEFINE_HOOK(frr_config_pre, (struct event_loop * tm), (tm));
DEFINE_HOOK(frr_config_post, (struct event_loop * tm), (tm));
DEFINE_KOOH(frr_early_fini, (), ());
DEFINE_KOOH(frr_fini, (), ());
@ -696,8 +696,8 @@ static void _err_print(const void *cookie, const char *errstr)
fprintf(stderr, "%s: %s\n", prefix, errstr);
}
static struct event_master *master;
struct event_master *frr_init(void)
static struct event_loop *master;
struct event_loop *frr_init(void)
{
struct option_chain *oc;
struct log_arg *log_arg;
@ -1139,7 +1139,7 @@ void frr_detach(void)
frr_check_detach();
}
void frr_run(struct event_master *master)
void frr_run(struct event_loop *master)
{
char instanceinfo[64] = "";

View File

@ -133,22 +133,22 @@ extern int frr_getopt(int argc, char *const argv[], int *longindex);
extern __attribute__((__noreturn__)) void frr_help_exit(int status);
extern struct event_master *frr_init(void);
extern struct event_loop *frr_init(void);
extern const char *frr_get_progname(void);
extern enum frr_cli_mode frr_get_cli_mode(void);
extern uint32_t frr_get_fd_limit(void);
extern bool frr_is_startup_fd(int fd);
/* call order of these hooks is as ordered here */
DECLARE_HOOK(frr_early_init, (struct event_master * tm), (tm));
DECLARE_HOOK(frr_late_init, (struct event_master * tm), (tm));
DECLARE_HOOK(frr_early_init, (struct event_loop * tm), (tm));
DECLARE_HOOK(frr_late_init, (struct event_loop * tm), (tm));
/* fork() happens between late_init and config_pre */
DECLARE_HOOK(frr_config_pre, (struct event_master * tm), (tm));
DECLARE_HOOK(frr_config_post, (struct event_master * tm), (tm));
DECLARE_HOOK(frr_config_pre, (struct event_loop * tm), (tm));
DECLARE_HOOK(frr_config_post, (struct event_loop * tm), (tm));
extern void frr_config_fork(void);
extern void frr_run(struct event_master *master);
extern void frr_run(struct event_loop *master);
extern void frr_detach(void);
extern bool frr_zclient_addr(struct sockaddr_storage *sa, socklen_t *sa_len,

View File

@ -73,7 +73,7 @@ TRACEPOINT_EVENT(
TRACEPOINT_LOGLEVEL(frr_libfrr, hash_release, TRACE_INFO)
#define THREAD_SCHEDULE_ARGS \
TP_ARGS(struct event_master *, master, const char *, funcname, \
TP_ARGS(struct event_loop *, master, const char *, funcname, \
const char *, schedfrom, int, fromln, struct event **, \
thread_ptr, int, fd, int, val, void *, arg, long, time)

View File

@ -105,7 +105,7 @@ DECLARE_LIST(mgmt_be_txns, struct mgmt_be_txn_ctx, list_linkage);
struct mgmt_be_client_ctx {
int conn_fd;
struct event_master *tm;
struct event_loop *tm;
struct event *conn_retry_tmr;
struct event *conn_read_ev;
struct event *conn_write_ev;
@ -1106,7 +1106,7 @@ extern struct nb_config *running_config;
* Initialize library and try connecting with MGMTD.
*/
uintptr_t mgmt_be_client_lib_init(struct mgmt_be_client_params *params,
struct event_master *master_thread)
struct event_loop *master_thread)
{
assert(master_thread && params && strlen(params->name)
&& !mgmt_be_client_ctx.tm);

View File

@ -189,7 +189,7 @@ mgmt_be_client_name2id(const char *name)
* Backend client lib handler (nothing but address of mgmt_be_client_ctx)
*/
extern uintptr_t mgmt_be_client_lib_init(struct mgmt_be_client_params *params,
struct event_master *master_thread);
struct event_loop *master_thread);
/*
* Subscribe with MGMTD for one or more YANG subtree(s).

View File

@ -49,7 +49,7 @@ DEFINE_MTYPE_STATIC(LIB, MGMTD_FE_SESSION, "MGMTD Frontend session");
struct mgmt_fe_client_ctx {
int conn_fd;
struct event_master *tm;
struct event_loop *tm;
struct event *conn_retry_tmr;
struct event *conn_read_ev;
struct event *conn_write_ev;
@ -784,7 +784,7 @@ static void mgmt_fe_client_schedule_conn_retry(
* Initialize library and try connecting with MGMTD.
*/
uintptr_t mgmt_fe_client_lib_init(struct mgmt_fe_client_params *params,
struct event_master *master_thread)
struct event_loop *master_thread)
{
assert(master_thread && params && strlen(params->name)
&& !mgmt_fe_client_ctx.tm);

View File

@ -131,7 +131,7 @@ struct mgmt_fe_client_params {
* Frontend client lib handler (nothing but address of mgmt_fe_client_ctx)
*/
extern uintptr_t mgmt_fe_client_lib_init(struct mgmt_fe_client_params *params,
struct event_master *master_thread);
struct event_loop *master_thread);
/*
* Create a new Session for a Frontend Client connection.

View File

@ -2685,7 +2685,7 @@ void nb_validate_callbacks(void)
}
void nb_init(struct event_master *tm,
void nb_init(struct event_loop *tm,
const struct frr_yang_module_info *const modules[],
size_t nmodules, bool db_enabled)
{

View File

@ -1478,7 +1478,7 @@ void nb_validate_callbacks(void);
* db_enabled
* Set this to record the transactions in the transaction log.
*/
extern void nb_init(struct event_master *tm,
extern void nb_init(struct event_loop *tm,
const struct frr_yang_module_info *const modules[],
size_t nmodules, bool db_enabled);

View File

@ -29,7 +29,7 @@ struct debug nb_dbg_events = {0, "Northbound events"};
struct debug nb_dbg_libyang = {0, "libyang debugging"};
struct nb_config *vty_shared_candidate_config;
static struct event_master *master;
static struct event_loop *master;
static void vty_show_nb_errors(struct vty *vty, int error, const char *errmsg)
{
@ -1876,7 +1876,7 @@ static const struct cmd_variable_handler yang_var_handlers[] = {
.completions = yang_translator_autocomplete},
{.completions = NULL}};
void nb_cli_init(struct event_master *tm)
void nb_cli_init(struct event_loop *tm)
{
master = tm;

View File

@ -137,7 +137,7 @@ extern void nb_cli_show_config_prepare(struct nb_config *config,
extern void nb_cli_confirmed_commit_clean(struct vty *vty);
extern int nb_cli_confirmed_commit_rollback(struct vty *vty);
extern void nb_cli_install_default(int node);
extern void nb_cli_init(struct event_master *tm);
extern void nb_cli_init(struct event_loop *tm);
extern void nb_cli_terminate(void);
#ifdef __cplusplus

View File

@ -23,7 +23,7 @@ DEFINE_MTYPE_STATIC(LIB, CONFD, "ConfD module");
static struct debug nb_dbg_client_confd = {0, "Northbound client: ConfD"};
static struct event_master *master;
static struct event_loop *master;
static struct sockaddr confd_addr;
static int cdb_sub_sock, dp_ctl_sock, dp_worker_sock;
static struct event *t_cdb_sub, *t_dp_ctl, *t_dp_worker;
@ -1465,7 +1465,7 @@ static int frr_confd_finish(void)
return 0;
}
static int frr_confd_module_late_init(struct event_master *tm)
static int frr_confd_module_late_init(struct event_loop *tm)
{
master = tm;

View File

@ -38,7 +38,7 @@
*/
static bool nb_dbg_client_grpc = 0;
static struct event_master *main_master;
static struct event_loop *main_master;
static struct frr_pthread *fpt;
@ -1298,7 +1298,7 @@ error:
flog_err(EC_LIB_GRPC_INIT, "failed to initialize the gRPC module");
}
static int frr_grpc_module_late_init(struct event_master *tm)
static int frr_grpc_module_late_init(struct event_loop *tm)
{
main_master = tm;
hook_register(frr_fini, frr_grpc_finish);

View File

@ -23,7 +23,7 @@ DEFINE_MTYPE_STATIC(LIB, SYSREPO, "Sysrepo module");
static struct debug nb_dbg_client_sysrepo = {0, "Northbound client: Sysrepo"};
static struct event_master *master;
static struct event_loop *master;
static sr_session_ctx_t *session;
static sr_conn_ctx_t *connection;
static struct nb_transaction *transaction;
@ -721,7 +721,7 @@ static int frr_sr_finish(void)
return 0;
}
static int frr_sr_module_config_loaded(struct event_master *tm)
static int frr_sr_module_config_loaded(struct event_loop *tm)
{
master = tm;
@ -736,7 +736,7 @@ static int frr_sr_module_config_loaded(struct event_master *tm)
return 0;
}
static int frr_sr_module_late_init(struct event_master *tm)
static int frr_sr_module_late_init(struct event_loop *tm)
{
frr_sr_cli_init();

View File

@ -16,7 +16,7 @@
struct pullwr {
int fd;
struct event_master *tm;
struct event_loop *tm;
/* writer == NULL <=> we're idle */
struct event *writer;
@ -40,7 +40,7 @@ DEFINE_MTYPE_STATIC(LIB, PULLWR_BUF, "pull-driven write buffer");
static void pullwr_run(struct event *t);
struct pullwr *_pullwr_new(struct event_master *tm, int fd, void *arg,
struct pullwr *_pullwr_new(struct event_loop *tm, int fd, void *arg,
void (*fill)(void *, struct pullwr *),
void (*err)(void *, struct pullwr *, bool))
{

View File

@ -45,7 +45,7 @@ struct pullwr;
* and released with pullwr_del(). This can be done from inside the callback,
* the pullwr code holds no more references on it when calling err().
*/
extern struct pullwr *_pullwr_new(struct event_master *tm, int fd, void *arg,
extern struct pullwr *_pullwr_new(struct event_loop *tm, int fd, void *arg,
void (*fill)(void *, struct pullwr *),
void (*err)(void *, struct pullwr *,
bool eof));

View File

@ -23,7 +23,7 @@ XREF_SETUP();
struct resolver_state {
ares_channel channel;
struct event_master *master;
struct event_loop *master;
struct event *timeout;
};
@ -314,7 +314,7 @@ static int resolver_config_write_debug(struct vty *vty)
}
void resolver_init(struct event_master *tm)
void resolver_init(struct event_loop *tm)
{
struct ares_options ares_opts;

View File

@ -22,7 +22,7 @@ struct resolver_query {
struct event *literal_cb;
};
void resolver_init(struct event_master *tm);
void resolver_init(struct event_loop *tm);
void resolver_resolve(struct resolver_query *query, int af, vrf_id_t vrf_id,
const char *hostname,
void (*cb)(struct resolver_query *, const char *, int,

View File

@ -331,8 +331,7 @@ static void trap_default_signals(void)
}
}
void signal_init(struct event_master *m, int sigc,
struct frr_signal_t signals[])
void signal_init(struct event_loop *m, int sigc, struct frr_signal_t signals[])
{
int i = 0;

View File

@ -25,12 +25,12 @@ struct frr_signal_t {
/* initialise sigevent system
* takes:
* - pointer to valid struct event_master
* - pointer to valid struct event_loop
* - number of elements in passed in signals array
* - array of frr_signal_t's describing signals to handle
* and handlers to use for each signal
*/
extern void signal_init(struct event_master *m, int sigc,
extern void signal_init(struct event_loop *m, int sigc,
struct frr_signal_t *signals);

View File

@ -99,7 +99,7 @@ struct index_oid {
*/
extern bool smux_enabled(void);
extern void smux_init(struct event_master *tm);
extern void smux_init(struct event_loop *tm);
extern void smux_agentx_enable(void);
extern void smux_register_mib(const char *, struct variable *, size_t, int,
oid[], size_t);

View File

@ -37,7 +37,7 @@ enum spf_backoff_state {
};
struct spf_backoff {
struct event_master *m;
struct event_loop *m;
/* Timers as per draft */
long init_delay;
@ -70,7 +70,7 @@ static const char *spf_backoff_state2str(enum spf_backoff_state state)
return "???";
}
struct spf_backoff *spf_backoff_new(struct event_master *m, const char *name,
struct spf_backoff *spf_backoff_new(struct event_loop *m, const char *name,
long init_delay, long short_delay,
long long_delay, long holddown,
long timetolearn)

View File

@ -18,10 +18,10 @@ extern "C" {
#endif
struct spf_backoff;
struct event_master;
struct event_loop;
struct vty;
struct spf_backoff *spf_backoff_new(struct event_master *m, const char *name,
struct spf_backoff *spf_backoff_new(struct event_loop *m, const char *name,
long init_delay, long short_delay,
long long_delay, long holddown,
long timetolearn);

View File

@ -63,7 +63,7 @@ void systemd_send_stopping(void)
systemd_send_information("STOPPING=1");
}
static struct event_master *systemd_master = NULL;
static struct event_loop *systemd_master = NULL;
static void systemd_send_watchdog(struct event *t)
{
@ -74,7 +74,7 @@ static void systemd_send_watchdog(struct event *t)
watchdog_msec, NULL);
}
void systemd_send_started(struct event_master *m)
void systemd_send_started(struct event_loop *m)
{
assert(m != NULL);

View File

@ -21,11 +21,11 @@ extern bool sd_stderr_is_journal;
void systemd_send_stopping(void);
/*
* master - The struct event_master * to use to schedule ourself
* master - The struct event_loop * to use to schedule ourself
* the_process - Should we send watchdog if we are not the requested
* process?
*/
void systemd_send_started(struct event_master *master);
void systemd_send_started(struct event_loop *master);
/*
* status - A status string to send to systemd

View File

@ -2801,7 +2801,7 @@ int vty_config_node_exit(struct vty *vty)
}
/* Master of the threads. */
static struct event_master *vty_master;
static struct event_loop *vty_master;
static void vty_event_serv(enum vty_event event, struct vty_serv *vty_serv)
{
@ -3655,7 +3655,7 @@ int vty_mgmt_send_get_data(struct vty *vty, Mgmtd__DatastoreId datastore,
}
/* Install vty's own commands like `who' command. */
void vty_init(struct event_master *master_thread, bool do_command_logging)
void vty_init(struct event_loop *master_thread, bool do_command_logging)
{
/* For further configuration read, preserve current directory. */
vty_save_cwd();

View File

@ -337,7 +337,7 @@ struct vty_arg {
extern struct nb_config *vty_mgmt_candidate_config;
/* Prototypes. */
extern void vty_init(struct event_master *m, bool do_command_logging);
extern void vty_init(struct event_loop *m, bool do_command_logging);
extern void vty_init_vtysh(void);
extern void vty_terminate(void);
extern void vty_reset(void);

View File

@ -60,7 +60,7 @@ static void wheel_timer_thread(struct event *t)
event_execute(wheel->master, wheel_timer_thread_helper, wheel, 0);
}
struct timer_wheel *wheel_init(struct event_master *master, int period,
struct timer_wheel *wheel_init(struct event_loop *master, int period,
size_t slots,
unsigned int (*slot_key)(const void *),
void (*slot_run)(void *), const char *run_name)

View File

@ -13,7 +13,7 @@ extern "C" {
struct timer_wheel {
char *name;
struct event_master *master;
struct event_loop *master;
int slots;
long long curr_slot;
unsigned int period;
@ -66,7 +66,7 @@ struct timer_wheel {
* and cause significant amount of time handling thread events instead
* of running your code.
*/
struct timer_wheel *wheel_init(struct event_master *master, int period,
struct timer_wheel *wheel_init(struct event_loop *master, int period,
size_t slots,
unsigned int (*slot_key)(const void *),
void (*slot_run)(void *), const char *run_name);

View File

@ -59,8 +59,7 @@ static void work_queue_item_remove(struct work_queue *wq,
}
/* create new work queue */
struct work_queue *work_queue_new(struct event_master *m,
const char *queue_name)
struct work_queue *work_queue_new(struct event_loop *m, const char *queue_name)
{
struct work_queue *new;

View File

@ -47,7 +47,7 @@ struct work_queue {
/* Everything but the specification struct is private
* the following may be read
*/
struct event_master *master; /* thread master */
struct event_loop *master; /* thread master */
struct event *thread; /* thread, if one is active */
char *name; /* work queue name */
@ -137,7 +137,7 @@ static inline void work_queue_item_dequeue(struct work_queue *wq,
* user must fill in the spec of the returned work queue before adding
* anything to it
*/
extern struct work_queue *work_queue_new(struct event_master *m,
extern struct work_queue *work_queue_new(struct event_loop *m,
const char *queue_name);
/* destroy work queue */

View File

@ -51,7 +51,7 @@ socklen_t zclient_addr_len;
static int zclient_debug;
/* Allocate zclient structure. */
struct zclient *zclient_new(struct event_master *master,
struct zclient *zclient_new(struct event_loop *master,
struct zclient_options *opt,
zclient_handler *const *handlers, size_t n_handlers)
{

View File

@ -290,7 +290,7 @@ typedef int (zclient_handler)(ZAPI_CALLBACK_ARGS);
/* Structure for the zebra client. */
struct zclient {
/* The thread master we schedule ourselves on */
struct event_master *master;
struct event_loop *master;
/* Privileges to change socket values */
struct zebra_privs_t *privs;
@ -862,7 +862,7 @@ int zclient_neigh_ip_encode(struct stream *s, uint16_t cmd, union sockunion *in,
extern uint32_t zclient_get_nhg_start(uint32_t proto);
extern struct zclient *zclient_new(struct event_master *m,
extern struct zclient *zclient_new(struct event_loop *m,
struct zclient_options *opt,
zclient_handler *const *handlers,
size_t n_handlers);

View File

@ -14,7 +14,7 @@
#include "qobj.h"
struct event;
struct event_master;
struct event_loop;
enum zlog_5424_dst {
/* can be used to disable a target temporarily */
@ -78,7 +78,7 @@ struct zlog_cfg_5424 {
*/
/* sockets only - read handler to reconnect on errors */
struct event_master *master;
struct event_loop *master;
struct event *t_reconnect;
unsigned int reconn_backoff, reconn_backoff_cur, reconn_backoff_max;
int sock_type;

View File

@ -28,7 +28,7 @@ DECLARE_RBTREE_UNIQ(targets, struct zlog_cfg_5424_user, targets_item,
DEFINE_QOBJ_TYPE(zlog_cfg_5424_user);
static struct targets_head targets = INIT_RBTREE_UNIQ(targets);
static struct event_master *log_5424_master;
static struct event_loop *log_5424_master;
static void clear_dst(struct zlog_cfg_5424_user *cfg);
@ -948,7 +948,7 @@ void log_5424_cmd_init(void)
/* hooks */
static int log_5424_early_init(struct event_master *master);
static int log_5424_early_init(struct event_loop *master);
static int log_5424_rotate(void);
static int log_5424_fini(void);
@ -959,7 +959,7 @@ __attribute__((_CONSTRUCTOR(475))) static void zlog_5424_startup_init(void)
hook_register(frr_fini, log_5424_fini);
}
static int log_5424_early_init(struct event_master *master)
static int log_5424_early_init(struct event_loop *master)
{
log_5424_master = master;

View File

@ -27,7 +27,7 @@ static struct mgmt_master mgmt_master;
/* MGMTD process wide configuration pointer to export. */
struct mgmt_master *mm;
void mgmt_master_init(struct event_master *master, const int buffer_size)
void mgmt_master_init(struct event_loop *master, const int buffer_size)
{
memset(&mgmt_master, 0, sizeof(struct mgmt_master));

View File

@ -34,7 +34,7 @@ struct mgmt_txn_ctx;
* MGMTD master for system wide configurations and variables.
*/
struct mgmt_master {
struct event_master *master;
struct event_loop *master;
/* How big should we set the socket buffer size */
uint32_t socket_buffer;
@ -95,8 +95,7 @@ extern time_t mgmt_clock(void);
extern int mgmt_config_write(struct vty *vty);
extern void mgmt_master_init(struct event_master *master,
const int buffer_size);
extern void mgmt_master_init(struct event_loop *master, const int buffer_size);
extern void mgmt_init(void);
extern void mgmt_vty_init(void);

View File

@ -106,7 +106,7 @@ static struct mgmt_be_xpath_regexp_map
mgmt_xpath_map[MGMTD_BE_MAX_NUM_XPATH_MAP];
static int mgmt_num_xpath_maps;
static struct event_master *mgmt_be_adapter_tm;
static struct event_loop *mgmt_be_adapter_tm;
static struct mgmt_be_adapters_head mgmt_be_adapters;
@ -805,7 +805,7 @@ extern void mgmt_be_adapter_unlock(struct mgmt_be_client_adapter **adapter)
*adapter = NULL;
}
int mgmt_be_adapter_init(struct event_master *tm)
int mgmt_be_adapter_init(struct event_loop *tm)
{
if (!mgmt_be_adapter_tm) {
mgmt_be_adapter_tm = tm;

View File

@ -92,7 +92,7 @@ struct mgmt_be_client_subscr_info {
};
/* Initialise backend adapter module. */
extern int mgmt_be_adapter_init(struct event_master *tm);
extern int mgmt_be_adapter_init(struct event_loop *tm);
/* Destroy the backend adapter module. */
extern void mgmt_be_adapter_destroy(void);

View File

@ -29,7 +29,7 @@
#endif /* REDIRECT_DEBUG_TO_STDERR */
static int mgmt_be_listen_fd = -1;
static struct event_master *mgmt_be_listen_tm;
static struct event_loop *mgmt_be_listen_tm;
static struct event *mgmt_be_listen_ev;
static void mgmt_be_server_register_event(enum mgmt_be_event event);
@ -126,7 +126,7 @@ mgmt_be_server_start_failed:
exit(-1);
}
int mgmt_be_server_init(struct event_master *master)
int mgmt_be_server_init(struct event_loop *master)
{
if (mgmt_be_listen_tm) {
MGMTD_BE_SRVR_DBG("MGMTD Backend Server already running!");

View File

@ -12,7 +12,7 @@
#define MGMTD_BE_MAX_CONN 32
/* Initialise backend server */
extern int mgmt_be_server_init(struct event_master *master);
extern int mgmt_be_server_init(struct event_loop *master);
/* Destroy backend server */
extern void mgmt_be_server_destroy(void);

View File

@ -62,7 +62,7 @@ DECLARE_LIST(mgmt_fe_sessions, struct mgmt_fe_session_ctx, list_linkage);
#define FOREACH_SESSION_IN_LIST(adapter, session) \
frr_each_safe (mgmt_fe_sessions, &(adapter)->fe_sessions, (session))
static struct event_master *mgmt_fe_adapter_tm;
static struct event_loop *mgmt_fe_adapter_tm;
static struct mgmt_master *mgmt_fe_adapter_mm;
static struct mgmt_fe_adapters_head mgmt_fe_adapters;
@ -1549,7 +1549,7 @@ mgmt_fe_adapter_unlock(struct mgmt_fe_client_adapter **adapter)
*adapter = NULL;
}
int mgmt_fe_adapter_init(struct event_master *tm, struct mgmt_master *mm)
int mgmt_fe_adapter_init(struct event_loop *tm, struct mgmt_master *mm)
{
if (!mgmt_fe_adapter_tm) {
mgmt_fe_adapter_tm = tm;

View File

@ -82,8 +82,7 @@ struct mgmt_fe_client_adapter {
DECLARE_LIST(mgmt_fe_adapters, struct mgmt_fe_client_adapter, list_linkage);
/* Initialise frontend adapter module */
extern int mgmt_fe_adapter_init(struct event_master *tm,
struct mgmt_master *cm);
extern int mgmt_fe_adapter_init(struct event_loop *tm, struct mgmt_master *cm);
/* Destroy frontend adapter module */
extern void mgmt_fe_adapter_destroy(void);

View File

@ -29,7 +29,7 @@
#endif /* REDIRECT_DEBUG_TO_STDERR */
static int mgmt_fe_listen_fd = -1;
static struct event_master *mgmt_fe_listen_tm;
static struct event_loop *mgmt_fe_listen_tm;
static struct event *mgmt_fe_listen_ev;
static void mgmt_fe_server_register_event(enum mgmt_fe_event event);
@ -126,7 +126,7 @@ mgmt_fe_server_start_failed:
exit(-1);
}
int mgmt_fe_server_init(struct event_master *master)
int mgmt_fe_server_init(struct event_loop *master)
{
if (mgmt_fe_listen_tm) {
MGMTD_FE_SRVR_DBG("MGMTD Frontend Server already running!");

View File

@ -12,7 +12,7 @@
#define MGMTD_FE_MAX_CONN 32
/* Initialise frontend server */
extern int mgmt_fe_server_init(struct event_master *master);
extern int mgmt_fe_server_init(struct event_loop *master);
/* Destroy frontend server */
extern void mgmt_fe_server_destroy(void);

View File

@ -286,7 +286,7 @@ static int
mgmt_txn_send_be_txn_delete(struct mgmt_txn_ctx *txn,
struct mgmt_be_client_adapter *adapter);
static struct event_master *mgmt_txn_tm;
static struct event_loop *mgmt_txn_tm;
static struct mgmt_master *mgmt_txn_mm;
static void mgmt_txn_register_event(struct mgmt_txn_ctx *txn,
@ -2260,7 +2260,7 @@ static void mgmt_txn_register_event(struct mgmt_txn_ctx *txn,
}
}
int mgmt_txn_init(struct mgmt_master *mm, struct event_master *tm)
int mgmt_txn_init(struct mgmt_master *mm, struct event_loop *tm)
{
if (mgmt_txn_mm || mgmt_txn_tm)
assert(!"MGMTD TXN: Call txn_init() only once");

View File

@ -65,7 +65,7 @@ static inline const char *mgmt_txn_type2str(enum mgmt_txn_type type)
}
/* Initialise transaction module. */
extern int mgmt_txn_init(struct mgmt_master *cm, struct event_master *tm);
extern int mgmt_txn_init(struct mgmt_master *cm, struct event_loop *tm);
/* Destroy the transaction module. */
extern void mgmt_txn_destroy(void);

View File

@ -28,7 +28,7 @@ DEFINE_MGROUP(NHRPD, "NHRP");
unsigned int debug_flags = 0;
struct event_master *master;
struct event_loop *master;
struct timeval current_time;
/* nhrpd options. */

View File

@ -19,7 +19,7 @@ DECLARE_MGROUP(NHRPD);
#define NHRP_VTY_PORT 2610
#define NHRP_DEFAULT_CONFIG "nhrpd.conf"
extern struct event_master *master;
extern struct event_loop *master;
enum { NHRP_OK = 0,
NHRP_ERR_FAIL,

View File

@ -62,7 +62,7 @@ struct zebra_privs_t ospf6d_privs = {
struct option longopts[] = {{0}};
/* Master of threads. */
struct event_master *master;
struct event_loop *master;
static void __attribute__((noreturn)) ospf6_exit(int status)
{

View File

@ -1383,7 +1383,7 @@ static int ospf6TrapIfStateChange(struct ospf6_interface *oi, int next_state,
}
/* Register OSPFv3-MIB. */
static int ospf6_snmp_init(struct event_master *master)
static int ospf6_snmp_init(struct event_loop *master)
{
smux_init(master);
REGISTER_MIB("OSPFv3MIB", ospfv3_variables, variable, ospfv3_oid);

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