event.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
170 #include "event.h"
171 /* guard required since `sock_dtls_types.h` might not be provided */
172 #ifdef MODULE_SOCK_DTLS
173 #include "net/sock/dtls.h"
174 #endif /* MODULE_SOCK_DTLS */
175 #include "net/sock/ip.h"
176 #include "net/sock/tcp.h"
177 #include "net/sock/udp.h"
178 #include "net/sock/async.h"
179 
180 #ifdef __cplusplus
181 extern "C" {
182 #endif
183 
184 /* guard required since `sock_dtls_types.h` might not be provided */
185 #if defined(MODULE_SOCK_DTLS) || defined(DOXYGEN)
199  sock_dtls_cb_t handler, void *handler_arg);
200 
209 #endif /* defined(MODULE_SOCK_DTLS) || defined(DOXYGEN) */
210 
211 #if defined(MODULE_SOCK_IP) || defined(DOXYGEN)
225  sock_ip_cb_t handler, void *handler_arg);
226 
235 #endif /* defined(MODULE_SOCK_IP) || defined(DOXYGEN) */
236 
237 #if defined(MODULE_SOCK_TCP) || defined(DOXYGEN)
251  sock_tcp_cb_t handler, void *handler_arg);
252 
261 
275  sock_tcp_queue_cb_t handler, void *handler_arg);
276 #endif /* defined(MODULE_SOCK_TCP) || defined(DOXYGEN) */
277 
278 #if defined(MODULE_SOCK_UDP) || defined(DOXYGEN)
292  sock_udp_cb_t handler, void *handler_arg);
293 
302 
303 #endif /* defined(MODULE_SOCK_UDP) || defined(DOXYGEN) */
304 
314 
315 #ifdef __cplusplus
316 }
317 #endif
318 
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:130
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:154
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:114
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:88
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:65
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:150
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