Loading...
Searching...
No Matches
sock_types.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Martine Lenders <mlenders@inf.fu-berlin.de>
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
22#ifndef SOCK_TYPES_H
23#define SOCK_TYPES_H
24
25#include <stdbool.h>
26#include <stdint.h>
27
28#include "mbox.h"
29#include "net/af.h"
30#include "net/gnrc.h"
31#if IS_USED(MODULE_GNRC_TCP)
32#include "net/gnrc/tcp.h"
33#endif
34#include "net/gnrc/netreg.h"
35#ifdef SOCK_HAS_ASYNC
37#endif
38#include "net/sock/ip.h"
39#include "net/sock/udp.h"
40#include "net/sock/tcp.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
58#ifndef CONFIG_GNRC_SOCK_MBOX_SIZE_EXP
59#define CONFIG_GNRC_SOCK_MBOX_SIZE_EXP (3)
60#endif
66#ifndef GNRC_SOCK_MBOX_SIZE
67#define GNRC_SOCK_MBOX_SIZE (1 << CONFIG_GNRC_SOCK_MBOX_SIZE_EXP)
68#endif
69
75
76#ifdef SOCK_HAS_ASYNC
81typedef void (*gnrc_sock_reg_cb_t)(gnrc_sock_reg_t *sock,
83 void *arg);
84#endif /* SOCK_HAS_ASYNC */
85
91#ifdef MODULE_GNRC_SOCK_CHECK_REUSE
92 struct gnrc_sock_reg *next;
93#endif
97#ifdef SOCK_HAS_ASYNC
98 gnrc_netreg_entry_cbd_t netreg_cb;
105 union {
106 gnrc_sock_reg_cb_t generic;
107#ifdef MODULE_SOCK_IP
108 sock_ip_cb_t ip;
109#endif
110#ifdef MODULE_SOCK_UDP
111 sock_udp_cb_t udp;
112#endif
113 } async_cb;
114 void *async_cb_arg;
115#ifdef SOCK_HAS_ASYNC_CTX
116 sock_async_ctx_t async_ctx;
117#endif
118#endif /* SOCK_HAS_ASYNC */
119};
120
125struct sock_ip {
129 uint16_t flags;
130};
131
136struct sock_udp {
140 uint16_t flags;
141};
142
143#ifdef __cplusplus
144}
145#endif
146
147#endif /* SOCK_TYPES_H */
Global UNIX address family definitions.
GNRC TCP API.
Includes all essential GNRC network stack base modules.
#define GNRC_SOCK_MBOX_SIZE
Size for gnrc_sock_reg_t::mbox_queue.
Definition sock_types.h:67
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
sock_async_flags_t
Flag types to signify asynchronous sock events.
Definition types.h:37
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
Raw IPv4/IPv6 sock definitions.
Mailbox API.
Definitions to register network protocol PIDs to use with GNRC communication interface.
TCP sock definitions.
UDP sock definitions.
Common IP-based transport layer end point.
Definition sock.h:215
Callback + Context descriptor.
Definition netreg.h:158
Entry to the Network protocol registry.
Definition netreg.h:167
sock Network protocol registry info
Definition sock_types.h:90
msg_t mbox_queue[GNRC_SOCK_MBOX_SIZE]
queue for gnrc_sock_reg_t::mbox
Definition sock_types.h:96
gnrc_netreg_entry_t entry
Network protocol registry entry for mbox
Definition sock_types.h:94
mbox_t mbox
Mailboxes target for the sock
Definition sock_types.h:95
Mailbox struct definition.
Definition mbox.h:41
Describes a message object which can be sent between threads.
Definition msg.h:196
Asynchronous context for Asynchronous sock with event API.
Abstract IP end point and end point for a raw IP sock object.
Definition sock.h:178
Raw IP sock type.
Definition sock_types.h:91
uint16_t flags
option flags
Definition sock_types.h:129
gnrc_sock_reg_t reg
netreg info
Definition sock_types.h:126
sock_ip_ep_t local
local end-point
Definition sock_types.h:127
sock_ip_ep_t remote
remote end-point
Definition sock_types.h:128
UDP sock type.
Definition sock_types.h:128
gnrc_sock_reg_t reg
netreg info
Definition sock_types.h:137
sock_udp_ep_t remote
remote end-point
Definition sock_types.h:139
sock_udp_ep_t local
local end-point
Definition sock_types.h:138
uint16_t flags
option flags
Definition sock_types.h:140
Definitions for sock extension for asynchronous access.