sock_async_ctx.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 
18 #ifndef SOCK_ASYNC_CTX_H
19 #define SOCK_ASYNC_CTX_H
20 
21 #include "event.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
30 typedef union {
34  void (*generic)(void *, sock_async_flags_t, void *);
35 #ifdef MODULE_SOCK_DTLS
36  sock_dtls_cb_t dtls;
37 #endif
38 #ifdef MODULE_SOCK_IP
39  sock_ip_cb_t ip;
40 #endif
41 #ifdef MODULE_SOCK_TCP
42  sock_tcp_cb_t tcp;
43  sock_tcp_queue_cb_t tcp_queue;
44 #endif
45 #ifdef MODULE_SOCK_UDP
46  sock_udp_cb_t udp;
47 #endif
49 
53 typedef struct {
56  void *sock;
57  void *cb_arg;
59 } sock_event_t;
60 
64 typedef struct {
68 
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* SOCK_ASYNC_CTX_H */
75 
sock_async_ctx_t::event
sock_event_t event
event storage
Definition: sock_async_ctx.h:65
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_event_t::sock
void * sock
generic pointer to a Sock API object
Definition: sock_async_ctx.h:56
event
event structure
Definition: event.h:142
event_queue_t
event queue structure
Definition: event.h:150
sock_event_t::super
event_t super
event structure that gets extended
Definition: sock_async_ctx.h:54
sock_async_ctx_t
Asynchronous context for Asynchronous sock with event API.
Definition: sock_async_ctx.h:64
sock_async_ctx_t::queue
event_queue_t * queue
event queue to post socket events to
Definition: sock_async_ctx.h:66
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_event_t
Event definition for context scope.
Definition: sock_async_ctx.h:53
sock_event_t::cb
sock_event_cb_t cb
callback
Definition: sock_async_ctx.h:55
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_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
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_event_t::cb_arg
void * cb_arg
callback argument
Definition: sock_async_ctx.h:57
sock_async_flags_t
sock_async_flags_t
Flag types to signify asynchronous sock events.
Definition: types.h:37
sock_event_cb_t
Generalized callback type.
Definition: sock_async_ctx.h:30
sock_event_t::type
sock_async_flags_t type
types of the event
Definition: sock_async_ctx.h:58