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 
9 #pragma once
10 
173 #include "event.h"
174 /* guard required since `sock_dtls_types.h` might not be provided */
175 #ifdef MODULE_SOCK_DTLS
176 #include "net/sock/dtls.h"
177 #endif /* MODULE_SOCK_DTLS */
178 #include "net/sock/ip.h"
179 #include "net/sock/tcp.h"
180 #include "net/sock/udp.h"
181 #include "net/sock/async.h"
182 
183 #ifdef __cplusplus
184 extern "C" {
185 #endif
186 
187 /* guard required since `sock_dtls_types.h` might not be provided */
188 #if defined(MODULE_SOCK_DTLS) || defined(DOXYGEN)
202  sock_dtls_cb_t handler, void *handler_arg);
203 
212 #endif /* defined(MODULE_SOCK_DTLS) || defined(DOXYGEN) */
213 
214 #if defined(MODULE_SOCK_IP) || defined(DOXYGEN)
228  sock_ip_cb_t handler, void *handler_arg);
229 
238 #endif /* defined(MODULE_SOCK_IP) || defined(DOXYGEN) */
239 
240 #if defined(MODULE_SOCK_TCP) || defined(DOXYGEN)
254  sock_tcp_cb_t handler, void *handler_arg);
255 
264 
278  sock_tcp_queue_cb_t handler, void *handler_arg);
279 #endif /* defined(MODULE_SOCK_TCP) || defined(DOXYGEN) */
280 
281 #if defined(MODULE_SOCK_UDP) || defined(DOXYGEN)
295  sock_udp_cb_t handler, void *handler_arg);
296 
305 
306 #endif /* defined(MODULE_SOCK_UDP) || defined(DOXYGEN) */
307 
317 
318 #ifdef __cplusplus
319 }
320 #endif
321 
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:153
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