event.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
161 #ifndef NET_SOCK_ASYNC_EVENT_H
162 #define NET_SOCK_ASYNC_EVENT_H
163 
164 #include "event.h"
165 /* guard required since `sock_dtls_types.h` might not be provided */
166 #ifdef MODULE_SOCK_DTLS
167 #include "net/sock/dtls.h"
168 #endif /* MODULE_SOCK_DTLS */
169 #include "net/sock/ip.h"
170 #include "net/sock/tcp.h"
171 #include "net/sock/udp.h"
172 #include "net/sock/async.h"
173 
174 #ifdef __cplusplus
175 extern "C" {
176 #endif
177 
178 /* guard required since `sock_dtls_types.h` might not be provided */
179 #if defined(MODULE_SOCK_DTLS) || defined(DOXYGEN)
180 
192 void sock_dtls_event_init(sock_dtls_t *sock, event_queue_t *ev_queue,
193  sock_dtls_cb_t handler, void *handler_arg);
194 #endif /* defined(MODULE_SOCK_DTLS) || defined(DOXYGEN) */
195 
196 #if defined(MODULE_SOCK_IP) || defined(DOXYGEN)
197 
209 void sock_ip_event_init(sock_ip_t *sock, event_queue_t *ev_queue,
210  sock_ip_cb_t handler, void *handler_arg);
211 #endif /* defined(MODULE_SOCK_IP) || defined(DOXYGEN) */
212 
213 #if defined(MODULE_SOCK_TCP) || defined(DOXYGEN)
214 
226 void sock_tcp_event_init(sock_tcp_t *sock, event_queue_t *ev_queue,
227  sock_tcp_cb_t handler, void *handler_arg);
228 
242  sock_tcp_queue_cb_t handler, void *handler_arg);
243 #endif /* defined(MODULE_SOCK_TCP) || defined(DOXYGEN) */
244 
245 #if defined(MODULE_SOCK_UDP) || defined(DOXYGEN)
246 
258 void sock_udp_event_init(sock_udp_t *sock, event_queue_t *ev_queue,
259  sock_udp_cb_t handler, void *handler_arg);
260 #endif /* defined(MODULE_SOCK_UDP) || defined(DOXYGEN) */
261 
262 #ifdef __cplusplus
263 }
264 #endif
265 
266 #endif /* NET_SOCK_ASYNC_EVENT_H */
267 
sock_ip_cb_t
void(* sock_ip_cb_t)(sock_ip_t *sock, sock_async_flags_t flags, void *arg)
Event callback for sock_ip_t.
Definition: types.h:91
sock_ip
Raw IP sock type.
Definition: sock_types.h:91
udp.h
UDP sock definitions.
async.h
Definitions for sock extension for asynchronous access.
tcp.h
TCP sock definitions.
event_queue_t
event queue structure
Definition: event.h:150
sock_ip_event_init
void sock_ip_event_init(sock_ip_t *sock, event_queue_t *ev_queue, sock_ip_cb_t handler, void *handler_arg)
Makes a raw IPv4/IPv6 sock able to handle asynchronous events using Event Queue.
sock_dtls
Information about DTLS sock.
Definition: sock_dtls_types.h:40
dtls.h
DTLS sock definitions.
sock_udp
UDP sock type.
Definition: sock_types.h:128
sock_tcp_cb_t
void(* sock_tcp_cb_t)(sock_tcp_t *sock, sock_async_flags_t flags, void *arg)
Event callback for sock_tcp_t.
Definition: types.h:117
sock_tcp_queue
TCP queue type.
Definition: sock_types.h:114
sock_dtls_cb_t
void(* sock_dtls_cb_t)(sock_dtls_t *sock, sock_async_flags_t flags, void *arg)
Event callback for sock_dtls_t.
Definition: types.h:68
sock_udp_event_init
void sock_udp_event_init(sock_udp_t *sock, event_queue_t *ev_queue, sock_udp_cb_t handler, void *handler_arg)
Makes a UDP sock able to handle asynchronous events using Event Queue.
ip.h
Raw IPv4/IPv6 sock definitions.
sock_udp_cb_t
void(* sock_udp_cb_t)(sock_udp_t *sock, sock_async_flags_t type, void *arg)
Event callback for sock_udp_t.
Definition: types.h:157
event.h
Asynchronous sock using Event Queue definitions.
sock_tcp_queue_event_init
void sock_tcp_queue_event_init(sock_tcp_queue_t *queue, event_queue_t *ev_queue, sock_tcp_queue_cb_t handler, void *handler_arg)
Makes a TCP listening queue able to handle asynchronous events using Event Queue.
sock_dtls_event_init
void sock_dtls_event_init(sock_dtls_t *sock, event_queue_t *ev_queue, sock_dtls_cb_t handler, void *handler_arg)
Makes a DTLS sock able to handle asynchronous events using Event Queue.
sock_tcp_event_init
void sock_tcp_event_init(sock_tcp_t *sock, event_queue_t *ev_queue, sock_tcp_cb_t handler, void *handler_arg)
Makes a TCP sock able to handle asynchronous events using Event Queue.
sock_tcp_queue_cb_t
void(* sock_tcp_queue_cb_t)(sock_tcp_queue_t *queue, sock_async_flags_t flags, void *arg)
Event callback for sock_tcp_queue_t.
Definition: types.h:133
sock_tcp
TCP sock type.
Definition: sock_types.h:101