async.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 
23 #include "net/sock/async/types.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #if defined(SOCK_HAS_ASYNC) || defined(DOXYGEN)
30 #if defined(MODULE_SOCK_DTLS) || defined(DOXYGEN)
31 
48  sock_dtls_session_t *session);
49 
64 void sock_dtls_set_cb(sock_dtls_t *sock, sock_dtls_cb_t cb, void *cb_arg);
65 #endif /* defined(MODULE_SOCK_DTLS) || defined(DOXYGEN) */
66 
67 #if defined(MODULE_SOCK_IP) || defined(DOXYGEN)
82 void sock_ip_set_cb(sock_ip_t *sock, sock_ip_cb_t cb, void *cb_arg);
83 #endif /* defined(MODULE_SOCK_IP) || defined(DOXYGEN) */
84 
85 #if defined(MODULE_SOCK_TCP) || defined(DOXYGEN)
100 void sock_tcp_set_cb(sock_tcp_t *sock, sock_tcp_cb_t cb, void *cb_arg);
101 
117  void *cb_arg);
118 #endif /* defined(MODULE_SOCK_TCP) || defined(DOXYGEN) */
119 
120 #if defined(MODULE_SOCK_UDP) || defined(DOXYGEN)
135 void sock_udp_set_cb(sock_udp_t *sock, sock_udp_cb_t cb, void *cb_arg);
136 #endif /* defined(MODULE_SOCK_UDP) || defined(DOXYGEN) */
137 
138 #if defined(SOCK_HAS_ASYNC_CTX) || defined(DOXYGEN)
139 #include "sock_async_ctx.h" /* defines sock_async_ctx_t */
140 
141 #if defined(MODULE_SOCK_DTLS) || defined(DOXYGEN)
157 #endif /* defined(MODULE_SOCK_DTLS) || defined(DOXYGEN) */
158 
159 #if defined(MODULE_SOCK_IP) || defined(DOXYGEN)
175 #endif /* defined(MODULE_SOCK_IP) || defined(DOXYGEN) */
176 
177 #if defined(MODULE_SOCK_TCP) || defined(DOXYGEN)
193 
209 #endif /* defined(MODULE_SOCK_TCP) || defined(DOXYGEN) */
210 
211 #if defined(MODULE_SOCK_UDP) || defined(DOXYGEN)
227 #endif /* defined(MODULE_SOCK_UDP) || defined(DOXYGEN) */
228 #endif /* defined(SOCK_HAS_ASYNC_CTX) || defined(DOXYGEN) */
229 #endif /* defined(SOCK_HAS_ASYNC) || defined(DOXYGEN) */
230 
231 #ifdef __cplusplus
232 }
233 #endif
234 
sock_async_ctx_t * sock_tcp_queue_get_async_ctx(sock_tcp_queue_t *queue)
Gets the asynchronous event context from TCP listening queue.
void sock_udp_set_cb(sock_udp_t *sock, sock_udp_cb_t cb, void *cb_arg)
Gets the asynchronous event context from sock object.
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_queue_set_cb(sock_tcp_queue_t *queue, sock_tcp_queue_cb_t cb, void *cb_arg)
Sets event callback for sock_tcp_queue_t.
void sock_dtls_set_cb(sock_dtls_t *sock, sock_dtls_cb_t cb, void *cb_arg)
Sets the asynchronous event context from sock object.
void sock_ip_set_cb(sock_ip_t *sock, sock_ip_cb_t cb, void *cb_arg)
Sets event callback for sock_ip_t.
void sock_tcp_set_cb(sock_tcp_t *sock, sock_tcp_cb_t cb, void *cb_arg)
Sets event callback for sock_tcp_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: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
sock_async_ctx_t * sock_dtls_get_async_ctx(sock_dtls_t *sock)
Gets the asynchronous event context from sock object.
sock_async_ctx_t * sock_udp_get_async_ctx(sock_udp_t *sock)
Gets the asynchronous event context from sock object.
bool sock_dtls_get_event_session(sock_dtls_t *sock, sock_dtls_session_t *session)
Gets the asynchronous event session from sock object.
sock_async_ctx_t * sock_ip_get_async_ctx(sock_ip_t *sock)
Gets the asynchronous event context from sock object.
sock_async_ctx_t * sock_tcp_get_async_ctx(sock_tcp_t *sock)
Gets the asynchronous event context from sock object.
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
Type definitions for asynchronous socks with Event Queue.
Asynchronous context for Asynchronous sock with event API.
Information about remote client connected to the server.
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
Definitions for sock extension for asynchronous access.