Loading...
Searching...
No Matches
sock_types.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Inria
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
9#pragma once
10
24
25#include "mbox.h"
26#include "net/af.h"
27#ifdef SOCK_HAS_ASYNC
29#endif
30#include "net/sock/udp.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
43#ifndef CONFIG_OPENWSN_SOCK_MBOX_SIZE_EXP
44#define CONFIG_OPENWSN_SOCK_MBOX_SIZE_EXP (3)
45#endif
46
50#ifndef OPENWSN_SOCK_MBOX_SIZE
51#define OPENWSN_SOCK_MBOX_SIZE (1 << CONFIG_OPENWSN_SOCK_MBOX_SIZE_EXP)
52#endif
53
59
71
78struct sock_udp {
79 struct sock_udp *next;
83#ifdef MODULE_SOCK_ASYNC_EVENT
84 sock_async_ctx_t async_ctx;
85#endif
86#ifdef SOCK_HAS_ASYNC
87 sock_udp_cb_t async_cb;
88 void* async_cb_arg;
89#endif
90};
91
92#ifdef __cplusplus
93}
94#endif
95
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:157
struct _sock_tl_ep sock_udp_ep_t
An end point for a UDP sock object.
Definition udp.h:295
struct openwsn_gen_sock openwsn_gen_sock_t
Forward declaration.
Definition sock_types.h:58
#define OPENWSN_SOCK_MBOX_SIZE
Size for OpenWSN sock_udp_t::mbox_queue.
Definition sock_types.h:51
Mailbox API.
UDP sock definitions.
Mailbox struct definition.
Definition mbox.h:40
Describes a message object which can be sent between threads.
Definition msg.h:195
Generic openwsn sock type.
Definition sock_types.h:66
sock_udp_ep_t local
local end-point
Definition sock_types.h:67
sock_udp_ep_t remote
remote end-point
Definition sock_types.h:68
uint16_t flags
option flags
Definition sock_types.h:69
Asynchronous context for Asynchronous sock with event API.
UDP sock type.
Definition sock_types.h:128
openwsn_gen_sock_t gen_sock
Generic socket.
Definition sock_types.h:80
mbox_t mbox
Mailboxes target for the sock
Definition sock_types.h:81
struct sock_udp * next
sock liked list
Definition sock_types.h:79
msg_t mbox_queue[OPENWSN_SOCK_MBOX_SIZE]
queue for gnrc_sock_reg_t::mbox
Definition sock_types.h:82
Definitions for sock extension for asynchronous access.