Skip to content

Commit cd9d053

Browse files
committed
*: Convert struct event_master to struct event_loop
Let's find a better name for it. Signed-off-by: Donald Sharp <[email protected]>
1 parent ce50d11 commit cd9d053

File tree

197 files changed

+330
-338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+330
-338
lines changed

babeld/babel_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static void babel_exit_properly(void);
3737
static void babel_save_state_file(void);
3838

3939

40-
struct event_master *master; /* quagga's threads handler */
40+
struct event_loop *master; /* quagga's threads handler */
4141
struct timeval babel_now; /* current time */
4242

4343
unsigned char myid[8]; /* unique id (mac address of an interface) */

babeld/babel_main.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
99
#include "vty.h"
1010

1111
extern struct timeval babel_now; /* current time */
12-
extern struct event_master *master; /* quagga's threads handler */
12+
extern struct event_loop *master; /* quagga's threads handler */
1313
extern int debug;
1414
extern int resend_delay;
1515

bfdd/bfd.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ void bfd_key_iterate(hash_iter_func hif, void *arg);
686686
unsigned long bfd_get_session_count(void);
687687

688688
/* Export callback functions for `event.c`. */
689-
extern struct event_master *master;
689+
extern struct event_loop *master;
690690

691691
void bfd_recvtimer_cb(struct event *t);
692692
void bfd_echo_recvtimer_cb(struct event *t);

bfdd/bfdd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DEFINE_MTYPE(BFDD, BFDD_CONTROL, "long-lived control socket memory");
3232
DEFINE_MTYPE(BFDD, BFDD_NOTIFICATION, "short-lived control notification data");
3333

3434
/* Master of threads. */
35-
struct event_master *master;
35+
struct event_loop *master;
3636

3737
/* BFDd privileges */
3838
static zebra_capabilities_t _caps_p[] = {ZCAP_BIND, ZCAP_SYS_ADMIN, ZCAP_NET_RAW};

bgpd/bgp_bfd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ DEFUN(no_neighbor_bfd_profile, no_neighbor_bfd_profile_cmd,
609609
}
610610
#endif /* HAVE_BFDD */
611611

612-
void bgp_bfd_init(struct event_master *tm)
612+
void bgp_bfd_init(struct event_loop *tm)
613613
{
614614
/* Initialize BFD client functions */
615615
bfd_protocol_integration_init(zclient, tm);

bgpd/bgp_bfd.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
((((peer)->sort == BGP_PEER_IBGP) && !(peer)->shared_network) \
1313
|| is_ebgp_multihop_configured((peer)))
1414

15-
extern void bgp_bfd_init(struct event_master *tm);
15+
extern void bgp_bfd_init(struct event_loop *tm);
1616

1717
extern void bgp_bfd_peer_config_write(struct vty *vty, const struct peer *peer,
1818
const char *addr);

bgpd/bgp_bmp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ static int bmp_config_write(struct bgp *bgp, struct vty *vty)
25262526
return 0;
25272527
}
25282528

2529-
static int bgp_bmp_init(struct event_master *tm)
2529+
static int bgp_bmp_init(struct event_loop *tm)
25302530
{
25312531
install_node(&bmp_node);
25322532
install_default(BMP_NODE);

bgpd/bgp_labelpool.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void lp_chunk_free(void *goner)
177177
XFREE(MTYPE_BGP_LABEL_CHUNK, goner);
178178
}
179179

180-
void bgp_lp_init(struct event_master *master, struct labelpool *pool)
180+
void bgp_lp_init(struct event_loop *master, struct labelpool *pool)
181181
{
182182
if (BGP_DEBUG(labelpool, LABELPOOL))
183183
zlog_debug("%s: entry", __func__);

bgpd/bgp_labelpool.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct labelpool {
3131
uint32_t next_chunksize; /* request this many labels */
3232
};
3333

34-
extern void bgp_lp_init(struct event_master *master, struct labelpool *pool);
34+
extern void bgp_lp_init(struct event_loop *master, struct labelpool *pool);
3535
extern void bgp_lp_finish(void);
3636
extern void bgp_lp_get(int type, void *labelid,
3737
int (*cbfunc)(mpls_label_t label, void *labelid, bool allocated));

bgpd/bgp_rpki.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static void rpki_init_sync_socket(void)
591591

592592
}
593593

594-
static int bgp_rpki_init(struct event_master *master)
594+
static int bgp_rpki_init(struct event_loop *master)
595595
{
596596
rpki_debug = false;
597597
rtr_is_running = false;

bgpd/bgp_snmp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "bgpd/bgp_snmp_bgp4v2.h"
3131
#include "bgpd/bgp_mplsvpn_snmp.h"
3232

33-
static int bgp_snmp_init(struct event_master *tm)
33+
static int bgp_snmp_init(struct event_loop *tm)
3434
{
3535
smux_init(tm);
3636
bgp_snmp_bgp4_init(tm);

bgpd/bgp_snmp_bgp4.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ int bgpTrapBackwardTransition(struct peer *peer)
791791
return 0;
792792
}
793793

794-
int bgp_snmp_bgp4_init(struct event_master *tm)
794+
int bgp_snmp_bgp4_init(struct event_loop *tm)
795795
{
796796
REGISTER_MIB("mibII/bgp", bgp_variables, variable, bgp_oid);
797797
return 0;

bgpd/bgp_snmp_bgp4.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@
7171

7272
extern int bgpTrapEstablished(struct peer *peer);
7373
extern int bgpTrapBackwardTransition(struct peer *peer);
74-
extern int bgp_snmp_bgp4_init(struct event_master *tm);
74+
extern int bgp_snmp_bgp4_init(struct event_loop *tm);
7575

7676
#endif /* _FRR_BGP_SNMP_BGP4_H_ */

bgpd/bgp_snmp_bgp4v2.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ static struct variable bgpv2_variables[] = {
13941394
{1, 9, 1, BGP4V2_NLRI_PATH_ATTR_UNKNOWN, 2, 16}},
13951395
};
13961396

1397-
int bgp_snmp_bgp4v2_init(struct event_master *tm)
1397+
int bgp_snmp_bgp4v2_init(struct event_loop *tm)
13981398
{
13991399
REGISTER_MIB("mibII/bgpv2", bgpv2_variables, variable, bgpv2_oid);
14001400
return 0;

bgpd/bgp_snmp_bgp4v2.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@
8181
#define BGP4V2_ESTABLISHED_NOTIFICATION 1
8282
#define BGP4V2_BACKWARD_TRANSITION_NOTIFICATION 2
8383

84-
extern int bgp_snmp_bgp4v2_init(struct event_master *tm);
84+
extern int bgp_snmp_bgp4v2_init(struct event_loop *tm);
8585

8686
#endif /* _FRR_BGP_SNMP_BGP4V2_H_ */

bgpd/bgp_zebra.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3443,7 +3443,7 @@ void bgp_if_init(void)
34433443
hook_register_prio(if_del, 0, bgp_if_delete_hook);
34443444
}
34453445

3446-
void bgp_zebra_init(struct event_master *master, unsigned short instance)
3446+
void bgp_zebra_init(struct event_loop *master, unsigned short instance)
34473447
{
34483448
zclient_num_connects = 0;
34493449

bgpd/bgp_zebra.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
/* Default weight for next hop, if doing weighted ECMP. */
1919
#define BGP_ZEBRA_DEFAULT_NHOP_WEIGHT 1
2020

21-
extern void bgp_zebra_init(struct event_master *master,
22-
unsigned short instance);
21+
extern void bgp_zebra_init(struct event_loop *master, unsigned short instance);
2322
extern void bgp_if_init(void);
2423
extern void bgp_zebra_init_tm_connect(struct bgp *bgp);
2524
extern uint32_t bgp_zebra_tm_get_id(void);

bgpd/bgpd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8010,7 +8010,7 @@ char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
80108010
return buf;
80118011
}
80128012

8013-
void bgp_master_init(struct event_master *master, const int buffer_size,
8013+
void bgp_master_init(struct event_loop *master, const int buffer_size,
80148014
struct list *addresses)
80158015
{
80168016
qobj_init();

bgpd/bgpd.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct bgp_master {
9898
struct list *bgp;
9999

100100
/* BGP thread master. */
101-
struct event_master *master;
101+
struct event_loop *master;
102102

103103
/* Listening sockets */
104104
struct list *listen_sockets;
@@ -2156,7 +2156,7 @@ extern char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
21562156

21572157
extern int bgp_config_write(struct vty *);
21582158

2159-
extern void bgp_master_init(struct event_master *master, const int buffer_size,
2159+
extern void bgp_master_init(struct event_loop *master, const int buffer_size,
21602160
struct list *addresses);
21612161

21622162
extern void bgp_init(unsigned short instance);

bgpd/rfapi/rfapi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ struct rfapi_rfp_cfg {
335335
* return value:
336336
* rfp_start_val rfp returned value passed on rfp_stop and other rfapi calls
337337
--------------------------------------------*/
338-
extern void *rfp_start(struct event_master *master, struct rfapi_rfp_cfg **cfgp,
338+
extern void *rfp_start(struct event_loop *master, struct rfapi_rfp_cfg **cfgp,
339339
struct rfapi_rfp_cb_methods **cbmp);
340340

341341
/*------------------------------------------

bgpd/rfapi/rfapi_backend.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "bgpd/bgp_nexthop.h"
1515

1616
extern void rfapi_init(void);
17-
extern void vnc_zebra_init(struct event_master *master);
17+
extern void vnc_zebra_init(struct event_loop *master);
1818
extern void vnc_zebra_destroy(void);
1919

2020
extern void rfapi_delete(struct bgp *);

bgpd/rfapi/vnc_zebra.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ static zclient_handler *const vnc_handlers[] = {
890890
* Modeled after bgp_zebra.c'bgp_zebra_init()
891891
* Charriere asks, "Is it possible to carry two?"
892892
*/
893-
void vnc_zebra_init(struct event_master *master)
893+
void vnc_zebra_init(struct event_loop *master)
894894
{
895895
/* Set default values. */
896896
zclient_vnc = zclient_new(master, &zclient_options_default,

bgpd/rfp-example/librfp/rfp_example.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
struct rfp_instance_t {
1818
struct rfapi_rfp_cfg rfapi_config;
1919
struct rfapi_rfp_cb_methods rfapi_callbacks;
20-
struct event_master *master;
20+
struct event_loop *master;
2121
uint32_t config_var;
2222
};
2323

@@ -271,7 +271,7 @@ static int rfp_cfg_write_cb(struct vty *vty, void *rfp_start_val)
271271
* rfp_start_val rfp returned value passed on rfp_stop and rfp_cfg_write
272272
*
273273
--------------------------------------------*/
274-
void *rfp_start(struct event_master *master, struct rfapi_rfp_cfg **cfgp,
274+
void *rfp_start(struct event_loop *master, struct rfapi_rfp_cfg **cfgp,
275275
struct rfapi_rfp_cb_methods **cbmp)
276276
{
277277
memset(&global_rfi, 0, sizeof(global_rfi));

doc/developer/modules.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Basic boilerplate:
5858
#include "libfrr.h"
5959
#include "event.h"
6060

61-
static int module_late_init(struct event_master *master)
61+
static int module_late_init(struct event_loop *master)
6262
{
6363
/* Do initialization stuff here */
6464
return 0;

doc/developer/process-architecture.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ section. For now it provides basic information necessary to understand the
4747
interplay between the event system and kernel threads.
4848

4949
The core event system is implemented in :file:`lib/thread.[ch]`. The primary
50-
structure is ``struct event_master``, hereafter referred to as a
50+
structure is ``struct event_loop``, hereafter referred to as a
5151
``threadmaster``. A ``threadmaster`` is a global state object, or context, that
5252
holds all the tasks currently pending execution as well as statistics on tasks
5353
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
9595

9696
::
9797

98-
event_add_read(struct event_master *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref);
98+
event_add_read(struct event_loop *master, int (*handler)(struct event *), void *arg, int fd, struct event **ref);
9999

100100
The ``struct event`` is then created and added to the appropriate internal
101101
datastructure within the ``threadmaster``. Note that the ``READ`` and

eigrpd/eigrp_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct zebra_privs_t eigrpd_privs = {
7676
struct option longopts[] = {{0}};
7777

7878
/* Master of threads. */
79-
struct event_master *master;
79+
struct event_loop *master;
8080

8181
/* Forward declaration of daemon info structure. */
8282
static struct frr_daemon_info eigrpd_di;

eigrpd/eigrp_zebra.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static int eigrp_zebra_read_route(ZAPI_CALLBACK_ARGS);
4949
struct zclient *zclient = NULL;
5050

5151
/* For registering threads. */
52-
extern struct event_master *master;
52+
extern struct event_loop *master;
5353
struct in_addr router_id_zebra;
5454

5555
/* Router-id update message from zebra. */

eigrpd/eigrpd.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct eigrp_master {
3535
struct list *eigrp;
3636

3737
/* EIGRP thread master. */
38-
struct event_master *master;
38+
struct event_loop *master;
3939

4040
/* Zebra interface list. */
4141
struct list *iflist;
@@ -51,7 +51,7 @@ struct eigrp_master {
5151

5252
/* Extern variables. */
5353
extern struct zclient *zclient;
54-
extern struct event_master *master;
54+
extern struct event_loop *master;
5555
extern struct eigrp_master *eigrp_om;
5656
extern struct zebra_privs_t eigrpd_privs;
5757

isisd/isis_bfd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static int bfd_handle_circuit_add_addr(struct isis_circuit *circuit)
209209
return 0;
210210
}
211211

212-
void isis_bfd_init(struct event_master *tm)
212+
void isis_bfd_init(struct event_loop *tm)
213213
{
214214
bfd_protocol_integration_init(zclient, tm);
215215

isisd/isis_bfd.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#define ISIS_BFD_H
88

99
struct isis_circuit;
10-
struct event_master;
10+
struct event_loop;
1111

1212
void isis_bfd_circuit_cmd(struct isis_circuit *circuit);
13-
void isis_bfd_init(struct event_master *tm);
13+
void isis_bfd_init(struct event_loop *tm);
1414

1515
#endif
1616

isisd/isis_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static const struct option longopts[] = {
7777
{0}};
7878

7979
/* Master of threads. */
80-
struct event_master *master;
80+
struct event_loop *master;
8181

8282
/*
8383
* Prototypes.

isisd/isis_snmp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2797,7 +2797,7 @@ static uint8_t *isis_snmp_find_isadj_prot_supp(struct variable *v, oid *name,
27972797

27982798

27992799
/* Register ISIS-MIB. */
2800-
static int isis_snmp_init(struct event_master *tm)
2800+
static int isis_snmp_init(struct event_loop *tm)
28012801
{
28022802
struct isis_func_to_prefix *h2f = isis_func_to_prefix_arr;
28032803
struct variable *v;

isisd/isis_zebra.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ static zclient_handler *const isis_handlers[] = {
828828
[ZEBRA_CLIENT_CLOSE_NOTIFY] = isis_zebra_client_close_notify,
829829
};
830830

831-
void isis_zebra_init(struct event_master *master, int instance)
831+
void isis_zebra_init(struct event_loop *master, int instance)
832832
{
833833
/* Initialize asynchronous zclient. */
834834
zclient = zclient_new(master, &zclient_options_default, isis_handlers,

isisd/isis_zebra.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct label_chunk {
2020
};
2121
#define CHUNK_SIZE 64
2222

23-
void isis_zebra_init(struct event_master *master, int instance);
23+
void isis_zebra_init(struct event_loop *master, int instance);
2424
void isis_zebra_stop(void);
2525

2626
struct isis_route_info;

isisd/isisd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ struct isis *isis_lookup_by_sysid(const uint8_t *sysid)
166166
return NULL;
167167
}
168168

169-
void isis_master_init(struct event_master *master)
169+
void isis_master_init(struct event_loop *master)
170170
{
171171
memset(&isis_master, 0, sizeof(isis_master));
172172
im = &isis_master;

isisd/isisd.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct isis_master {
7171
/* ISIS instance. */
7272
struct list *isis;
7373
/* ISIS thread master. */
74-
struct event_master *master;
74+
struct event_loop *master;
7575
uint8_t options;
7676
};
7777
#define F_ISIS_UNIT_TEST 0x01
@@ -252,7 +252,7 @@ DECLARE_MTYPE(ISIS_PLIST_NAME);
252252
DECLARE_HOOK(isis_area_overload_bit_update, (struct isis_area * area), (area));
253253

254254
void isis_terminate(void);
255-
void isis_master_init(struct event_master *master);
255+
void isis_master_init(struct event_loop *master);
256256
void isis_vrf_link(struct isis *isis, struct vrf *vrf);
257257
void isis_vrf_unlink(struct isis *isis, struct vrf *vrf);
258258
struct isis *isis_lookup_by_vrfid(vrf_id_t vrf_id);
@@ -329,7 +329,7 @@ void config_end_lsp_generate(struct isis_area *area);
329329
#define ISIS_SR "/frr-isisd:isis/instance/segment-routing"
330330

331331
/* Master of threads. */
332-
extern struct event_master *master;
332+
extern struct event_loop *master;
333333

334334
extern unsigned long debug_adj_pkt;
335335
extern unsigned long debug_snp_pkt;

ldpd/ldp_snmp.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ static int ldp_snmp_nbr_state_change(struct nbr * nbr, int old_state)
11731173
return 0;
11741174
}
11751175

1176-
static int ldp_snmp_init(struct event_master *tm)
1176+
static int ldp_snmp_init(struct event_loop *tm)
11771177
{
11781178
hook_register(agentx_enabled, ldp_snmp_agentx_enabled);
11791179

@@ -1182,7 +1182,7 @@ static int ldp_snmp_init(struct event_master *tm)
11821182
return 0;
11831183
}
11841184

1185-
static int ldp_snmp_register_mib(struct event_master *tm)
1185+
static int ldp_snmp_register_mib(struct event_loop *tm)
11861186
{
11871187
static int registered = 0;
11881188

0 commit comments

Comments
 (0)