diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-12-11 17:20:40 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-03-24 13:32:17 +0100 |
commit | 2453d15dbf7fff2d897c2182886486732be8ac35 (patch) | |
tree | 7a054859acf25689f67d5df7aa9d50b20bca4b62 | |
parent | *: Convert a bunch of thread_XX to event_XX (diff) | |
download | frr-2453d15dbf7fff2d897c2182886486732be8ac35.tar.xz frr-2453d15dbf7fff2d897c2182886486732be8ac35.zip |
*: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
197 files changed, 342 insertions, 350 deletions
diff --git a/babeld/babel_main.c b/babeld/babel_main.c index de0c8230f..b4087bb79 100644 --- a/babeld/babel_main.c +++ b/babeld/babel_main.c @@ -37,7 +37,7 @@ static void babel_exit_properly(void); static void babel_save_state_file(void); -struct thread_master *master; /* quagga's threads handler */ +struct event_master *master; /* quagga's threads handler */ struct timeval babel_now; /* current time */ unsigned char myid[8]; /* unique id (mac address of an interface) */ diff --git a/babeld/babel_main.h b/babeld/babel_main.h index 659ddc70c..30d1729c6 100644 --- a/babeld/babel_main.h +++ b/babeld/babel_main.h @@ -9,7 +9,7 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek #include "vty.h" extern struct timeval babel_now; /* current time */ -extern struct thread_master *master; /* quagga's threads handler */ +extern struct event_master *master; /* quagga's threads handler */ extern int debug; extern int resend_delay; diff --git a/bfdd/bfd.h b/bfdd/bfd.h index 59b0494aa..025eae94d 100644 --- a/bfdd/bfd.h +++ b/bfdd/bfd.h @@ -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 thread_master *master; +extern struct event_master *master; void bfd_recvtimer_cb(struct event *t); void bfd_echo_recvtimer_cb(struct event *t); diff --git a/bfdd/bfdd.c b/bfdd/bfdd.c index 77d66ae10..dbf5a6232 100644 --- a/bfdd/bfdd.c +++ b/bfdd/bfdd.c @@ -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 thread_master *master; +struct event_master *master; /* BFDd privileges */ static zebra_capabilities_t _caps_p[] = {ZCAP_BIND, ZCAP_SYS_ADMIN, ZCAP_NET_RAW}; diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index bdbaf6226..024611588 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -609,7 +609,7 @@ DEFUN(no_neighbor_bfd_profile, no_neighbor_bfd_profile_cmd, } #endif /* HAVE_BFDD */ -void bgp_bfd_init(struct thread_master *tm) +void bgp_bfd_init(struct event_master *tm) { /* Initialize BFD client functions */ bfd_protocol_integration_init(zclient, tm); diff --git a/bgpd/bgp_bfd.h b/bgpd/bgp_bfd.h index c4045d474..bd19cc337 100644 --- a/bgpd/bgp_bfd.h +++ b/bgpd/bgp_bfd.h @@ -12,7 +12,7 @@ ((((peer)->sort == BGP_PEER_IBGP) && !(peer)->shared_network) \ || is_ebgp_multihop_configured((peer))) -extern void bgp_bfd_init(struct thread_master *tm); +extern void bgp_bfd_init(struct event_master *tm); extern void bgp_bfd_peer_config_write(struct vty *vty, const struct peer *peer, const char *addr); diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 8b953e5c9..22bfefc83 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -2526,7 +2526,7 @@ static int bmp_config_write(struct bgp *bgp, struct vty *vty) return 0; } -static int bgp_bmp_init(struct thread_master *tm) +static int bgp_bmp_init(struct event_master *tm) { install_node(&bmp_node); install_default(BMP_NODE); diff --git a/bgpd/bgp_labelpool.c b/bgpd/bgp_labelpool.c index 629f0c7dd..0ca3ce6a4 100644 --- a/bgpd/bgp_labelpool.c +++ b/bgpd/bgp_labelpool.c @@ -177,7 +177,7 @@ static void lp_chunk_free(void *goner) XFREE(MTYPE_BGP_LABEL_CHUNK, goner); } -void bgp_lp_init(struct thread_master *master, struct labelpool *pool) +void bgp_lp_init(struct event_master *master, struct labelpool *pool) { if (BGP_DEBUG(labelpool, LABELPOOL)) zlog_debug("%s: entry", __func__); diff --git a/bgpd/bgp_labelpool.h b/bgpd/bgp_labelpool.h index 955ab2d69..73a16f03b 100644 --- a/bgpd/bgp_labelpool.h +++ b/bgpd/bgp_labelpool.h @@ -31,7 +31,7 @@ struct labelpool { uint32_t next_chunksize; /* request this many labels */ }; -extern void bgp_lp_init(struct thread_master *master, struct labelpool *pool); +extern void bgp_lp_init(struct event_master *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)); diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index 0d46fccf3..603ec9c27 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -591,7 +591,7 @@ err: } -static int bgp_rpki_init(struct thread_master *master) +static int bgp_rpki_init(struct event_master *master) { rpki_debug = false; rtr_is_running = false; diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 7408b7765..940b8d3db 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -30,7 +30,7 @@ #include "bgpd/bgp_snmp_bgp4v2.h" #include "bgpd/bgp_mplsvpn_snmp.h" -static int bgp_snmp_init(struct thread_master *tm) +static int bgp_snmp_init(struct event_master *tm) { smux_init(tm); bgp_snmp_bgp4_init(tm); diff --git a/bgpd/bgp_snmp_bgp4.c b/bgpd/bgp_snmp_bgp4.c index 3bf3c61bf..c673eacec 100644 --- a/bgpd/bgp_snmp_bgp4.c +++ b/bgpd/bgp_snmp_bgp4.c @@ -791,7 +791,7 @@ int bgpTrapBackwardTransition(struct peer *peer) return 0; } -int bgp_snmp_bgp4_init(struct thread_master *tm) +int bgp_snmp_bgp4_init(struct event_master *tm) { REGISTER_MIB("mibII/bgp", bgp_variables, variable, bgp_oid); return 0; diff --git a/bgpd/bgp_snmp_bgp4.h b/bgpd/bgp_snmp_bgp4.h index dffbf5fec..8030d638b 100644 --- a/bgpd/bgp_snmp_bgp4.h +++ b/bgpd/bgp_snmp_bgp4.h @@ -71,6 +71,6 @@ extern int bgpTrapEstablished(struct peer *peer); extern int bgpTrapBackwardTransition(struct peer *peer); -extern int bgp_snmp_bgp4_init(struct thread_master *tm); +extern int bgp_snmp_bgp4_init(struct event_master *tm); #endif /* _FRR_BGP_SNMP_BGP4_H_ */ diff --git a/bgpd/bgp_snmp_bgp4v2.c b/bgpd/bgp_snmp_bgp4v2.c index 61615be2c..3cafb4330 100644 --- a/bgpd/bgp_snmp_bgp4v2.c +++ b/bgpd/bgp_snmp_bgp4v2.c @@ -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 thread_master *tm) +int bgp_snmp_bgp4v2_init(struct event_master *tm) { REGISTER_MIB("mibII/bgpv2", bgpv2_variables, variable, bgpv2_oid); return 0; diff --git a/bgpd/bgp_snmp_bgp4v2.h b/bgpd/bgp_snmp_bgp4v2.h index 67f45a617..134ab15b6 100644 --- a/bgpd/bgp_snmp_bgp4v2.h +++ b/bgpd/bgp_snmp_bgp4v2.h @@ -81,6 +81,6 @@ #define BGP4V2_ESTABLISHED_NOTIFICATION 1 #define BGP4V2_BACKWARD_TRANSITION_NOTIFICATION 2 -extern int bgp_snmp_bgp4v2_init(struct thread_master *tm); +extern int bgp_snmp_bgp4v2_init(struct event_master *tm); #endif /* _FRR_BGP_SNMP_BGP4V2_H_ */ diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index ea98d6168..310b4162c 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -3443,7 +3443,7 @@ void bgp_if_init(void) hook_register_prio(if_del, 0, bgp_if_delete_hook); } -void bgp_zebra_init(struct thread_master *master, unsigned short instance) +void bgp_zebra_init(struct event_master *master, unsigned short instance) { zclient_num_connects = 0; diff --git a/bgpd/bgp_zebra.h b/bgpd/bgp_zebra.h index 6f28f7b90..cfa75b9e4 100644 --- a/bgpd/bgp_zebra.h +++ b/bgpd/bgp_zebra.h @@ -18,7 +18,7 @@ /* Default weight for next hop, if doing weighted ECMP. */ #define BGP_ZEBRA_DEFAULT_NHOP_WEIGHT 1 -extern void bgp_zebra_init(struct thread_master *master, +extern void bgp_zebra_init(struct event_master *master, unsigned short instance); extern void bgp_if_init(void); extern void bgp_zebra_init_tm_connect(struct bgp *bgp); diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 73d183ac9..abacde9d9 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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 thread_master *master, const int buffer_size, +void bgp_master_init(struct event_master *master, const int buffer_size, struct list *addresses) { qobj_init(); diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index ff93e0ee5..113571427 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -98,7 +98,7 @@ struct bgp_master { struct list *bgp; /* BGP thread master. */ - struct thread_master *master; + struct event_master *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 thread_master *master, const int buffer_size, +extern void bgp_master_init(struct event_master *master, const int buffer_size, struct list *addresses); extern void bgp_init(unsigned short instance); diff --git a/bgpd/rfapi/rfapi.h b/bgpd/rfapi/rfapi.h index 44f7507d5..18db46e28 100644 --- a/bgpd/rfapi/rfapi.h +++ b/bgpd/rfapi/rfapi.h @@ -335,8 +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 thread_master *master, - struct rfapi_rfp_cfg **cfgp, +extern void *rfp_start(struct event_master *master, struct rfapi_rfp_cfg **cfgp, struct rfapi_rfp_cb_methods **cbmp); /*------------------------------------------ diff --git a/bgpd/rfapi/rfapi_backend.h b/bgpd/rfapi/rfapi_backend.h index 3870c31fc..e8f320da8 100644 --- a/bgpd/rfapi/rfapi_backend.h +++ b/bgpd/rfapi/rfapi_backend.h @@ -14,7 +14,7 @@ #include "bgpd/bgp_nexthop.h" extern void rfapi_init(void); -extern void vnc_zebra_init(struct thread_master *master); +extern void vnc_zebra_init(struct event_master *master); extern void vnc_zebra_destroy(void); extern void rfapi_delete(struct bgp *); diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 4dab0bc33..99ecd8411 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -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 thread_master *master) +void vnc_zebra_init(struct event_master *master) { /* Set default values. */ zclient_vnc = zclient_new(master, &zclient_options_default, diff --git a/bgpd/rfp-example/librfp/rfp_example.c b/bgpd/rfp-example/librfp/rfp_example.c index 3a512902e..bc944e160 100644 --- a/bgpd/rfp-example/librfp/rfp_example.c +++ b/bgpd/rfp-example/librfp/rfp_example.c @@ -17,7 +17,7 @@ struct rfp_instance_t { struct rfapi_rfp_cfg rfapi_config; struct rfapi_rfp_cb_methods rfapi_callbacks; - struct thread_master *master; + struct event_master *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 thread_master *master, struct rfapi_rfp_cfg **cfgp, +void *rfp_start(struct event_master *master, struct rfapi_rfp_cfg **cfgp, struct rfapi_rfp_cb_methods **cbmp) { memset(&global_rfi, 0, sizeof(global_rfi)); diff --git a/doc/developer/modules.rst b/doc/developer/modules.rst index 89d2f81f1..6dd65d67d 100644 --- a/doc/developer/modules.rst +++ b/doc/developer/modules.rst @@ -58,7 +58,7 @@ Basic boilerplate: #include "libfrr.h" #include "event.h" - static int module_late_init(struct thread_master *master) + static int module_late_init(struct event_master *master) { /* Do initialization stuff here */ return 0; diff --git a/doc/developer/process-architecture.rst b/doc/developer/process-architecture.rst index 181baecea..d2bf141a3 100644 --- a/doc/developer/process-architecture.rst +++ b/doc/developer/process-architecture.rst @@ -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 thread_master``, hereafter referred to as a +structure is ``struct event_master``, 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 thread_master *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref); + event_add_read(struct event_master *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref); The ``struct event`` is then created and added to the appropriate internal datastructure within the ``threadmaster``. Note that the ``READ`` and diff --git a/eigrpd/eigrp_main.c b/eigrpd/eigrp_main.c index 5cd1353a9..3b94e5da2 100644 --- a/eigrpd/eigrp_main.c +++ b/eigrpd/eigrp_main.c @@ -76,7 +76,7 @@ struct zebra_privs_t eigrpd_privs = { struct option longopts[] = {{0}}; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; /* Forward declaration of daemon info structure. */ static struct frr_daemon_info eigrpd_di; diff --git a/eigrpd/eigrp_zebra.c b/eigrpd/eigrp_zebra.c index 0ae8c3b45..f5a71fd4f 100644 --- a/eigrpd/eigrp_zebra.c +++ b/eigrpd/eigrp_zebra.c @@ -49,7 +49,7 @@ static int eigrp_zebra_read_route(ZAPI_CALLBACK_ARGS); struct zclient *zclient = NULL; /* For registering threads. */ -extern struct thread_master *master; +extern struct event_master *master; struct in_addr router_id_zebra; /* Router-id update message from zebra. */ diff --git a/eigrpd/eigrpd.h b/eigrpd/eigrpd.h index 6e5d5d13d..32c7e44af 100644 --- a/eigrpd/eigrpd.h +++ b/eigrpd/eigrpd.h @@ -35,7 +35,7 @@ struct eigrp_master { struct list *eigrp; /* EIGRP thread master. */ - struct thread_master *master; + struct event_master *master; /* Zebra interface list. */ struct list *iflist; @@ -51,7 +51,7 @@ struct eigrp_master { /* Extern variables. */ extern struct zclient *zclient; -extern struct thread_master *master; +extern struct event_master *master; extern struct eigrp_master *eigrp_om; extern struct zebra_privs_t eigrpd_privs; diff --git a/isisd/isis_bfd.c b/isisd/isis_bfd.c index b973dd493..cdd84f24b 100644 --- a/isisd/isis_bfd.c +++ b/isisd/isis_bfd.c @@ -209,7 +209,7 @@ static int bfd_handle_circuit_add_addr(struct isis_circuit *circuit) return 0; } -void isis_bfd_init(struct thread_master *tm) +void isis_bfd_init(struct event_master *tm) { bfd_protocol_integration_init(zclient, tm); diff --git a/isisd/isis_bfd.h b/isisd/isis_bfd.h index 30248ccec..946b3c7b7 100644 --- a/isisd/isis_bfd.h +++ b/isisd/isis_bfd.h @@ -7,10 +7,10 @@ #define ISIS_BFD_H struct isis_circuit; -struct thread_master; +struct event_master; void isis_bfd_circuit_cmd(struct isis_circuit *circuit); -void isis_bfd_init(struct thread_master *tm); +void isis_bfd_init(struct event_master *tm); #endif diff --git a/isisd/isis_main.c b/isisd/isis_main.c index 04056636a..7b5d47235 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -77,7 +77,7 @@ static const struct option longopts[] = { {0}}; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; /* * Prototypes. diff --git a/isisd/isis_snmp.c b/isisd/isis_snmp.c index e0bcb180b..595bf4bdb 100644 --- a/isisd/isis_snmp.c +++ b/isisd/isis_snmp.c @@ -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 thread_master *tm) +static int isis_snmp_init(struct event_master *tm) { struct isis_func_to_prefix *h2f = isis_func_to_prefix_arr; struct variable *v; diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index c344f1634..2144b54a1 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -828,7 +828,7 @@ static zclient_handler *const isis_handlers[] = { [ZEBRA_CLIENT_CLOSE_NOTIFY] = isis_zebra_client_close_notify, }; -void isis_zebra_init(struct thread_master *master, int instance) +void isis_zebra_init(struct event_master *master, int instance) { /* Initialize asynchronous zclient. */ zclient = zclient_new(master, &zclient_options_default, isis_handlers, diff --git a/isisd/isis_zebra.h b/isisd/isis_zebra.h index f34088f98..ab2f7244a 100644 --- a/isisd/isis_zebra.h +++ b/isisd/isis_zebra.h @@ -20,7 +20,7 @@ struct label_chunk { }; #define CHUNK_SIZE 64 -void isis_zebra_init(struct thread_master *master, int instance); +void isis_zebra_init(struct event_master *master, int instance); void isis_zebra_stop(void); struct isis_route_info; diff --git a/isisd/isisd.c b/isisd/isisd.c index 14641f67c..267c31670 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -166,7 +166,7 @@ struct isis *isis_lookup_by_sysid(const uint8_t *sysid) return NULL; } -void isis_master_init(struct thread_master *master) +void isis_master_init(struct event_master *master) { memset(&isis_master, 0, sizeof(isis_master)); im = &isis_master; diff --git a/isisd/isisd.h b/isisd/isisd.h index b86759af9..d33c4108b 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -71,7 +71,7 @@ struct isis_master { /* ISIS instance. */ struct list *isis; /* ISIS thread master. */ - struct thread_master *master; + struct event_master *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 thread_master *master); +void isis_master_init(struct event_master *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 thread_master *master; +extern struct event_master *master; extern unsigned long debug_adj_pkt; extern unsigned long debug_snp_pkt; diff --git a/ldpd/ldp_snmp.c b/ldpd/ldp_snmp.c index 9a26a8d17..7ddd7bc88 100644 --- a/ldpd/ldp_snmp.c +++ b/ldpd/ldp_snmp.c @@ -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 thread_master *tm) +static int ldp_snmp_init(struct event_master *tm) { hook_register(agentx_enabled, ldp_snmp_agentx_enabled); @@ -1182,7 +1182,7 @@ static int ldp_snmp_init(struct thread_master *tm) return 0; } -static int ldp_snmp_register_mib(struct thread_master *tm) +static int ldp_snmp_register_mib(struct event_master *tm) { static int registered = 0; diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c index 6f0f990e4..1773d9c11 100644 --- a/ldpd/ldp_zebra.c +++ b/ldpd/ldp_zebra.c @@ -690,8 +690,7 @@ static zclient_handler *const ldp_handlers[] = { [ZEBRA_OPAQUE_MESSAGE] = ldp_zebra_opaque_msg_handler, }; -void -ldp_zebra_init(struct thread_master *master) +void ldp_zebra_init(struct event_master *master) { if_zapi_callbacks(ldp_ifp_create, ldp_ifp_up, ldp_ifp_down, ldp_ifp_destroy); diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c index c87bf1ea1..30c0472d9 100644 --- a/ldpd/ldpd.c +++ b/ldpd/ldpd.c @@ -77,7 +77,7 @@ static pid_t lde_pid; static struct frr_daemon_info ldpd_di; -DEFINE_HOOK(ldp_register_mib, (struct thread_master * tm), (tm)); +DEFINE_HOOK(ldp_register_mib, (struct event_master * 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 thread_master *master; +struct event_master *master; /* ldpd privileges */ static zebra_capabilities_t _caps_p [] = diff --git a/ldpd/ldpd.h b/ldpd/ldpd.h index 4f20989c0..3d0615cc0 100644 --- a/ldpd/ldpd.h +++ b/ldpd/ldpd.h @@ -883,11 +883,11 @@ const char *pw_type_name(uint16_t); const char *pw_error_code(uint8_t); /* quagga */ -extern struct thread_master *master; +extern struct event_master *master; extern char ctl_sock_path[MAXPATHLEN]; /* ldp_zebra.c */ -void ldp_zebra_init(struct thread_master *); +void ldp_zebra_init(struct event_master *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 thread_master * tm), (tm)); +DECLARE_HOOK(ldp_register_mib, (struct event_master * tm), (tm)); extern void ldp_agentx_enabled(void); diff --git a/lib/agentx.c b/lib/agentx.c index 7f66f9f9c..e20303813 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -27,7 +27,7 @@ DEFINE_HOOK(agentx_enabled, (), ()); static bool agentx_enabled = false; -static struct thread_master *agentx_tm; +static struct event_master *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 thread_master *tm) +void smux_init(struct event_master *tm) { agentx_tm = tm; @@ -111,7 +111,7 @@ struct bfd_sessions_global { struct bfd_source_list source_list; /** Pointer to FRR's event manager. */ - struct thread_master *tm; + struct event_master *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 thread_master *tm) +void bfd_protocol_integration_init(struct zclient *zc, struct event_master *tm) { /* Initialize data structure. */ TAILQ_INIT(&bsglobal.bsplist); @@ -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 thread_master` pointer to use as "thread" to execute + * - Copy the `struct event_master` 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,8 +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 thread_master *tm); +void bfd_protocol_integration_init(struct zclient *zc, struct event_master *tm); /** * BFD session registration arguments. diff --git a/lib/event.c b/lib/event.c index f5f9c9540..97bc11509 100644 --- a/lib/event.c +++ b/lib/event.c @@ -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 thread_master *master, struct event *thread); +static void thread_free(struct event_master *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_thread_history tmp; void *args[3] = {&tmp, vty, &filter}; - struct thread_master *m; + struct event_master *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 thread_master *m; + struct event_master *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 thread_master *m) +static void show_thread_poll_helper(struct vty *vty, struct event_master *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 thread_master *m; + struct event_master *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 thread_master *m) +static void show_thread_timers_helper(struct vty *vty, struct event_master *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 thread_master *m; + struct event_master *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 thread_master *thread_master_create(const char *name) +struct event_master *thread_master_create(const char *name) { - struct thread_master *rv; + struct event_master *rv; struct rlimit limit; pthread_once(&init_once, &initializer); - rv = XCALLOC(MTYPE_EVENT_MASTER, sizeof(struct thread_master)); + rv = XCALLOC(MTYPE_EVENT_MASTER, sizeof(struct event_master)); /* Initialize master mutex */ pthread_mutex_init(&rv->mtx, NULL); @@ -623,7 +623,7 @@ struct thread_master *thread_master_create(const char *name) return rv; } -void thread_master_set_name(struct thread_master *master, const char *name) +void thread_master_set_name(struct event_master *master, const char *name) { frr_with_mutex (&master->mtx) { XFREE(MTYPE_EVENT_MASTER, master->name); @@ -634,7 +634,7 @@ void thread_master_set_name(struct thread_master *master, const char *name) #define EVENT_UNUSED_DEPTH 10 /* Move thread to unuse list. */ -static void thread_add_unuse(struct thread_master *m, struct event *thread) +static void thread_add_unuse(struct event_master *m, struct event *thread) { pthread_mutex_t mtxc = thread->mtx; @@ -656,8 +656,8 @@ static void thread_add_unuse(struct thread_master *m, struct event *thread) } /* Free all unused thread. */ -static void thread_list_free(struct thread_master *m, - struct thread_list_head *list) +static void thread_list_free(struct event_master *m, + struct thread_list_head *list) { struct event *t; @@ -665,7 +665,7 @@ static void thread_list_free(struct thread_master *m, thread_free(m, t); } -static void thread_array_free(struct thread_master *m, +static void thread_array_free(struct event_master *m, struct event **thread_array) { struct event *t; @@ -689,7 +689,7 @@ static void thread_array_free(struct thread_master *m, * If we are shutting down, Free up unused threads * So we can see if we forget to shut anything off */ -void thread_master_free_unused(struct thread_master *m) +void thread_master_free_unused(struct event_master *m) { frr_with_mutex (&m->mtx) { struct event *t; @@ -699,7 +699,7 @@ void thread_master_free_unused(struct thread_master *m) } /* Stop thread scheduler. */ -void thread_master_free(struct thread_master *m) +void thread_master_free(struct event_master *m) { struct event *t; @@ -791,7 +791,7 @@ char *event_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer) } /* Get new thread. */ -static struct event *thread_get(struct thread_master *m, uint8_t type, +static struct event *thread_get(struct event_master *m, uint8_t type, void (*func)(struct event *), void *arg, const struct xref_threadsched *xref) { @@ -838,7 +838,7 @@ static struct event *thread_get(struct thread_master *m, uint8_t type, return thread; } -static void thread_free(struct thread_master *master, struct event *thread) +static void thread_free(struct event_master *master, struct event *thread) { /* Update statistics. */ assert(master->alloc > 0); @@ -849,7 +849,7 @@ static void thread_free(struct thread_master *master, struct event *thread) XFREE(MTYPE_THREAD, thread); } -static int fd_poll(struct thread_master *m, const struct timeval *timer_wait, +static int fd_poll(struct event_master *m, const struct timeval *timer_wait, bool *eintr_p) { sigset_t origsigs; @@ -948,9 +948,8 @@ done: /* Add new read thread. */ void _event_add_read_write(const struct xref_threadsched *xref, - struct thread_master *m, - void (*func)(struct event *), void *arg, int fd, - struct event **t_ptr) + struct event_master *m, void (*func)(struct event *), + void *arg, int fd, struct event **t_ptr) { int dir = xref->event_type; struct event *thread = NULL; @@ -1028,7 +1027,7 @@ void _event_add_read_write(const struct xref_threadsched *xref, } static void _event_add_timer_timeval(const struct xref_threadsched *xref, - struct thread_master *m, + struct event_master *m, void (*func)(struct event *), void *arg, struct timeval *time_relative, struct event **t_ptr) @@ -1082,7 +1081,7 @@ static void _event_add_timer_timeval(const struct xref_threadsched *xref, /* Add timer event thread. */ void _event_add_timer(const struct xref_threadsched *xref, - struct thread_master *m, void (*func)(struct event *), + struct event_master *m, void (*func)(struct event *), void *arg, long timer, struct event **t_ptr) { struct timeval trel; @@ -1097,9 +1096,8 @@ void _event_add_timer(const struct xref_threadsched *xref, /* Add timer event thread with "millisecond" resolution */ void _event_add_timer_msec(const struct xref_threadsched *xref, - struct thread_master *m, - void (*func)(struct event *), void *arg, long timer, - struct event **t_ptr) + struct event_master *m, void (*func)(struct event *), + void *arg, long timer, struct event **t_ptr) { struct timeval trel; @@ -1113,7 +1111,7 @@ void _event_add_timer_msec(const struct xref_threadsched *xref, /* Add timer event thread with "timeval" resolution */ void _event_add_timer_tv(const struct xref_threadsched *xref, - struct thread_master *m, void (*func)(struct event *), + struct event_master *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); @@ -1121,7 +1119,7 @@ void _event_add_timer_tv(const struct xref_threadsched *xref, /* Add simple event thread. */ void _event_add_event(const struct xref_threadsched *xref, - struct thread_master *m, void (*func)(struct event *), + struct event_master *m, void (*func)(struct event *), void *arg, int val, struct event **t_ptr) { struct event *thread = NULL; @@ -1168,7 +1166,7 @@ void _event_add_event(const struct xref_threadsched *xref, * - POLLIN * - POLLOUT */ -static void event_cancel_rw(struct thread_master *master, int fd, short state, +static void event_cancel_rw(struct event_master *master, int fd, short state, int idx_hint) { bool found = false; @@ -1234,7 +1232,7 @@ static void event_cancel_rw(struct thread_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 thread_master *master, +static void cancel_arg_helper(struct event_master *master, const struct cancel_req *cr) { struct event *t; @@ -1327,7 +1325,7 @@ static void cancel_arg_helper(struct thread_master *master, * @param master the thread master to process * @REQUIRE master->mtx */ -static void do_event_cancel(struct thread_master *master) +static void do_event_cancel(struct event_master *master) { struct thread_list_head *list = NULL; struct event **thread_array = NULL; @@ -1409,7 +1407,7 @@ static void do_event_cancel(struct thread_master *master) /* * Helper function used for multiple flavors of arg-based cancellation. */ -static void cancel_event_helper(struct thread_master *m, void *arg, int flags) +static void cancel_event_helper(struct event_master *m, void *arg, int flags) { struct cancel_req *cr; @@ -1438,7 +1436,7 @@ static void cancel_event_helper(struct thread_master *m, void *arg, int flags) * @param m the thread_master to cancel from * @param arg the argument passed when creating the event */ -void event_cancel_event(struct thread_master *master, void *arg) +void event_cancel_event(struct event_master *master, void *arg) { cancel_event_helper(master, arg, 0); } @@ -1451,7 +1449,7 @@ void event_cancel_event(struct thread_master *master, void *arg) * @param m the thread_master to cancel from * @param arg the argument passed when creating the event */ -void event_cancel_event_ready(struct thread_master *m, void *arg) +void event_cancel_event_ready(struct event_master *m, void *arg) { /* Only cancel ready/event tasks */ @@ -1467,7 +1465,7 @@ void event_cancel_event_ready(struct thread_master *m, void *arg) */ void event_cancel(struct event **thread) { - struct thread_master *master; + struct event_master *master; if (thread == NULL || *thread == NULL) return; @@ -1516,7 +1514,7 @@ void event_cancel(struct event **thread) * @param thread pointer to thread to cancel * @param eventobj the event */ -void event_cancel_async(struct thread_master *master, struct event **thread, +void event_cancel_async(struct event_master *master, struct event **thread, void *eventobj) { assert(!(thread && eventobj) && (thread || eventobj)); @@ -1569,7 +1567,7 @@ static struct timeval *thread_timer_wait(struct thread_timer_list_head *timers, return timer_val; } -static struct event *thread_run(struct thread_master *m, struct event *thread, +static struct event *thread_run(struct event_master *m, struct event *thread, struct event *fetch) { *fetch = *thread; @@ -1577,7 +1575,7 @@ static struct event *thread_run(struct thread_master *m, struct event *thread, return fetch; } -static int thread_process_io_helper(struct thread_master *m, +static int thread_process_io_helper(struct event_master *m, struct event *thread, short state, short actual_state, int pos) { @@ -1625,7 +1623,7 @@ static int thread_process_io_helper(struct thread_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 thread_master *m, unsigned int num) +static void thread_process_io(struct event_master *m, unsigned int num) { unsigned int ready = 0; struct pollfd *pfds = m->handler.copy; @@ -1683,7 +1681,7 @@ static void thread_process_io(struct thread_master *m, unsigned int num) } /* Add all timers that have popped to the ready list. */ -static unsigned int thread_process_timers(struct thread_master *m, +static unsigned int thread_process_timers(struct event_master *m, struct timeval *timenow) { struct timeval prev = *timenow; @@ -1740,7 +1738,7 @@ static unsigned int thread_process(struct thread_list_head *list) /* Fetch next ready thread. */ -struct event *event_fetch(struct thread_master *m, struct event *fetch) +struct event *event_fetch(struct event_master *m, struct event *fetch) { struct event *thread = NULL; struct timeval now; @@ -2057,9 +2055,8 @@ void event_call(struct event *thread) } /* Execute thread */ -void _event_execute(const struct xref_threadsched *xref, - struct thread_master *m, void (*func)(struct event *), - void *arg, int val) +void _event_execute(const struct xref_threadsched *xref, struct event_master *m, + void (*func)(struct event *), void *arg, int val) { struct event *thread; diff --git a/lib/event.h b/lib/event.h index dcc7cee5e..50498c87f 100644 --- a/lib/event.h +++ b/lib/event.h @@ -66,7 +66,7 @@ struct xref_threadsched { }; /* Master of the theads. */ -struct thread_master { +struct event_master { char *name; struct event **read; @@ -109,7 +109,7 @@ struct event { struct thread_list_item threaditem; struct thread_timer_list_item timeritem; struct event **ref; /* external reference (if given) */ - struct thread_master *master; /* pointer to the struct thread_master */ + struct event_master *master; /* pointer to the struct event_master */ void (*func)(struct event *); /* event function */ void *arg; /* event argument */ union { @@ -209,57 +209,58 @@ struct cpu_thread_history { }) /* end */ /* Prototypes. */ -extern struct thread_master *thread_master_create(const char *); -void thread_master_set_name(struct thread_master *master, const char *name); -extern void thread_master_free(struct thread_master *); -extern void thread_master_free_unused(struct thread_master *); +extern struct event_master *thread_master_create(const char *name); +void thread_master_set_name(struct event_master *master, const char *name); +extern void thread_master_free(struct event_master *m); +extern void thread_master_free_unused(struct event_master *m); extern void _event_add_read_write(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *master, void (*fn)(struct event *), void *arg, int fd, struct event **tref); extern void _event_add_timer(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *master, void (*fn)(struct event *), void *arg, long t, struct event **tref); extern void _event_add_timer_msec(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *master, void (*fn)(struct event *), void *arg, long t, struct event **tref); extern void _event_add_timer_tv(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *master, void (*fn)(struct event *), void *arg, struct timeval *tv, struct event **tref); extern void _event_add_event(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *master, void (*fn)(struct event *), void *arg, int val, struct event **tref); extern void _event_execute(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *master, void (*fn)(struct event *), void *arg, int val); extern void event_cancel(struct event **event); -extern void event_cancel_async(struct thread_master *, struct event **, void *); +extern void event_cancel_async(struct event_master *m, struct event **eptr, + void *data); /* Cancel ready tasks with an arg matching 'arg' */ -extern void event_cancel_event_ready(struct thread_master *m, void *arg); +extern void event_cancel_event_ready(struct event_master *m, void *arg); /* Cancel all tasks with an arg matching 'arg', including timers and io */ -extern void event_cancel_event(struct thread_master *m, void *arg); -extern struct event *event_fetch(struct thread_master *, struct event *event); +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_call(struct event *event); extern unsigned long event_timer_remain_second(struct event *event); extern struct timeval event_timer_remain(struct event *event); extern unsigned long event_timer_remain_msec(struct event *event); extern int event_should_yield(struct event *event); /* set yield time for thread */ -extern void event_set_yield_time(struct event *event, unsigned long); +extern void event_set_yield_time(struct event *event, unsigned long ytime); /* Internal libfrr exports */ -extern void event_getrusage(RUSAGE_T *); +extern void event_getrusage(RUSAGE_T *r); extern void event_cmd_init(void); /* Returns elapsed real (wall clock) time. */ diff --git a/lib/frr_pthread.h b/lib/frr_pthread.h index c14ba7792..821e0f1b4 100644 --- a/lib/frr_pthread.h +++ b/lib/frr_pthread.h @@ -41,7 +41,7 @@ struct frr_pthread { struct rcu_thread *rcu_thread; /* thread master for this pthread's thread.c event loop */ - struct thread_master *master; + struct event_master *master; /* caller-specified data; start & stop funcs, name, id */ struct frr_pthread_attr attr; diff --git a/lib/frr_zmq.c b/lib/frr_zmq.c index 4a860fe25..1a5b35d1e 100644 --- a/lib/frr_zmq.c +++ b/lib/frr_zmq.c @@ -150,7 +150,7 @@ out_err: } int _frrzmq_event_add_read(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *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_threadsched *xref, - struct thread_master *master, + struct event_master *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 thread_master *tm = core->thread->master; + struct event_master *tm = core->thread->master; event_cancel(&core->thread); diff --git a/lib/frr_zmq.h b/lib/frr_zmq.h index a779cbd30..59ee3b402 100644 --- a/lib/frr_zmq.h +++ b/lib/frr_zmq.h @@ -109,14 +109,14 @@ struct frrzmq_cb; */ extern int _frrzmq_event_add_read(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *master, void (*msgfunc)(void *arg, void *zmqsock), void (*partfunc)(void *arg, void *zmqsock, zmq_msg_t *msg, unsigned partnum), void (*errfunc)(void *arg, void *zmqsock), void *arg, void *zmqsock, struct frrzmq_cb **cb); extern int _frrzmq_event_add_write(const struct xref_threadsched *xref, - struct thread_master *master, + struct event_master *master, void (*msgfunc)(void *arg, void *zmqsock), void (*errfunc)(void *arg, void *zmqsock), void *arg, void *zmqsock, diff --git a/lib/grammar_sandbox_main.c b/lib/grammar_sandbox_main.c index 8b9a46030..1e0f67a11 100644 --- a/lib/grammar_sandbox_main.c +++ b/lib/grammar_sandbox_main.c @@ -23,7 +23,7 @@ static void vty_do_exit(int isexit) exit(0); } -struct thread_master *master; +struct event_master *master; int main(int argc, char **argv) { diff --git a/lib/libfrr.c b/lib/libfrr.c index 17f2bb1bd..d7e87adc4 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -33,10 +33,10 @@ #include "frrscript.h" #include "systemd.h" -DEFINE_HOOK(frr_early_init, (struct thread_master * tm), (tm)); -DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm)); -DEFINE_HOOK(frr_config_pre, (struct thread_master * tm), (tm)); -DEFINE_HOOK(frr_config_post, (struct thread_master * tm), (tm)); +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_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 thread_master *master; -struct thread_master *frr_init(void) +static struct event_master *master; +struct event_master *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 thread_master *master) +void frr_run(struct event_master *master) { char instanceinfo[64] = ""; diff --git a/lib/libfrr.h b/lib/libfrr.h index 5463222d7..3043d6b3f 100644 --- a/lib/libfrr.h +++ b/lib/libfrr.h @@ -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 thread_master *frr_init(void); +extern struct event_master *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 thread_master * tm), (tm)); -DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm)); +DECLARE_HOOK(frr_early_init, (struct event_master * tm), (tm)); +DECLARE_HOOK(frr_late_init, (struct event_master * tm), (tm)); /* fork() happens between late_init and config_pre */ -DECLARE_HOOK(frr_config_pre, (struct thread_master * tm), (tm)); -DECLARE_HOOK(frr_config_post, (struct thread_master * tm), (tm)); +DECLARE_HOOK(frr_config_pre, (struct event_master * tm), (tm)); +DECLARE_HOOK(frr_config_post, (struct event_master * tm), (tm)); extern void frr_config_fork(void); -extern void frr_run(struct thread_master *master); +extern void frr_run(struct event_master *master); extern void frr_detach(void); extern bool frr_zclient_addr(struct sockaddr_storage *sa, socklen_t *sa_len, diff --git a/lib/libfrr_trace.h b/lib/libfrr_trace.h index c4f5fa80d..5a957d4c4 100644 --- a/lib/libfrr_trace.h +++ b/lib/libfrr_trace.h @@ -73,7 +73,7 @@ TRACEPOINT_EVENT( TRACEPOINT_LOGLEVEL(frr_libfrr, hash_release, TRACE_INFO) #define THREAD_SCHEDULE_ARGS \ - TP_ARGS(struct thread_master *, master, const char *, funcname, \ + TP_ARGS(struct event_master *, master, const char *, funcname, \ const char *, schedfrom, int, fromln, struct event **, \ thread_ptr, int, fd, int, val, void *, arg, long, time) diff --git a/lib/mgmt_be_client.c b/lib/mgmt_be_client.c index ca4e21948..f710e062c 100644 --- a/lib/mgmt_be_client.c +++ b/lib/mgmt_be_client.c @@ -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 thread_master *tm; + struct event_master *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 thread_master *master_thread) + struct event_master *master_thread) { assert(master_thread && params && strlen(params->name) && !mgmt_be_client_ctx.tm); diff --git a/lib/mgmt_be_client.h b/lib/mgmt_be_client.h index 66bc62fb0..2cb90478d 100644 --- a/lib/mgmt_be_client.h +++ b/lib/mgmt_be_client.h @@ -188,9 +188,8 @@ mgmt_be_client_name2id(const char *name) * Returns: * 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 thread_master *master_thread); +extern uintptr_t mgmt_be_client_lib_init(struct mgmt_be_client_params *params, + struct event_master *master_thread); /* * Subscribe with MGMTD for one or more YANG subtree(s). diff --git a/lib/mgmt_fe_client.c b/lib/mgmt_fe_client.c index f41217ce3..58ee93ac1 100644 --- a/lib/mgmt_fe_client.c +++ b/lib/mgmt_fe_client.c @@ -49,7 +49,7 @@ DEFINE_MTYPE_STATIC(LIB, MGMTD_FE_SESSION, "MGMTD Frontend session"); struct mgmt_fe_client_ctx { int conn_fd; - struct thread_master *tm; + struct event_master *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 thread_master *master_thread) + struct event_master *master_thread) { assert(master_thread && params && strlen(params->name) && !mgmt_fe_client_ctx.tm); diff --git a/lib/mgmt_fe_client.h b/lib/mgmt_fe_client.h index 10712964b..2761b4fda 100644 --- a/lib/mgmt_fe_client.h +++ b/lib/mgmt_fe_client.h @@ -130,9 +130,8 @@ struct mgmt_fe_client_params { * Returns: * 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 thread_master *master_thread); +extern uintptr_t mgmt_fe_client_lib_init(struct mgmt_fe_client_params *params, + struct event_master *master_thread); /* * Create a new Session for a Frontend Client connection. diff --git a/lib/northbound.c b/lib/northbound.c index 1259294a2..28952bb26 100644 --- a/lib/northbound.c +++ b/lib/northbound.c @@ -2685,7 +2685,7 @@ void nb_validate_callbacks(void) } -void nb_init(struct thread_master *tm, +void nb_init(struct event_master *tm, const struct frr_yang_module_info *const modules[], size_t nmodules, bool db_enabled) { diff --git a/lib/northbound.h b/lib/northbound.h index 6820a59cc..c29102257 100644 --- a/lib/northbound.h +++ b/lib/northbound.h @@ -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 thread_master *tm, +extern void nb_init(struct event_master *tm, const struct frr_yang_module_info *const modules[], size_t nmodules, bool db_enabled); diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c index edfca75cd..87ce347b6 100644 --- a/lib/northbound_cli.c +++ b/lib/northbound_cli.c @@ -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 thread_master *master; +static struct event_master *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 thread_master *tm) +void nb_cli_init(struct event_master *tm) { master = tm; diff --git a/lib/northbound_cli.h b/lib/northbound_cli.h index ef2ef44eb..630fbe12f 100644 --- a/lib/northbound_cli.h +++ b/lib/northbound_cli.h @@ -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 thread_master *tm); +extern void nb_cli_init(struct event_master *tm); extern void nb_cli_terminate(void); #ifdef __cplusplus diff --git a/lib/northbound_confd.c b/lib/northbound_confd.c index b67491235..6be2ed00b 100644 --- a/lib/northbound_confd.c +++ b/lib/northbound_confd.c @@ -23,7 +23,7 @@ DEFINE_MTYPE_STATIC(LIB, CONFD, "ConfD module"); static struct debug nb_dbg_client_confd = {0, "Northbound client: ConfD"}; -static struct thread_master *master; +static struct event_master *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 thread_master *tm) +static int frr_confd_module_late_init(struct event_master *tm) { master = tm; diff --git a/lib/northbound_grpc.cpp b/lib/northbound_grpc.cpp index a06daa867..66edead5d 100644 --- a/lib/northbound_grpc.cpp +++ b/lib/northbound_grpc.cpp @@ -38,7 +38,7 @@ */ static bool nb_dbg_client_grpc = 0; -static struct thread_master *main_master; +static struct event_master *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 thread_master *tm) +static int frr_grpc_module_late_init(struct event_master *tm) { main_master = tm; hook_register(frr_fini, frr_grpc_finish); diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c index 145e43ddb..8a775b8ba 100644 --- a/lib/northbound_sysrepo.c +++ b/lib/northbound_sysrepo.c @@ -23,7 +23,7 @@ DEFINE_MTYPE_STATIC(LIB, SYSREPO, "Sysrepo module"); static struct debug nb_dbg_client_sysrepo = {0, "Northbound client: Sysrepo"}; -static struct thread_master *master; +static struct event_master *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 thread_master *tm) +static int frr_sr_module_config_loaded(struct event_master *tm) { master = tm; @@ -736,7 +736,7 @@ static int frr_sr_module_config_loaded(struct thread_master *tm) return 0; } -static int frr_sr_module_late_init(struct thread_master *tm) +static int frr_sr_module_late_init(struct event_master *tm) { frr_sr_cli_init(); diff --git a/lib/pullwr.c b/lib/pullwr.c index 55ff4df01..3dccecdfb 100644 --- a/lib/pullwr.c +++ b/lib/pullwr.c @@ -16,7 +16,7 @@ struct pullwr { int fd; - struct thread_master *tm; + struct event_master *tm; /* writer == NULL <=> we're idle */ struct event *writer; @@ -40,10 +40,9 @@ DEFINE_MTYPE_STATIC(LIB, PULLWR_BUF, "pull-driven write buffer"); static void pullwr_run(struct event *t); -struct pullwr *_pullwr_new(struct thread_master *tm, int fd, - void *arg, - void (*fill)(void *, struct pullwr *), - void (*err)(void *, struct pullwr *, bool)) +struct pullwr *_pullwr_new(struct event_master *tm, int fd, void *arg, + void (*fill)(void *, struct pullwr *), + void (*err)(void *, struct pullwr *, bool)) { struct pullwr *pullwr; diff --git a/lib/pullwr.h b/lib/pullwr.h index 8a028b909..fee4c9cd6 100644 --- a/lib/pullwr.h +++ b/lib/pullwr.h @@ -45,10 +45,10 @@ 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 thread_master *tm, int fd, - void *arg, - void (*fill)(void *, struct pullwr *), - void (*err)(void *, struct pullwr *, bool eof)); +extern struct pullwr *_pullwr_new(struct event_master *tm, int fd, void *arg, + void (*fill)(void *, struct pullwr *), + void (*err)(void *, struct pullwr *, + bool eof)); extern void pullwr_del(struct pullwr *pullwr); /* type-checking wrapper. makes sure fill() and err() take a first argument diff --git a/lib/resolver.c b/lib/resolver.c index 36bad20f3..9b1802dc8 100644 --- a/lib/resolver.c +++ b/lib/resolver.c @@ -23,7 +23,7 @@ XREF_SETUP(); struct resolver_state { ares_channel channel; - struct thread_master *master; + struct event_master *master; struct event *timeout; }; @@ -314,7 +314,7 @@ static int resolver_config_write_debug(struct vty *vty) } -void resolver_init(struct thread_master *tm) +void resolver_init(struct event_master *tm) { struct ares_options ares_opts; diff --git a/lib/resolver.h b/lib/resolver.h index 6e69fa263..98da02c22 100644 --- a/lib/resolver.h +++ b/lib/resolver.h @@ -22,7 +22,7 @@ struct resolver_query { struct event *literal_cb; }; -void resolver_init(struct thread_master *tm); +void resolver_init(struct event_master *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, diff --git a/lib/sigevent.c b/lib/sigevent.c index a7900466b..2ab56a279 100644 --- a/lib/sigevent.c +++ b/lib/sigevent.c @@ -331,7 +331,7 @@ static void trap_default_signals(void) } } -void signal_init(struct thread_master *m, int sigc, +void signal_init(struct event_master *m, int sigc, struct frr_signal_t signals[]) { diff --git a/lib/sigevent.h b/lib/sigevent.h index 69b3f54aa..8eef32853 100644 --- a/lib/sigevent.h +++ b/lib/sigevent.h @@ -25,12 +25,12 @@ struct frr_signal_t { /* initialise sigevent system * takes: - * - pointer to valid struct thread_master + * - pointer to valid struct event_master * - 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 thread_master *m, int sigc, +extern void signal_init(struct event_master *m, int sigc, struct frr_signal_t *signals); diff --git a/lib/smux.h b/lib/smux.h index dd1689f73..d83a34b30 100644 --- a/lib/smux.h +++ b/lib/smux.h @@ -99,7 +99,7 @@ struct index_oid { */ extern bool smux_enabled(void); -extern void smux_init(struct thread_master *tm); +extern void smux_init(struct event_master *tm); extern void smux_agentx_enable(void); extern void smux_register_mib(const char *, struct variable *, size_t, int, oid[], size_t); diff --git a/lib/spf_backoff.c b/lib/spf_backoff.c index 7ea33c3ab..b95fd6085 100644 --- a/lib/spf_backoff.c +++ b/lib/spf_backoff.c @@ -37,7 +37,7 @@ enum spf_backoff_state { }; struct spf_backoff { - struct thread_master *m; + struct event_master *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 thread_master *m, const char *name, +struct spf_backoff *spf_backoff_new(struct event_master *m, const char *name, long init_delay, long short_delay, long long_delay, long holddown, long timetolearn) diff --git a/lib/spf_backoff.h b/lib/spf_backoff.h index 87aa4a082..c550c66c8 100644 --- a/lib/spf_backoff.h +++ b/lib/spf_backoff.h @@ -18,10 +18,10 @@ extern "C" { #endif struct spf_backoff; -struct thread_master; +struct event_master; struct vty; -struct spf_backoff *spf_backoff_new(struct thread_master *m, const char *name, +struct spf_backoff *spf_backoff_new(struct event_master *m, const char *name, long init_delay, long short_delay, long long_delay, long holddown, long timetolearn); diff --git a/lib/systemd.c b/lib/systemd.c index 5a0668f74..7d8421f33 100644 --- a/lib/systemd.c +++ b/lib/systemd.c @@ -63,7 +63,7 @@ void systemd_send_stopping(void) systemd_send_information("STOPPING=1"); } -static struct thread_master *systemd_master = NULL; +static struct event_master *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 thread_master *m) +void systemd_send_started(struct event_master *m) { assert(m != NULL); diff --git a/lib/systemd.h b/lib/systemd.h index 09f27a70b..c8fb328ad 100644 --- a/lib/systemd.h +++ b/lib/systemd.h @@ -21,11 +21,11 @@ extern bool sd_stderr_is_journal; void systemd_send_stopping(void); /* - * master - The struct thread_master * to use to schedule ourself + * master - The struct event_master * to use to schedule ourself * the_process - Should we send watchdog if we are not the requested * process? */ -void systemd_send_started(struct thread_master *master); +void systemd_send_started(struct event_master *master); /* * status - A status string to send to systemd @@ -2801,7 +2801,7 @@ int vty_config_node_exit(struct vty *vty) } /* Master of the threads. */ -static struct thread_master *vty_master; +static struct event_master *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 thread_master *master_thread, bool do_command_logging) +void vty_init(struct event_master *master_thread, bool do_command_logging) { /* For further configuration read, preserve current directory. */ vty_save_cwd(); @@ -337,7 +337,7 @@ struct vty_arg { extern struct nb_config *vty_mgmt_candidate_config; /* Prototypes. */ -extern void vty_init(struct thread_master *, bool do_command_logging); +extern void vty_init(struct event_master *m, bool do_command_logging); extern void vty_init_vtysh(void); extern void vty_terminate(void); extern void vty_reset(void); diff --git a/lib/wheel.c b/lib/wheel.c index 9ba122e82..88719d2ee 100644 --- a/lib/wheel.c +++ b/lib/wheel.c @@ -60,10 +60,10 @@ static void wheel_timer_thread(struct event *t) event_execute(wheel->master, wheel_timer_thread_helper, wheel, 0); } -struct timer_wheel *wheel_init(struct thread_master *master, int period, - size_t slots, unsigned int (*slot_key)(const void *), - void (*slot_run)(void *), - const char *run_name) +struct timer_wheel *wheel_init(struct event_master *master, int period, + size_t slots, + unsigned int (*slot_key)(const void *), + void (*slot_run)(void *), const char *run_name) { struct timer_wheel *wheel; size_t i; diff --git a/lib/wheel.h b/lib/wheel.h index f4e72af9d..8b4a83115 100644 --- a/lib/wheel.h +++ b/lib/wheel.h @@ -13,7 +13,7 @@ extern "C" { struct timer_wheel { char *name; - struct thread_master *master; + struct event_master *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 thread_master *master, int period, +struct timer_wheel *wheel_init(struct event_master *master, int period, size_t slots, unsigned int (*slot_key)(const void *), void (*slot_run)(void *), const char *run_name); diff --git a/lib/workqueue.c b/lib/workqueue.c index cba611cd1..a8f48f946 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -59,7 +59,7 @@ static void work_queue_item_remove(struct work_queue *wq, } /* create new work queue */ -struct work_queue *work_queue_new(struct thread_master *m, +struct work_queue *work_queue_new(struct event_master *m, const char *queue_name) { struct work_queue *new; diff --git a/lib/workqueue.h b/lib/workqueue.h index f3c8fc813..ca29ae3d1 100644 --- a/lib/workqueue.h +++ b/lib/workqueue.h @@ -47,7 +47,7 @@ struct work_queue { /* Everything but the specification struct is private * the following may be read */ - struct thread_master *master; /* thread master */ + struct event_master *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 thread_master *m, +extern struct work_queue *work_queue_new(struct event_master *m, const char *queue_name); /* destroy work queue */ diff --git a/lib/zclient.c b/lib/zclient.c index bd8a53d33..c6a261207 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -51,7 +51,7 @@ socklen_t zclient_addr_len; static int zclient_debug; /* Allocate zclient structure. */ -struct zclient *zclient_new(struct thread_master *master, +struct zclient *zclient_new(struct event_master *master, struct zclient_options *opt, zclient_handler *const *handlers, size_t n_handlers) { diff --git a/lib/zclient.h b/lib/zclient.h index 5daae3f5b..0a20af8c3 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -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 thread_master *master; + struct event_master *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 thread_master *m, +extern struct zclient *zclient_new(struct event_master *m, struct zclient_options *opt, zclient_handler *const *handlers, size_t n_handlers); diff --git a/lib/zlog_5424.h b/lib/zlog_5424.h index e8a15bd49..52b5f6821 100644 --- a/lib/zlog_5424.h +++ b/lib/zlog_5424.h @@ -14,7 +14,7 @@ #include "qobj.h" struct event; -struct thread_master; +struct event_master; 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 thread_master *master; + struct event_master *master; struct event *t_reconnect; unsigned int reconn_backoff, reconn_backoff_cur, reconn_backoff_max; int sock_type; diff --git a/lib/zlog_5424_cli.c b/lib/zlog_5424_cli.c index 7f070afbc..31b3390eb 100644 --- a/lib/zlog_5424_cli.c +++ b/lib/zlog_5424_cli.c @@ -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 thread_master *log_5424_master; +static struct event_master *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 thread_master *master); +static int log_5424_early_init(struct event_master *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 thread_master *master) +static int log_5424_early_init(struct event_master *master) { log_5424_master = master; diff --git a/mgmtd/mgmt.c b/mgmtd/mgmt.c index e1acfde39..f810a865a 100644 --- a/mgmtd/mgmt.c +++ b/mgmtd/mgmt.c @@ -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 thread_master *master, const int buffer_size) +void mgmt_master_init(struct event_master *master, const int buffer_size) { memset(&mgmt_master, 0, sizeof(struct mgmt_master)); diff --git a/mgmtd/mgmt.h b/mgmtd/mgmt.h index 2a9d94751..e3111b437 100644 --- a/mgmtd/mgmt.h +++ b/mgmtd/mgmt.h @@ -34,7 +34,7 @@ struct mgmt_txn_ctx; * MGMTD master for system wide configurations and variables. */ struct mgmt_master { - struct thread_master *master; + struct event_master *master; /* How big should we set the socket buffer size */ uint32_t socket_buffer; @@ -95,7 +95,7 @@ extern time_t mgmt_clock(void); extern int mgmt_config_write(struct vty *vty); -extern void mgmt_master_init(struct thread_master *master, +extern void mgmt_master_init(struct event_master *master, const int buffer_size); extern void mgmt_init(void); diff --git a/mgmtd/mgmt_be_adapter.c b/mgmtd/mgmt_be_adapter.c index 66184ad2f..6ef8875c9 100644 --- a/mgmtd/mgmt_be_adapter.c +++ b/mgmtd/mgmt_be_adapter.c @@ -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 thread_master *mgmt_be_adapter_tm; +static struct event_master *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 thread_master *tm) +int mgmt_be_adapter_init(struct event_master *tm) { if (!mgmt_be_adapter_tm) { mgmt_be_adapter_tm = tm; diff --git a/mgmtd/mgmt_be_adapter.h b/mgmtd/mgmt_be_adapter.h index 6c34e5066..7cf7090e0 100644 --- a/mgmtd/mgmt_be_adapter.h +++ b/mgmtd/mgmt_be_adapter.h @@ -92,7 +92,7 @@ struct mgmt_be_client_subscr_info { }; /* Initialise backend adapter module. */ -extern int mgmt_be_adapter_init(struct thread_master *tm); +extern int mgmt_be_adapter_init(struct event_master *tm); /* Destroy the backend adapter module. */ extern void mgmt_be_adapter_destroy(void); diff --git a/mgmtd/mgmt_be_server.c b/mgmtd/mgmt_be_server.c index 083e8299f..31ac18501 100644 --- a/mgmtd/mgmt_be_server.c +++ b/mgmtd/mgmt_be_server.c @@ -29,7 +29,7 @@ #endif /* REDIRECT_DEBUG_TO_STDERR */ static int mgmt_be_listen_fd = -1; -static struct thread_master *mgmt_be_listen_tm; +static struct event_master *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 thread_master *master) +int mgmt_be_server_init(struct event_master *master) { if (mgmt_be_listen_tm) { MGMTD_BE_SRVR_DBG("MGMTD Backend Server already running!"); diff --git a/mgmtd/mgmt_be_server.h b/mgmtd/mgmt_be_server.h index 5ee57fdf1..3d0594d16 100644 --- a/mgmtd/mgmt_be_server.h +++ b/mgmtd/mgmt_be_server.h @@ -12,7 +12,7 @@ #define MGMTD_BE_MAX_CONN 32 /* Initialise backend server */ -extern int mgmt_be_server_init(struct thread_master *master); +extern int mgmt_be_server_init(struct event_master *master); /* Destroy backend server */ extern void mgmt_be_server_destroy(void); diff --git a/mgmtd/mgmt_fe_adapter.c b/mgmtd/mgmt_fe_adapter.c index 5c6258dc6..6552222ae 100644 --- a/mgmtd/mgmt_fe_adapter.c +++ b/mgmtd/mgmt_fe_adapter.c @@ -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 thread_master *mgmt_fe_adapter_tm; +static struct event_master *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 thread_master *tm, struct mgmt_master *mm) +int mgmt_fe_adapter_init(struct event_master *tm, struct mgmt_master *mm) { if (!mgmt_fe_adapter_tm) { mgmt_fe_adapter_tm = tm; diff --git a/mgmtd/mgmt_fe_adapter.h b/mgmtd/mgmt_fe_adapter.h index 342b766f2..e1af5d0f2 100644 --- a/mgmtd/mgmt_fe_adapter.h +++ b/mgmtd/mgmt_fe_adapter.h @@ -82,7 +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 thread_master *tm, +extern int mgmt_fe_adapter_init(struct event_master *tm, struct mgmt_master *cm); /* Destroy frontend adapter module */ diff --git a/mgmtd/mgmt_fe_server.c b/mgmtd/mgmt_fe_server.c index 2d576663d..07688c59b 100644 --- a/mgmtd/mgmt_fe_server.c +++ b/mgmtd/mgmt_fe_server.c @@ -29,7 +29,7 @@ #endif /* REDIRECT_DEBUG_TO_STDERR */ static int mgmt_fe_listen_fd = -1; -static struct thread_master *mgmt_fe_listen_tm; +static struct event_master *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 thread_master *master) +int mgmt_fe_server_init(struct event_master *master) { if (mgmt_fe_listen_tm) { MGMTD_FE_SRVR_DBG("MGMTD Frontend Server already running!"); diff --git a/mgmtd/mgmt_fe_server.h b/mgmtd/mgmt_fe_server.h index 672ab05c3..0b0171c38 100644 --- a/mgmtd/mgmt_fe_server.h +++ b/mgmtd/mgmt_fe_server.h @@ -12,7 +12,7 @@ #define MGMTD_FE_MAX_CONN 32 /* Initialise frontend server */ -extern int mgmt_fe_server_init(struct thread_master *master); +extern int mgmt_fe_server_init(struct event_master *master); /* Destroy frontend server */ extern void mgmt_fe_server_destroy(void); diff --git a/mgmtd/mgmt_txn.c b/mgmtd/mgmt_txn.c index 2610d7e85..4d4aad292 100644 --- a/mgmtd/mgmt_txn.c +++ b/mgmtd/mgmt_txn.c @@ -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 thread_master *mgmt_txn_tm; +static struct event_master *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 thread_master *tm) +int mgmt_txn_init(struct mgmt_master *mm, struct event_master *tm) { if (mgmt_txn_mm || mgmt_txn_tm) assert(!"MGMTD TXN: Call txn_init() only once"); diff --git a/mgmtd/mgmt_txn.h b/mgmtd/mgmt_txn.h index f026a3993..48ac61913 100644 --- a/mgmtd/mgmt_txn.h +++ b/mgmtd/mgmt_txn.h @@ -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 thread_master *tm); +extern int mgmt_txn_init(struct mgmt_master *cm, struct event_master *tm); /* Destroy the transaction module. */ extern void mgmt_txn_destroy(void); diff --git a/nhrpd/nhrp_main.c b/nhrpd/nhrp_main.c index 88bb1f871..7b5e7a6ea 100644 --- a/nhrpd/nhrp_main.c +++ b/nhrpd/nhrp_main.c @@ -28,7 +28,7 @@ DEFINE_MGROUP(NHRPD, "NHRP"); unsigned int debug_flags = 0; -struct thread_master *master; +struct event_master *master; struct timeval current_time; /* nhrpd options. */ diff --git a/nhrpd/nhrpd.h b/nhrpd/nhrpd.h index 942822271..10e881235 100644 --- a/nhrpd/nhrpd.h +++ b/nhrpd/nhrpd.h @@ -19,7 +19,7 @@ DECLARE_MGROUP(NHRPD); #define NHRP_VTY_PORT 2610 #define NHRP_DEFAULT_CONFIG "nhrpd.conf" -extern struct thread_master *master; +extern struct event_master *master; enum { NHRP_OK = 0, NHRP_ERR_FAIL, diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index 6b5134a2b..23d43408f 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -62,7 +62,7 @@ struct zebra_privs_t ospf6d_privs = { struct option longopts[] = {{0}}; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; static void __attribute__((noreturn)) ospf6_exit(int status) { diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index 46fa27dd9..9aee6dddc 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -1383,7 +1383,7 @@ static int ospf6TrapIfStateChange(struct ospf6_interface *oi, int next_state, } /* Register OSPFv3-MIB. */ -static int ospf6_snmp_init(struct thread_master *master) +static int ospf6_snmp_init(struct event_master *master) { smux_init(master); REGISTER_MIB("OSPFv3MIB", ospfv3_variables, variable, ospfv3_oid); diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 58124cabd..54f4d854d 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -564,7 +564,7 @@ static void ospf6_disable(struct ospf6 *o) } } -void ospf6_master_init(struct thread_master *master) +void ospf6_master_init(struct event_master *master) { memset(&ospf6_master, 0, sizeof(ospf6_master)); diff --git a/ospf6d/ospf6_top.h b/ospf6d/ospf6_top.h index 73c875124..29badb0a9 100644 --- a/ospf6d/ospf6_top.h +++ b/ospf6d/ospf6_top.h @@ -13,7 +13,7 @@ struct ospf6_master { /* OSPFv3 instance. */ struct list *ospf6; /* OSPFv3 thread master. */ - struct thread_master *master; + struct event_master *master; }; /* ospf6->config_flags */ @@ -233,7 +233,7 @@ extern struct ospf6 *ospf6; extern struct ospf6_master *om6; /* prototypes */ -extern void ospf6_master_init(struct thread_master *master); +extern void ospf6_master_init(struct event_master *master); extern void install_element_ospf6_clear_process(void); extern void ospf6_top_init(void); extern void ospf6_delete(struct ospf6 *o); diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 0ccbb4d65..5ace3ca55 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -750,7 +750,7 @@ static zclient_handler *const ospf6_handlers[] = { [ZEBRA_NEXTHOP_UPDATE] = ospf6_zebra_import_check_update, }; -void ospf6_zebra_init(struct thread_master *master) +void ospf6_zebra_init(struct event_master *master) { /* Allocate zebra structure. */ zclient = zclient_new(master, &zclient_options_default, ospf6_handlers, diff --git a/ospf6d/ospf6_zebra.h b/ospf6d/ospf6_zebra.h index eb6d919b3..79864394a 100644 --- a/ospf6d/ospf6_zebra.h +++ b/ospf6d/ospf6_zebra.h @@ -39,7 +39,7 @@ extern void ospf6_zebra_redistribute(int, vrf_id_t vrf_id); extern void ospf6_zebra_no_redistribute(int, vrf_id_t vrf_id); #define ospf6_zebra_is_redistribute(type, vrf_id) \ vrf_bitmap_check(zclient->redist[AFI_IP6][type], vrf_id) -extern void ospf6_zebra_init(struct thread_master *tm); +extern void ospf6_zebra_init(struct event_master *tm); extern void ospf6_zebra_import_default_route(struct ospf6 *ospf6, bool unreg); extern void ospf6_zebra_add_discard(struct ospf6_route *request, struct ospf6 *ospf6); diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index eea487012..1a6e7e07b 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -1375,7 +1375,7 @@ DEFUN(show_ipv6_ospf6_linkstate_detail, show_ipv6_ospf6_linkstate_detail_cmd, } /* Install ospf related commands. */ -void ospf6_init(struct thread_master *master) +void ospf6_init(struct event_master *master) { ospf6_top_init(); ospf6_area_init(); diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h index 3a2eb71c3..1d9427252 100644 --- a/ospf6d/ospf6d.h +++ b/ospf6d/ospf6d.h @@ -13,7 +13,7 @@ DECLARE_MGROUP(OSPF6D); /* global variables */ -extern struct thread_master *master; +extern struct event_master *master; /* Historical for KAME. */ #ifndef IPV6_JOIN_GROUP @@ -109,6 +109,6 @@ extern struct zebra_privs_t ospf6d_privs; extern struct route_node *route_prev(struct route_node *node); extern void ospf6_debug(void); -extern void ospf6_init(struct thread_master *master); +extern void ospf6_init(struct event_master *master); #endif /* OSPF6D_H */ diff --git a/ospfclient/ospfclient.c b/ospfclient/ospfclient.c index 69d5752d6..e9f5b82d1 100644 --- a/ospfclient/ospfclient.c +++ b/ospfclient/ospfclient.c @@ -51,7 +51,7 @@ struct zebra_privs_t ospfd_privs = {.user = NULL, #define ASYNCPORT 4000 /* Master thread */ -struct thread_master *master; +struct event_master *master; /* Global variables */ struct ospf_apiclient *oclient; diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c index 79626142f..7051acc32 100644 --- a/ospfd/ospf_apiserver.c +++ b/ospfd/ospf_apiserver.c @@ -25,7 +25,7 @@ #include <sys/types.h> -#include "ospfd/ospfd.h" /* for "struct thread_master" */ +#include "ospfd/ospfd.h" /* for "struct event_master" */ #include "ospfd/ospf_interface.h" #include "ospfd/ospf_ism.h" #include "ospfd/ospf_asbr.h" diff --git a/ospfd/ospf_bfd.c b/ospfd/ospf_bfd.c index 3ed54d3bf..9b11a072c 100644 --- a/ospfd/ospf_bfd.c +++ b/ospfd/ospf_bfd.c @@ -310,7 +310,7 @@ DEFUN (no_ip_ospf_bfd, return CMD_SUCCESS; } -void ospf_bfd_init(struct thread_master *tm) +void ospf_bfd_init(struct event_master *tm) { bfd_protocol_integration_init(zclient, tm); diff --git a/ospfd/ospf_bfd.h b/ospfd/ospf_bfd.h index 3c4e1e6c5..462e554a6 100644 --- a/ospfd/ospf_bfd.h +++ b/ospfd/ospf_bfd.h @@ -11,7 +11,7 @@ #include "ospfd/ospf_interface.h" #include "json.h" -extern void ospf_bfd_init(struct thread_master *tm); +extern void ospf_bfd_init(struct event_master *tm); extern void ospf_bfd_write_config(struct vty *vty, const struct ospf_if_params *params); diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 7c591c052..0dacee8c2 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -70,7 +70,7 @@ const struct option longopts[] = { /* OSPFd program name */ /* Master of threads. */ -struct thread_master *master; +struct event_master *master; #ifdef SUPPORT_OSPF_API extern int ospf_apiserver_enable; diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index fb9f36349..35ae909ce 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -2525,7 +2525,7 @@ static int ospf_snmp_ism_change(struct ospf_interface *oi, int state, } /* Register OSPF2-MIB. */ -static int ospf_snmp_init(struct thread_master *tm) +static int ospf_snmp_init(struct event_master *tm) { ospf_snmp_iflist = list_new(); ospf_snmp_vl_table = route_table_init(); diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 4fddd1e81..5f2a2e295 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -49,7 +49,7 @@ struct zclient *zclient = NULL; static struct zclient *zclient_sync; /* For registering threads. */ -extern struct thread_master *master; +extern struct event_master *master; /* Router-id update message from zebra. */ static int ospf_router_id_update_zebra(ZAPI_CALLBACK_ARGS) @@ -2138,7 +2138,7 @@ static zclient_handler *const ospf_handlers[] = { [ZEBRA_CLIENT_CLOSE_NOTIFY] = ospf_zebra_client_close_notify, }; -void ospf_zebra_init(struct thread_master *master, unsigned short instance) +void ospf_zebra_init(struct event_master *master, unsigned short instance) { /* Allocate zebra structure. */ zclient = zclient_new(master, &zclient_options_default, ospf_handlers, diff --git a/ospfd/ospf_zebra.h b/ospfd/ospf_zebra.h index adc338fb1..5634fef87 100644 --- a/ospfd/ospf_zebra.h +++ b/ospfd/ospf_zebra.h @@ -79,7 +79,7 @@ extern int ospf_distance_set(struct vty *, struct ospf *, const char *, const char *, const char *); extern int ospf_distance_unset(struct vty *, struct ospf *, const char *, const char *, const char *); -extern void ospf_zebra_init(struct thread_master *, unsigned short); +extern void ospf_zebra_init(struct event_master *m, unsigned short instance); extern void ospf_zebra_vrf_register(struct ospf *ospf); extern void ospf_zebra_vrf_deregister(struct ospf *ospf); bool ospf_external_default_routemap_apply_walk( diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index a9e2aaabc..fab420a14 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -2140,7 +2140,7 @@ int ospf_nbr_nbma_poll_interval_unset(struct ospf *ospf, struct in_addr addr) return 1; } -void ospf_master_init(struct thread_master *master) +void ospf_master_init(struct event_master *master) { memset(&ospf_master, 0, sizeof(ospf_master)); diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h index dcb5a30e6..497ec7b1b 100644 --- a/ospfd/ospfd.h +++ b/ospfd/ospfd.h @@ -78,7 +78,7 @@ struct ospf_master { struct list *ospf; /* OSPF thread master. */ - struct thread_master *master; + struct event_master *master; /* Various OSPF global configuration. */ uint8_t options; @@ -664,7 +664,7 @@ extern struct ospf_master *om; extern unsigned short ospf_instance; extern const int ospf_redistributed_proto_max; extern struct zclient *zclient; -extern struct thread_master *master; +extern struct event_master *master; extern int ospf_zlog; extern struct zebra_privs_t ospfd_privs; @@ -758,7 +758,7 @@ extern void ospf_interface_area_unset(struct ospf *ospf, struct interface *ifp); extern void ospf_route_map_init(void); -extern void ospf_master_init(struct thread_master *master); +extern void ospf_master_init(struct event_master *master); extern void ospf_vrf_init(void); extern void ospf_vrf_terminate(void); extern void ospf_vrf_link(struct ospf *ospf, struct vrf *vrf); diff --git a/pathd/path_main.c b/pathd/path_main.c index 7d54123d7..92fd0bfd3 100644 --- a/pathd/path_main.c +++ b/pathd/path_main.c @@ -41,7 +41,7 @@ struct zebra_privs_t pathd_privs = { struct option longopts[] = {{0}}; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; static struct frr_daemon_info pathd_di; diff --git a/pathd/path_pcep.c b/pathd/path_pcep.c index 0c5e49504..243879f63 100644 --- a/pathd/path_pcep.c +++ b/pathd/path_pcep.c @@ -58,7 +58,7 @@ static void notify_status(struct path *path, bool not_changed); /* Module Functions */ static int pcep_module_finish(void); -static int pcep_module_late_init(struct thread_master *tm); +static int pcep_module_late_init(struct event_master *tm); static int pcep_module_init(void); /* ------------ Path Helper Functions ------------ */ @@ -310,7 +310,7 @@ int pathd_candidate_removed_handler(struct srte_candidate *candidate) * run before config load, so the CLI commands don't try to touch things that * aren't set up yet... */ -static int pcep_module_config_pre(struct thread_master *tm) +static int pcep_module_config_pre(struct event_master *tm) { assert(pcep_g->fpt == NULL); assert(pcep_g->master == NULL); @@ -329,7 +329,7 @@ static int pcep_module_config_pre(struct thread_master *tm) return 0; } -static int pcep_module_late_init(struct thread_master *tm) +static int pcep_module_late_init(struct event_master *tm) { hook_register(pathd_candidate_created, pathd_candidate_created_handler); hook_register(pathd_candidate_updated, pathd_candidate_updated_handler); diff --git a/pathd/path_pcep.h b/pathd/path_pcep.h index 6f92d7636..ef2edbacf 100644 --- a/pathd/path_pcep.h +++ b/pathd/path_pcep.h @@ -294,7 +294,7 @@ struct path { struct pcep_glob { struct debug dbg; - struct thread_master *master; + struct event_master *master; struct frr_pthread *fpt; uint8_t num_pce_opts_cli; struct pce_opts_cli *pce_opts_cli[MAX_PCE]; diff --git a/pathd/path_pcep_controller.c b/pathd/path_pcep_controller.c index 53963c50b..4f03dbde2 100644 --- a/pathd/path_pcep_controller.c +++ b/pathd/path_pcep_controller.c @@ -152,7 +152,7 @@ static const char *timeout_type_name(enum pcep_ctrl_timeout_type type); /* ------------ API Functions Called from Main Thread ------------ */ -int pcep_ctrl_initialize(struct thread_master *main_thread, +int pcep_ctrl_initialize(struct event_master *main_thread, struct frr_pthread **fpt, pcep_main_event_handler_t event_handler) { diff --git a/pathd/path_pcep_controller.h b/pathd/path_pcep_controller.h index 200a5db99..d1cf0a2a1 100644 --- a/pathd/path_pcep_controller.h +++ b/pathd/path_pcep_controller.h @@ -33,8 +33,8 @@ enum pcep_pathd_event_type { }; struct ctrl_state { - struct thread_master *main; - struct thread_master *self; + struct event_master *main; + struct event_master *self; pcep_main_event_handler_t main_event_handler; struct pcc_opts *pcc_opts; int pcc_count; @@ -97,7 +97,7 @@ struct pcep_pcc_info { }; /* Functions called from the main thread */ -int pcep_ctrl_initialize(struct thread_master *main_thread, +int pcep_ctrl_initialize(struct event_master *main_thread, struct frr_pthread **fpt, pcep_main_event_handler_t event_handler); int pcep_ctrl_finalize(struct frr_pthread **fpt); diff --git a/pathd/path_ted.c b/pathd/path_ted.c index 91033360c..c13b0188f 100644 --- a/pathd/path_ted.c +++ b/pathd/path_ted.c @@ -41,7 +41,7 @@ struct ted_state ted_state_g = {}; * path_path_ted public API function implementations */ -void path_ted_init(struct thread_master *master) +void path_ted_init(struct event_master *master) { ted_state_g.main = master; ted_state_g.link_state_delay_interval = TIMER_RETRY_DELAY; diff --git a/pathd/path_ted.h b/pathd/path_ted.h index e4f362f26..735976f7f 100644 --- a/pathd/path_ted.h +++ b/pathd/path_ted.h @@ -41,7 +41,7 @@ enum igp_import { IMPORT_OSPFv3 }; struct ted_state { - struct thread_master *main; + struct event_master *main; /* Status of TED: enable or disable */ bool enabled; /* From which igp is going to receive data */ @@ -84,7 +84,7 @@ struct ted_state { /* TED management functions */ bool path_ted_is_initialized(void); -void path_ted_init(struct thread_master *master); +void path_ted_init(struct event_master *master); uint32_t path_ted_teardown(void); void path_ted_timer_sync_cancel(void); void path_ted_timer_refresh_cancel(void); diff --git a/pathd/path_zebra.c b/pathd/path_zebra.c index 28daac60b..dcaf0eba1 100644 --- a/pathd/path_zebra.c +++ b/pathd/path_zebra.c @@ -318,7 +318,7 @@ static zclient_handler *const path_handlers[] = { * * @param master The master thread */ -void path_zebra_init(struct thread_master *master) +void path_zebra_init(struct event_master *master) { struct zclient_options options = zclient_options_default; options.synchronous = true; diff --git a/pathd/path_zebra.h b/pathd/path_zebra.h index 0d435bb51..44369526d 100644 --- a/pathd/path_zebra.h +++ b/pathd/path_zebra.h @@ -16,7 +16,7 @@ void path_zebra_add_sr_policy(struct srte_policy *policy, void path_zebra_delete_sr_policy(struct srte_policy *policy); int path_zebra_request_label(mpls_label_t label); void path_zebra_release_label(mpls_label_t label); -void path_zebra_init(struct thread_master *master); +void path_zebra_init(struct event_master *master); void path_zebra_stop(void); #endif /* _FRR_PATH_MPLS_H_ */ diff --git a/pathd/pathd.h b/pathd/pathd.h index 1af5d877a..92d07ef26 100644 --- a/pathd/pathd.h +++ b/pathd/pathd.h @@ -371,7 +371,7 @@ extern struct srte_policy_head srte_policies; extern struct zebra_privs_t pathd_privs; /* master thread, defined in path_main.c */ -extern struct thread_master *master; +extern struct event_master *master; /* pathd.c */ struct srte_segment_list *srte_segment_list_add(const char *name); diff --git a/pbrd/pbr_main.c b/pbrd/pbr_main.c index 2941dbeca..360f5d6e0 100644 --- a/pbrd/pbr_main.c +++ b/pbrd/pbr_main.c @@ -56,7 +56,7 @@ struct zebra_privs_t pbr_privs = { struct option longopts[] = { { 0 } }; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; /* SIGHUP handler. */ static void sighup(void) diff --git a/pbrd/pbr_zebra.h b/pbrd/pbr_zebra.h index 850e5f06d..4d1768421 100644 --- a/pbrd/pbr_zebra.h +++ b/pbrd/pbr_zebra.h @@ -11,7 +11,7 @@ struct pbr_interface { char mapname[100]; }; -extern struct thread_master *master; +extern struct event_master *master; extern void pbr_zebra_init(void); diff --git a/pimd/pim_instance.h b/pimd/pim_instance.h index 27a58c5b2..2afd4781d 100644 --- a/pimd/pim_instance.h +++ b/pimd/pim_instance.h @@ -64,7 +64,7 @@ enum pim_mlag_flags { }; struct pim_router { - struct thread_master *master; + struct event_master *master; uint32_t debugs; diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c index 57f2245f9..9726da544 100644 --- a/pimd/pim_msdp.c +++ b/pimd/pim_msdp.c @@ -1333,7 +1333,7 @@ static void pim_msdp_enable(struct pim_instance *pim) } /* MSDP init */ -void pim_msdp_init(struct pim_instance *pim, struct thread_master *master) +void pim_msdp_init(struct pim_instance *pim, struct event_master *master) { pim->msdp.master = master; char hash_name[64]; diff --git a/pimd/pim_msdp.h b/pimd/pim_msdp.h index 753279a70..c2ee272ef 100644 --- a/pimd/pim_msdp.h +++ b/pimd/pim_msdp.h @@ -172,7 +172,7 @@ struct pim_msdp_listener { struct pim_msdp { enum pim_msdp_flags flags; - struct thread_master *master; + struct event_master *master; struct pim_msdp_listener listener; uint32_t rejected_accepts; @@ -217,7 +217,7 @@ struct pim_msdp { #if PIM_IPV != 6 // struct pim_msdp *msdp; struct pim_instance; -void pim_msdp_init(struct pim_instance *pim, struct thread_master *master); +void pim_msdp_init(struct pim_instance *pim, struct event_master *master); void pim_msdp_exit(struct pim_instance *pim); char *pim_msdp_state_dump(enum pim_msdp_peer_state state, char *buf, int buf_size); @@ -308,7 +308,7 @@ void pim_msdp_peer_change_source(struct pim_msdp_peer *mp, #else /* PIM_IPV == 6 */ static inline void pim_msdp_init(struct pim_instance *pim, - struct thread_master *master) + struct event_master *master) { } diff --git a/ripd/rip_main.c b/ripd/rip_main.c index b6166b14c..f5743d814 100644 --- a/ripd/rip_main.c +++ b/ripd/rip_main.c @@ -47,7 +47,7 @@ struct zebra_privs_t ripd_privs = { .cap_num_i = 0}; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; static struct frr_daemon_info ripd_di; diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c index ab80dd1b8..d6db7f982 100644 --- a/ripd/rip_snmp.c +++ b/ripd/rip_snmp.c @@ -135,7 +135,7 @@ static struct variable rip_variables[] = { {RIP2PEERRCVBADPACKETS, COUNTER, RONLY, rip2PeerTable, 3, {4, 1, 5}}, {RIP2PEERRCVBADROUTES, COUNTER, RONLY, rip2PeerTable, 3, {4, 1, 6}}}; -extern struct thread_master *master; +extern struct event_master *master; static uint8_t *rip2Globals(struct variable *v, oid name[], size_t *length, int exact, size_t *var_len, @@ -553,7 +553,7 @@ static uint8_t *rip2PeerTable(struct variable *v, oid name[], size_t *length, } /* Register RIPv2-MIB. */ -static int rip_snmp_init(struct thread_master *master) +static int rip_snmp_init(struct event_master *master) { rip_ifaddr_table = route_table_init(); diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c index 4a58d1225..3904c9e4b 100644 --- a/ripd/rip_zebra.c +++ b/ripd/rip_zebra.c @@ -223,7 +223,7 @@ zclient_handler *const rip_handlers[] = { [ZEBRA_REDISTRIBUTE_ROUTE_DEL] = rip_zebra_read_route, }; -void rip_zclient_init(struct thread_master *master) +void rip_zclient_init(struct event_master *master) { /* Set default value to the zebra client structure. */ zclient = zclient_new(master, &zclient_options_default, rip_handlers, diff --git a/ripd/ripd.h b/ripd/ripd.h index 4ae13e0d1..1b41ffab1 100644 --- a/ripd/ripd.h +++ b/ripd/ripd.h @@ -418,7 +418,7 @@ extern void rip_if_init(void); extern void rip_route_map_init(void); extern void rip_zebra_vrf_register(struct vrf *vrf); extern void rip_zebra_vrf_deregister(struct vrf *vrf); -extern void rip_zclient_init(struct thread_master *); +extern void rip_zclient_init(struct event_master *); extern void rip_zclient_stop(void); extern int if_check_address(struct rip *rip, struct in_addr addr); extern struct rip *rip_lookup_by_vrf_id(vrf_id_t vrf_id); @@ -509,7 +509,7 @@ extern struct zebra_privs_t ripd_privs; extern struct rip_instance_head rip_instances; /* Master thread structure. */ -extern struct thread_master *master; +extern struct event_master *master; DECLARE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc)); DECLARE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc)); diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c index dcdd0c1f7..18a18b214 100644 --- a/ripngd/ripng_main.c +++ b/ripngd/ripng_main.c @@ -48,7 +48,7 @@ struct zebra_privs_t ripngd_privs = { /* Master of threads. */ -struct thread_master *master; +struct event_master *master; static struct frr_daemon_info ripngd_di; diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index b126a15b5..9bb3826d7 100644 --- a/ripngd/ripng_zebra.c +++ b/ripngd/ripng_zebra.c @@ -228,7 +228,7 @@ static zclient_handler *const ripng_handlers[] = { }; /* Initialize zebra structure and it's commands. */ -void zebra_init(struct thread_master *master) +void zebra_init(struct event_master *master) { /* Allocate zebra structure. */ zclient = zclient_new(master, &zclient_options_default, ripng_handlers, diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h index a80517b43..a94711013 100644 --- a/ripngd/ripngd.h +++ b/ripngd/ripngd.h @@ -316,7 +316,7 @@ struct ripng_offset_list { /* Extern variables. */ extern struct zebra_privs_t ripngd_privs; -extern struct thread_master *master; +extern struct event_master *master; extern struct ripng_instance_head ripng_instances; /* Prototypes. */ @@ -338,7 +338,7 @@ extern void ripng_zebra_vrf_register(struct vrf *vrf); extern void ripng_zebra_vrf_deregister(struct vrf *vrf); extern void ripng_terminate(void); /* zclient_init() is done by ripng_zebra.c:zebra_init() */ -extern void zebra_init(struct thread_master *); +extern void zebra_init(struct event_master *master); extern void ripng_zebra_stop(void); extern void ripng_redistribute_conf_update(struct ripng *ripng, int type); extern void ripng_redistribute_conf_delete(struct ripng *ripng, int type); diff --git a/sharpd/sharp_logpump.c b/sharpd/sharp_logpump.c index a4a932e3c..4a3fffb28 100644 --- a/sharpd/sharp_logpump.c +++ b/sharpd/sharp_logpump.c @@ -28,7 +28,7 @@ static size_t lp_ctr, lp_expect; static struct rusage lp_rusage; static struct vty *lp_vty; -extern struct thread_master *master; +extern struct event_master *master; static void logpump_done(struct event *thread) { diff --git a/sharpd/sharp_main.c b/sharpd/sharp_main.c index 1895a49d8..3e3db11bb 100644 --- a/sharpd/sharp_main.c +++ b/sharpd/sharp_main.c @@ -55,7 +55,7 @@ struct zebra_privs_t sharp_privs = { struct option longopts[] = {{0}}; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; /* SIGHUP handler. */ static void sighup(void) diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index 3c1943587..8c468e0ae 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -26,7 +26,7 @@ struct zclient *zclient = NULL; /* For registering threads. */ -extern struct thread_master *master; +extern struct event_master *master; /* Privs info */ extern struct zebra_privs_t sharp_privs; diff --git a/staticd/static_bfd.c b/staticd/static_bfd.c index ccf7d206f..eceb35711 100644 --- a/staticd/static_bfd.c +++ b/staticd/static_bfd.c @@ -201,7 +201,7 @@ void static_next_hop_bfd_profile(struct static_nexthop *sn, const char *name) bfd_sess_install(sn->bsp); } -void static_bfd_initialize(struct zclient *zc, struct thread_master *tm) +void static_bfd_initialize(struct zclient *zc, struct event_master *tm) { /* Initialize BFD integration library. */ bfd_protocol_integration_init(zc, tm); diff --git a/staticd/static_main.c b/staticd/static_main.c index 1d9b0d16c..646340bac 100644 --- a/staticd/static_main.c +++ b/staticd/static_main.c @@ -51,7 +51,7 @@ struct zebra_privs_t static_privs = { struct option longopts[] = { { 0 } }; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; uintptr_t mgmt_lib_hndl; diff --git a/staticd/static_routes.h b/staticd/static_routes.h index 4fd7a1342..b5c8353e1 100644 --- a/staticd/static_routes.h +++ b/staticd/static_routes.h @@ -252,7 +252,7 @@ extern void static_next_hop_bfd_profile(struct static_nexthop *sn, extern void static_next_hop_bfd_multi_hop(struct static_nexthop *sn, bool mhop); /** Call this function after zebra client initialization. */ -extern void static_bfd_initialize(struct zclient *zc, struct thread_master *tm); +extern void static_bfd_initialize(struct zclient *zc, struct event_master *tm); extern void static_bfd_show(struct vty *vty, bool isjson); diff --git a/staticd/static_zebra.h b/staticd/static_zebra.h index 5f21d6c38..0e7048f81 100644 --- a/staticd/static_zebra.h +++ b/staticd/static_zebra.h @@ -11,7 +11,7 @@ extern "C" { #endif -extern struct thread_master *master; +extern struct event_master *master; extern void static_zebra_nht_register(struct static_nexthop *nh, bool reg); diff --git a/tests/bgpd/test_aspath.c b/tests/bgpd/test_aspath.c index 926097f57..a20116a43 100644 --- a/tests/bgpd/test_aspath.c +++ b/tests/bgpd/test_aspath.c @@ -26,7 +26,7 @@ /* need these to link in libbgp */ struct zebra_privs_t bgpd_privs = {}; -struct thread_master *master = NULL; +struct event_master *master = NULL; static int failed = 0; diff --git a/tests/bgpd/test_capability.c b/tests/bgpd/test_capability.c index 8ef574867..ab36a0a32 100644 --- a/tests/bgpd/test_capability.c +++ b/tests/bgpd/test_capability.c @@ -30,7 +30,7 @@ /* need these to link in libbgp */ struct zebra_privs_t bgpd_privs = {}; -struct thread_master *master = NULL; +struct event_master *master = NULL; static int failed = 0; static int tty = 0; diff --git a/tests/bgpd/test_ecommunity.c b/tests/bgpd/test_ecommunity.c index bb360722c..d2e3d2272 100644 --- a/tests/bgpd/test_ecommunity.c +++ b/tests/bgpd/test_ecommunity.c @@ -16,7 +16,7 @@ /* need these to link in libbgp */ struct zebra_privs_t bgpd_privs = {}; -struct thread_master *master = NULL; +struct event_master *master = NULL; static int failed = 0; diff --git a/tests/bgpd/test_mp_attr.c b/tests/bgpd/test_mp_attr.c index b1f3314f1..ef4255940 100644 --- a/tests/bgpd/test_mp_attr.c +++ b/tests/bgpd/test_mp_attr.c @@ -35,7 +35,7 @@ /* need these to link in libbgp */ struct zebra_privs_t bgpd_privs = {}; -struct thread_master *master = NULL; +struct event_master *master = NULL; static int failed = 0; static int tty = 0; diff --git a/tests/bgpd/test_mpath.c b/tests/bgpd/test_mpath.c index 366280597..3eea19e8f 100644 --- a/tests/bgpd/test_mpath.c +++ b/tests/bgpd/test_mpath.c @@ -61,7 +61,7 @@ struct testcase_t__ { }; /* need these to link in libbgp */ -struct thread_master *master = NULL; +struct event_master *master = NULL; extern struct zclient *zclient; struct zebra_privs_t bgpd_privs = { .user = NULL, diff --git a/tests/bgpd/test_packet.c b/tests/bgpd/test_packet.c index da714e353..6563d5eb9 100644 --- a/tests/bgpd/test_packet.c +++ b/tests/bgpd/test_packet.c @@ -25,7 +25,7 @@ /* need these to link in libbgp */ struct zebra_privs_t bgpd_privs = {}; -struct thread_master *master = NULL; +struct event_master *master = NULL; static struct bgp *bgp; static as_t asn = 100; diff --git a/tests/bgpd/test_peer_attr.c b/tests/bgpd/test_peer_attr.c index dde38c869..a6a5d6097 100644 --- a/tests/bgpd/test_peer_attr.c +++ b/tests/bgpd/test_peer_attr.c @@ -106,7 +106,7 @@ /* Required variables to link in libbgp */ struct zebra_privs_t bgpd_privs = {0}; -struct thread_master *master; +struct event_master *master; enum test_state { TEST_SUCCESS, diff --git a/tests/helpers/c/main.c b/tests/helpers/c/main.c index 75d4e84a4..09f20e44b 100644 --- a/tests/helpers/c/main.c +++ b/tests/helpers/c/main.c @@ -14,7 +14,7 @@ extern void test_init(void); -struct thread_master *master; +struct event_master *master; struct option longopts[] = {{"daemon", no_argument, NULL, 'd'}, {"config_file", required_argument, NULL, 'f'}, diff --git a/tests/isisd/test_common.c b/tests/isisd/test_common.c index 0f37752ce..7c0557ea7 100644 --- a/tests/isisd/test_common.c +++ b/tests/isisd/test_common.c @@ -12,7 +12,7 @@ #include "test_common.h" -struct thread_master *master; +struct event_master *master; struct zebra_privs_t isisd_privs; int isis_sock_init(struct isis_circuit *circuit) diff --git a/tests/isisd/test_common.h b/tests/isisd/test_common.h index 9b83b30ba..28520fb91 100644 --- a/tests/isisd/test_common.h +++ b/tests/isisd/test_common.h @@ -65,7 +65,7 @@ extern int test_topology_load(const struct isis_topology *topology, struct lspdb_head lspdb[]); /* Global variables. */ -extern struct thread_master *master; +extern struct event_master *master; extern struct zebra_privs_t isisd_privs; extern struct isis_topology test_topologies[]; diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c index 0a98748ed..843baa1f6 100644 --- a/tests/lib/cli/common_cli.c +++ b/tests/lib/cli/common_cli.c @@ -17,7 +17,7 @@ #include "common_cli.h" -struct thread_master *master; +struct event_master *master; int dump_args(struct vty *vty, const char *descr, int argc, struct cmd_token *argv[]) diff --git a/tests/lib/cli/common_cli.h b/tests/lib/cli/common_cli.h index 7ef4d860b..697074355 100644 --- a/tests/lib/cli/common_cli.h +++ b/tests/lib/cli/common_cli.h @@ -22,7 +22,7 @@ extern void test_init(int argc, char **argv); /* functions provided by common cli * (includes main()) */ -extern struct thread_master *master; +extern struct event_master *master; extern int test_log_prio; diff --git a/tests/lib/cli/test_commands.c b/tests/lib/cli/test_commands.c index 54db79575..9f788ae18 100644 --- a/tests/lib/cli/test_commands.c +++ b/tests/lib/cli/test_commands.c @@ -30,7 +30,7 @@ extern vector cmdvec; extern struct cmd_node vty_node; extern void test_init_cmd(void); /* provided in test-commands-defun.c */ -struct thread_master *master; /* dummy for libfrr*/ +struct event_master *master; /* dummy for libfrr*/ static vector test_cmds; static char test_buf[32768]; diff --git a/tests/lib/northbound/test_oper_data.c b/tests/lib/northbound/test_oper_data.c index 08860c110..7329cf1af 100644 --- a/tests/lib/northbound/test_oper_data.c +++ b/tests/lib/northbound/test_oper_data.c @@ -14,7 +14,7 @@ #include "log.h" #include "northbound.h" -static struct thread_master *master; +static struct event_master *master; struct troute { struct prefix_ipv4 prefix; diff --git a/tests/lib/test_assert.c b/tests/lib/test_assert.c index 13f8daa5f..356be12c1 100644 --- a/tests/lib/test_assert.c +++ b/tests/lib/test_assert.c @@ -28,7 +28,7 @@ static void func_for_bt(int number) int main(int argc, char **argv) { int number = 10; - struct thread_master *master; + struct event_master *master; zlog_aux_init("NONE: ", LOG_DEBUG); diff --git a/tests/lib/test_buffer.c b/tests/lib/test_buffer.c index 9f501f4e3..4d6fb0d15 100644 --- a/tests/lib/test_buffer.c +++ b/tests/lib/test_buffer.c @@ -8,7 +8,7 @@ #include <lib_vty.h> #include <buffer.h> -struct thread_master *master; +struct event_master *master; int main(int argc, char **argv) { diff --git a/tests/lib/test_checksum.c b/tests/lib/test_checksum.c index fcb79ee28..ff787f93a 100644 --- a/tests/lib/test_checksum.c +++ b/tests/lib/test_checksum.c @@ -11,7 +11,7 @@ #include "network.h" #include "prng.h" -struct thread_master *master; +struct event_master *master; struct acc_vals { int c0; diff --git a/tests/lib/test_grpc.cpp b/tests/lib/test_grpc.cpp index c09bdd05d..3bfe98a66 100644 --- a/tests/lib/test_grpc.cpp +++ b/tests/lib/test_grpc.cpp @@ -34,13 +34,13 @@ #include <grpcpp/security/credentials.h> #include "grpc/frr-northbound.grpc.pb.h" -DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm)); +DEFINE_HOOK(frr_late_init, (struct event_master * tm), (tm)); DEFINE_KOOH(frr_fini, (), ()); struct vty *vty; bool mpls_enabled; -struct thread_master *master; +struct event_master *master; struct zebra_privs_t static_privs = {0}; struct frrmod_runtime *grpc_module; char binpath[2 * MAXPATHLEN + 1]; diff --git a/tests/lib/test_heavy_thread.c b/tests/lib/test_heavy_thread.c index fd8e910fd..bd5ecf37c 100644 --- a/tests/lib/test_heavy_thread.c +++ b/tests/lib/test_heavy_thread.c @@ -22,7 +22,7 @@ #include "tests.h" -extern struct thread_master *master; +extern struct event_master *master; enum { ITERS_FIRST = 0, ITERS_ERR = 100, diff --git a/tests/lib/test_heavy_wq.c b/tests/lib/test_heavy_wq.c index e09c4885c..93aafe83f 100644 --- a/tests/lib/test_heavy_wq.c +++ b/tests/lib/test_heavy_wq.c @@ -27,7 +27,7 @@ DEFINE_MGROUP(TEST_HEAVYWQ, "heavy-wq test"); DEFINE_MTYPE_STATIC(TEST_HEAVYWQ, WQ_NODE, "heavy_wq_node"); DEFINE_MTYPE_STATIC(TEST_HEAVYWQ, WQ_NODE_STR, "heavy_wq_node->str"); -extern struct thread_master *master; +extern struct event_master *master; static struct work_queue *heavy_wq; struct heavy_wq_node { diff --git a/tests/lib/test_memory.c b/tests/lib/test_memory.c index e4423b0b5..a77ee3d22 100644 --- a/tests/lib/test_memory.c +++ b/tests/lib/test_memory.c @@ -15,7 +15,7 @@ DEFINE_MTYPE_STATIC(TEST_MEMORY, TEST, "generic test mtype"); * CVS */ -struct thread_master *master; +struct event_master *master; #if 0 /* set to 1 to use system alloc directly */ #undef XMALLOC diff --git a/tests/lib/test_nexthop_iter.c b/tests/lib/test_nexthop_iter.c index 2bb0b1233..1cff00d4b 100644 --- a/tests/lib/test_nexthop_iter.c +++ b/tests/lib/test_nexthop_iter.c @@ -13,7 +13,7 @@ #include "zebra/rib.h" #include "prng.h" -struct thread_master *master; +struct event_master *master; static int verbose; static void str_append(char **buf, const char *repr) diff --git a/tests/lib/test_privs.c b/tests/lib/test_privs.c index d7bc0b315..13b1c194e 100644 --- a/tests/lib/test_privs.c +++ b/tests/lib/test_privs.c @@ -50,7 +50,7 @@ Report bugs to %s\n", exit(status); } -struct thread_master *master; +struct event_master *master; /* main routine. */ int main(int argc, char **argv) { diff --git a/tests/lib/test_resolver.c b/tests/lib/test_resolver.c index b4d8992b9..5eb99b2ad 100644 --- a/tests/lib/test_resolver.c +++ b/tests/lib/test_resolver.c @@ -26,7 +26,7 @@ #include "tests/lib/cli/common_cli.h" -extern struct thread_master *master; +extern struct event_master *master; static void resolver_result(struct resolver_query *resq, const char *errstr, int numaddrs, union sockunion *addr) diff --git a/tests/lib/test_segv.c b/tests/lib/test_segv.c index 3cf4cbad2..91c29c5ad 100644 --- a/tests/lib/test_segv.c +++ b/tests/lib/test_segv.c @@ -17,7 +17,7 @@ struct frr_signal_t sigs[] = {}; -struct thread_master *master; +struct event_master *master; void func1(int *arg); void func3(void); diff --git a/tests/lib/test_sig.c b/tests/lib/test_sig.c index d568bb547..28101a241 100644 --- a/tests/lib/test_sig.c +++ b/tests/lib/test_sig.c @@ -35,7 +35,7 @@ struct frr_signal_t sigs[] = {{ .handler = &sigusr2, }}; -struct thread_master *master; +struct event_master *master; struct event t; int main(void) diff --git a/tests/lib/test_srcdest_table.c b/tests/lib/test_srcdest_table.c index c1235fe85..a93a968db 100644 --- a/tests/lib/test_srcdest_table.c +++ b/tests/lib/test_srcdest_table.c @@ -24,7 +24,7 @@ #define s6_addr32 __u6_addr.__u6_addr32 #endif /*s6_addr32*/ -struct thread_master *master; +struct event_master *master; /* This structure is copied from lib/srcdest_table.c to which it is * private as far as other parts of Quagga are concerned. diff --git a/tests/lib/test_stream.c b/tests/lib/test_stream.c index 8bf6f7fcc..319afd9cf 100644 --- a/tests/lib/test_stream.c +++ b/tests/lib/test_stream.c @@ -11,7 +11,7 @@ #include "printfrr.h" static unsigned long long ham = 0xdeadbeefdeadbeef; -struct thread_master *master; +struct event_master *master; static void print_stream(struct stream *s) { diff --git a/tests/lib/test_table.c b/tests/lib/test_table.c index 41d700395..2ae1fe82a 100644 --- a/tests/lib/test_table.c +++ b/tests/lib/test_table.c @@ -25,7 +25,7 @@ typedef struct test_node_t_ { char *prefix_str; } test_node_t; -struct thread_master *master; +struct event_master *master; /* * add_node diff --git a/tests/lib/test_timer_correctness.c b/tests/lib/test_timer_correctness.c index 054254f4a..ae5ec1dc7 100644 --- a/tests/lib/test_timer_correctness.c +++ b/tests/lib/test_timer_correctness.c @@ -23,7 +23,7 @@ #define TIMESTR_LEN strlen("4294967296.999999") -struct thread_master *master; +struct event_master *master; static size_t log_buf_len; static size_t log_buf_pos; diff --git a/tests/lib/test_timer_performance.c b/tests/lib/test_timer_performance.c index c5ac1fa83..017d90334 100644 --- a/tests/lib/test_timer_performance.c +++ b/tests/lib/test_timer_performance.c @@ -20,7 +20,7 @@ #define SCHEDULE_TIMERS 1000000 #define REMOVE_TIMERS 500000 -struct thread_master *master; +struct event_master *master; static void dummy_func(struct event *thread) { diff --git a/tests/lib/test_zmq.c b/tests/lib/test_zmq.c index 6869870f1..bb6a29e68 100644 --- a/tests/lib/test_zmq.c +++ b/tests/lib/test_zmq.c @@ -12,7 +12,7 @@ DEFINE_MTYPE_STATIC(LIB, TESTBUF, "zmq test buffer"); DEFINE_MTYPE_STATIC(LIB, ZMQMSG, "zmq message"); -static struct thread_master *master; +static struct event_master *master; static void msg_buf_free(void *data, void *hint) { diff --git a/tests/ospfd/common.c b/tests/ospfd/common.c index ef5e3ed17..38bc08984 100644 --- a/tests/ospfd/common.c +++ b/tests/ospfd/common.c @@ -17,7 +17,7 @@ #include "common.h" -struct thread_master *master; +struct event_master *master; struct zebra_privs_t ospfd_privs; diff --git a/tests/ospfd/common.h b/tests/ospfd/common.h index 6d3e63e35..2b02b0f0e 100644 --- a/tests/ospfd/common.h +++ b/tests/ospfd/common.h @@ -30,7 +30,7 @@ extern int topology_load(struct vty *vty, struct ospf_topology *topology, struct ospf_test_node *root, struct ospf *ospf); /* Global variables. */ -extern struct thread_master *master; +extern struct event_master *master; extern struct ospf_topology topo1; extern struct ospf_topology topo2; extern struct ospf_topology topo3; diff --git a/vrrpd/vrrp.h b/vrrpd/vrrp.h index 767019033..c36c7fa23 100644 --- a/vrrpd/vrrp.h +++ b/vrrpd/vrrp.h @@ -65,7 +65,7 @@ struct vrrp_defaults { extern struct vrrp_defaults vd; /* threadmaster */ -extern struct thread_master *master; +extern struct event_master *master; /* privileges */ extern struct zebra_privs_t vrrp_privs; diff --git a/vrrpd/vrrp_main.c b/vrrpd/vrrp_main.c index 90c3a7772..1ded5238c 100644 --- a/vrrpd/vrrp_main.c +++ b/vrrpd/vrrp_main.c @@ -50,7 +50,7 @@ struct zebra_privs_t vrrp_privs = { struct option longopts[] = { {0} }; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; static struct frr_daemon_info vrrpd_di; diff --git a/vtysh/vtysh.h b/vtysh/vtysh.h index 2c202c353..3299df67e 100644 --- a/vtysh/vtysh.h +++ b/vtysh/vtysh.h @@ -9,9 +9,9 @@ #include "memory.h" DECLARE_MGROUP(MVTYSH); -struct thread_master; +struct event_master; -extern struct thread_master *master; +extern struct event_master *master; #define VTYSH_ZEBRA 0x00001 #define VTYSH_RIPD 0x00002 diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c index 4487fa032..47517010b 100644 --- a/vtysh/vtysh_main.c +++ b/vtysh/vtysh_main.c @@ -64,7 +64,7 @@ int execute_flag = 0; int user_mode; /* Master of threads. */ -struct thread_master *master; +struct event_master *master; /* Command logging */ FILE *logfile; diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c index 8f17f7a9a..eab4ede05 100644 --- a/watchfrr/watchfrr.c +++ b/watchfrr/watchfrr.c @@ -53,7 +53,7 @@ DEFINE_MGROUP(WATCHFRR, "watchfrr"); DEFINE_MTYPE_STATIC(WATCHFRR, WATCHFRR_DAEMON, "watchfrr daemon entry"); /* Needs to be global, referenced somewhere inside libfrr. */ -struct thread_master *master; +struct event_master *master; static bool watch_only = false; const char *pathspace; diff --git a/zebra/dpdk/zebra_dplane_dpdk.c b/zebra/dpdk/zebra_dplane_dpdk.c index 87245f47e..eed5e75b7 100644 --- a/zebra/dpdk/zebra_dplane_dpdk.c +++ b/zebra/dpdk/zebra_dplane_dpdk.c @@ -694,7 +694,7 @@ static int zd_dpdk_finish(struct zebra_dplane_provider *prov, bool early) } -static int zd_dpdk_plugin_init(struct thread_master *tm) +static int zd_dpdk_plugin_init(struct event_master *tm) { int ret; diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index b5397ce29..03dd23feb 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -1585,7 +1585,7 @@ static int fpm_nl_process(struct zebra_dplane_provider *prov) return 0; } -static int fpm_nl_new(struct thread_master *tm) +static int fpm_nl_new(struct event_master *tm) { struct zebra_dplane_provider *prov = NULL; int rv; diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c index 2d90afaed..06a5b6600 100644 --- a/zebra/irdp_main.c +++ b/zebra/irdp_main.c @@ -316,7 +316,7 @@ static int irdp_finish(void) return 0; } -static int irdp_init(struct thread_master *master) +static int irdp_init(struct event_master *master) { irdp_if_init(); diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 4bdf268c4..3fbaefe8a 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -156,7 +156,7 @@ static const struct message rttype_str[] = {{RTN_UNSPEC, "none"}, {RTN_XRESOLVE, "resolver"}, {0}}; -extern struct thread_master *master; +extern struct event_master *master; extern struct zebra_privs_t zserv_privs; diff --git a/zebra/main.c b/zebra/main.c index d3447a8ca..827a0dd5e 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -52,7 +52,7 @@ pid_t pid; /* Pacify zclient.o in libfrr, which expects this variable. */ -struct thread_master *master; +struct event_master *master; /* Route retain mode flag. */ int retain_mode = 0; diff --git a/zebra/sample_plugin.c b/zebra/sample_plugin.c index 0ccf736f2..5892b949d 100644 --- a/zebra/sample_plugin.c +++ b/zebra/sample_plugin.c @@ -76,7 +76,7 @@ static int sample_process(struct zebra_dplane_provider *prov) * Init entry point called during zebra startup. This is registered during * module init. */ -static int init_sample_plugin(struct thread_master *tm) +static int init_sample_plugin(struct event_master *tm) { int ret; diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 333211538..8d5ccac22 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -582,7 +582,7 @@ static struct zebra_dplane_globals { struct frr_pthread *dg_pthread; /* Event-delivery context 'master' for the dplane */ - struct thread_master *dg_master; + struct event_master *dg_master; /* Event/'thread' pointer for queued updates */ struct event *dg_t_update; @@ -633,7 +633,7 @@ neigh_update_internal(enum dplane_op_e op, const struct interface *ifp, */ /* Obtain thread_master for dataplane thread */ -struct thread_master *dplane_get_thread_master(void) +struct event_master *dplane_get_thread_master(void) { return zdplane_info.dg_master; } diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 3a4f3c217..05d42a217 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -1006,7 +1006,7 @@ void dplane_provider_lock(struct zebra_dplane_provider *prov); void dplane_provider_unlock(struct zebra_dplane_provider *prov); /* Obtain thread_master for dataplane thread */ -struct thread_master *dplane_get_thread_master(void); +struct event_master *dplane_get_thread_master(void); /* Providers should (generally) limit number of updates per work cycle */ int dplane_provider_get_work_limit(const struct zebra_dplane_provider *prov); diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index d453c6f25..db277e96e 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -156,7 +156,7 @@ struct zfpm_glob { */ enum zfpm_msg_format message_format; - struct thread_master *master; + struct event_master *master; enum zfpm_state state; @@ -1978,7 +1978,7 @@ static struct cmd_node zebra_node = { * * Returns true on success. */ -static int zfpm_init(struct thread_master *master) +static int zfpm_init(struct event_master *master) { int enable = 1; uint16_t port = 0; diff --git a/zebra/zebra_mlag_private.c b/zebra/zebra_mlag_private.c index 727f2a9ca..62870119f 100644 --- a/zebra/zebra_mlag_private.c +++ b/zebra/zebra_mlag_private.c @@ -32,7 +32,7 @@ * */ -static struct thread_master *zmlag_master; +static struct event_master *zmlag_master; static int mlag_socket; static void zebra_mlag_connect(struct event *thread); diff --git a/zebra/zebra_opaque.c b/zebra/zebra_opaque.c index b5f52089d..b2a5415c4 100644 --- a/zebra/zebra_opaque.c +++ b/zebra/zebra_opaque.c @@ -77,7 +77,7 @@ static struct zebra_opaque_globals { struct frr_pthread *pthread; /* Event-delivery context 'master' for the module */ - struct thread_master *master; + struct event_master *master; /* Event/'thread' pointer for queued zapi messages */ struct event *t_msgs; diff --git a/zebra/zebra_router.h b/zebra/zebra_router.h index 028a41c31..2179178a9 100644 --- a/zebra/zebra_router.h +++ b/zebra/zebra_router.h @@ -110,7 +110,7 @@ struct zebra_mlag_info { struct frr_pthread *zebra_pth_mlag; /* MLAG Thread context 'master' */ - struct thread_master *th_master; + struct event_master *th_master; /* * Event for Initial MLAG Connection setup & Data Read @@ -127,7 +127,7 @@ struct zebra_router { atomic_bool in_shutdown; /* Thread master */ - struct thread_master *master; + struct event_master *master; /* Lists of clients who have connected to us */ struct list *client_list; diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c index c8b652f54..07b7d77bd 100644 --- a/zebra/zebra_snmp.c +++ b/zebra/zebra_snmp.c @@ -536,7 +536,7 @@ static uint8_t *ipCidrTable(struct variable *v, oid objid[], size_t *objid_len, return NULL; } -static int zebra_snmp_init(struct thread_master *tm) +static int zebra_snmp_init(struct event_master *tm) { smux_init(tm); REGISTER_MIB("mibII/ipforward", zebra_variables, variable, ipfw_oid); |