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 
168 #ifndef NET_SOCK_ASYNC_EVENT_H
169 #define NET_SOCK_ASYNC_EVENT_H
170 
171 #include "event.h"
172 /* guard required since `sock_dtls_types.h` might not be provided */
173 #ifdef MODULE_SOCK_DTLS
174 #include "net/sock/dtls.h"
175 #endif /* MODULE_SOCK_DTLS */
176 #include "net/sock/ip.h"
177 #include "net/sock/tcp.h"
178 #include "net/sock/udp.h"
179 #include "net/sock/async.h"
180 
181 #ifdef __cplusplus
182 extern "C" {
183 #endif
184 
185 /* guard required since `sock_dtls_types.h` might not be provided */
186 #if defined(MODULE_SOCK_DTLS) || defined(DOXYGEN)
200  sock_dtls_cb_t handler, void *handler_arg);
201 
210 #endif /* defined(MODULE_SOCK_DTLS) || defined(DOXYGEN) */
211 
212 #if defined(MODULE_SOCK_IP) || defined(DOXYGEN)
226  sock_ip_cb_t handler, void *handler_arg);
227 
236 #endif /* defined(MODULE_SOCK_IP) || defined(DOXYGEN) */
237 
238 #if defined(MODULE_SOCK_TCP) || defined(DOXYGEN)
252  sock_tcp_cb_t handler, void *handler_arg);
253 
262 
276  sock_tcp_queue_cb_t handler, void *handler_arg);
277 #endif /* defined(MODULE_SOCK_TCP) || defined(DOXYGEN) */
278 
279 #if defined(MODULE_SOCK_UDP) || defined(DOXYGEN)
293  sock_udp_cb_t handler, void *handler_arg);
294 
303 
304 #endif /* defined(MODULE_SOCK_UDP) || defined(DOXYGEN) */
305 
315 
316 #ifdef __cplusplus
317 }
318 #endif
319 
320 #endif /* NET_SOCK_ASYNC_EVENT_H */
Definitions for sock extension for asynchronous access.
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.
void sock_dtls_event_close(sock_dtls_t *sock)
Close a possibly async DTLS socket.
void sock_event_close(sock_async_ctx_t *async_ctx)
clear any pending socket async events
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.
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.
void sock_tcp_event_close(sock_tcp_t *sock)
Close a possibly async TCP socket.
void sock_udp_event_close(sock_udp_t *sock)
Close a possibly async UDP socket.
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.
void sock_ip_event_close(sock_ip_t *sock)
Close a possibly async IP socket.
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.
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
void(* sock_udp_cb_t)(sock_udp_t *sock, sock_async_flags_t flags, void *arg)
Event callback for sock_udp_t.
Definition: types.h:157
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
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
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
Raw IPv4/IPv6 sock definitions.
Asynchronous sock using Event Queue definitions.
DTLS sock definitions.
TCP sock definitions.
UDP sock definitions.
event queue structure
Definition: event.h:156
Asynchronous context for Asynchronous sock with event API.
Information about DTLS sock.
Raw IP sock type.
Definition: sock_types.h:91
TCP queue type.
Definition: sock_types.h:114
TCP sock type.
Definition: sock_types.h:101
UDP sock type.
Definition: sock_types.h:128