wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eloop.h
Go to the documentation of this file.
1 
13 #ifndef ELOOP_H
14 #define ELOOP_H
15 
20 #define ELOOP_ALL_CTX (void *) -1
21 
28 typedef enum {
29  EVENT_TYPE_READ = 0,
30  EVENT_TYPE_WRITE,
31  EVENT_TYPE_EXCEPTION
33 
40 typedef void (*eloop_sock_handler)(int sock, void *eloop_ctx, void *sock_ctx);
41 
47 typedef void (*eloop_event_handler)(void *eloop_data, void *user_ctx);
48 
54 typedef void (*eloop_timeout_handler)(void *eloop_data, void *user_ctx);
55 
63 typedef void (*eloop_signal_handler)(int sig, void *signal_ctx);
64 
71 int eloop_init(void);
72 
87 int eloop_register_read_sock(int sock, eloop_sock_handler handler,
88  void *eloop_data, void *user_data);
89 
97 void eloop_unregister_read_sock(int sock);
98 
114 int eloop_register_sock(int sock, eloop_event_type type,
115  eloop_sock_handler handler,
116  void *eloop_data, void *user_data);
117 
126 void eloop_unregister_sock(int sock, eloop_event_type type);
127 
150 int eloop_register_event(void *event, size_t event_size,
151  eloop_event_handler handler,
152  void *eloop_data, void *user_data);
153 
162 void eloop_unregister_event(void *event, size_t event_size);
163 
176 int eloop_register_timeout(unsigned int secs, unsigned int usecs,
177  eloop_timeout_handler handler,
178  void *eloop_data, void *user_data);
179 
192  void *eloop_data, void *user_data);
193 
206  void *eloop_data, void *user_data,
207  struct os_reltime *remaining);
208 
220  void *eloop_data, void *user_data);
221 
235 int eloop_deplete_timeout(unsigned int req_secs, unsigned int req_usecs,
236  eloop_timeout_handler handler, void *eloop_data,
237  void *user_data);
238 
252 int eloop_replenish_timeout(unsigned int req_secs, unsigned int req_usecs,
253  eloop_timeout_handler handler, void *eloop_data,
254  void *user_data);
255 
269 int eloop_register_signal(int sig, eloop_signal_handler handler,
270  void *user_data);
271 
290  void *user_data);
291 
310  void *user_data);
311 
320 void eloop_run(void);
321 
329 void eloop_terminate(void);
330 
338 void eloop_destroy(void);
339 
349 int eloop_terminated(void);
350 
357 void eloop_wait_for_read_sock(int sock);
358 
359 #endif /* ELOOP_H */
int eloop_register_timeout(unsigned int secs, unsigned int usecs, eloop_timeout_handler handler, void *eloop_data, void *user_data)
Register timeout.
Definition: eloop.c:597
void eloop_run(void)
Start the event loop.
Definition: eloop.c:891
void eloop_unregister_read_sock(int sock)
Unregister handler for read events.
Definition: eloop.c:554
void(* eloop_timeout_handler)(void *eloop_data, void *user_ctx)
eloop timeout event callback type
Definition: eloop.h:54
int eloop_terminated(void)
Check whether event loop has been terminated.
Definition: eloop.c:1099
int eloop_replenish_timeout(unsigned int req_secs, unsigned int req_usecs, eloop_timeout_handler handler, void *eloop_data, void *user_data)
Replenish a timeout that is already registered.
Definition: eloop.c:754
int eloop_is_timeout_registered(eloop_timeout_handler handler, void *eloop_data, void *user_data)
Check if a timeout is already registered.
Definition: eloop.c:706
int eloop_register_signal_reconfig(eloop_signal_handler handler, void *user_data)
Register handler for reconfig signals.
Definition: eloop.c:880
void eloop_unregister_event(void *event, size_t event_size)
Unregister handler for a generic event.
Definition: eloop_win.c:208
void eloop_unregister_sock(int sock, eloop_event_type type)
Unregister handler for socket events.
Definition: eloop.c:588
int eloop_register_signal_terminate(eloop_signal_handler handler, void *user_data)
Register handler for terminate signals.
Definition: eloop.c:870
void eloop_terminate(void)
Terminate event loop.
Definition: eloop.c:1052
Definition: eloop.c:64
Definition: os.h:22
int eloop_register_sock(int sock, eloop_event_type type, eloop_sock_handler handler, void *eloop_data, void *user_data)
Register handler for socket events.
Definition: eloop.c:575
int eloop_init(void)
Initialize global event loop data.
Definition: eloop.c:141
int eloop_cancel_timeout(eloop_timeout_handler handler, void *eloop_data, void *user_data)
Cancel timeouts.
Definition: eloop.c:657
int eloop_register_read_sock(int sock, eloop_sock_handler handler, void *eloop_data, void *user_data)
Register handler for read events.
Definition: eloop.c:546
void(* eloop_sock_handler)(int sock, void *eloop_ctx, void *sock_ctx)
eloop socket event callback type
Definition: eloop.h:40
int eloop_register_event(void *event, size_t event_size, eloop_event_handler handler, void *eloop_data, void *user_data)
Register handler for generic events.
Definition: eloop_win.c:179
int eloop_register_signal(int sig, eloop_signal_handler handler, void *user_data)
Register handler for signals.
Definition: eloop.c:848
void eloop_destroy(void)
Free any resources allocated for the event loop.
Definition: eloop.c:1058
int eloop_deplete_timeout(unsigned int req_secs, unsigned int req_usecs, eloop_timeout_handler handler, void *eloop_data, void *user_data)
Deplete a timeout that is already registered.
Definition: eloop.c:722
void(* eloop_event_handler)(void *eloop_data, void *user_ctx)
eloop generic event callback type
Definition: eloop.h:47
int eloop_cancel_timeout_one(eloop_timeout_handler handler, void *eloop_data, void *user_data, struct os_reltime *remaining)
Cancel a single timeout.
Definition: eloop.c:679
void(* eloop_signal_handler)(int sig, void *signal_ctx)
eloop signal event callback type
Definition: eloop.h:63
void eloop_wait_for_read_sock(int sock)
Wait for a single reader.
Definition: eloop.c:1105
eloop_event_type
eloop socket event type for eloop_register_sock()
Definition: eloop.h:28