Loading...
Searching...
No Matches
sock_types.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
21
22#include "mbox.h"
23#include "net/af.h"
24#ifdef SOCK_HAS_ASYNC
26#endif
27#include "net/sock/udp.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
40#ifndef CONFIG_OPENWSN_SOCK_MBOX_SIZE_EXP
41#define CONFIG_OPENWSN_SOCK_MBOX_SIZE_EXP (3)
42#endif
43
47#ifndef OPENWSN_SOCK_MBOX_SIZE
48#define OPENWSN_SOCK_MBOX_SIZE (1 << CONFIG_OPENWSN_SOCK_MBOX_SIZE_EXP)
49#endif
50
56
68
75struct sock_udp {
76 struct sock_udp *next;
80#ifdef MODULE_SOCK_ASYNC_EVENT
81 sock_async_ctx_t async_ctx;
82#endif
83#ifdef SOCK_HAS_ASYNC
84 sock_udp_cb_t async_cb;
85 void* async_cb_arg;
86#endif
87};
88
89#ifdef __cplusplus
90}
91#endif
92
Global UNIX address family definitions.
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
struct _sock_tl_ep sock_udp_ep_t
An end point for a UDP sock object.
Definition udp.h:292
struct openwsn_gen_sock openwsn_gen_sock_t
Forward declaration.
Definition sock_types.h:55
#define OPENWSN_SOCK_MBOX_SIZE
Size for OpenWSN sock_udp_t::mbox_queue.
Definition sock_types.h:48
Mailbox API.
UDP sock definitions.
Mailbox struct definition.
Definition mbox.h:38
Describes a message object which can be sent between threads.
Definition msg.h:193
Generic openwsn sock type.
Definition sock_types.h:63
sock_udp_ep_t local
local end-point
Definition sock_types.h:64
sock_udp_ep_t remote
remote end-point
Definition sock_types.h:65
uint16_t flags
option flags
Definition sock_types.h:66
Asynchronous context for Asynchronous sock with event API.
UDP sock type.
Definition sock_types.h:125
openwsn_gen_sock_t gen_sock
Generic socket.
Definition sock_types.h:77
mbox_t mbox
Mailboxes target for the sock
Definition sock_types.h:78
struct sock_udp * next
sock liked list
Definition sock_types.h:76
msg_t mbox_queue[OPENWSN_SOCK_MBOX_SIZE]
queue for gnrc_sock_reg_t::mbox
Definition sock_types.h:79
Definitions for sock extension for asynchronous access.