udp.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include <stdint.h>
22 
23 #include "byteorder.h"
24 #include "net/gnrc.h"
25 #include "net/udp.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
43 #ifndef CONFIG_GNRC_UDP_MSG_QUEUE_SIZE_EXP
44 #define CONFIG_GNRC_UDP_MSG_QUEUE_SIZE_EXP (3U)
45 #endif
46 
50 #ifndef GNRC_UDP_PRIO
51 #define GNRC_UDP_PRIO (THREAD_PRIORITY_MAIN - 2)
52 #endif
53 
61 #ifndef GNRC_UDP_STACK_SIZE
62 #define GNRC_UDP_STACK_SIZE ((THREAD_STACKSIZE_SMALL) - 64)
63 #endif
69 #ifndef GNRC_UDP_MSG_QUEUE_SIZE
70 #define GNRC_UDP_MSG_QUEUE_SIZE (1 << CONFIG_GNRC_UDP_MSG_QUEUE_SIZE_EXP)
71 #endif
72 
85 
100  uint16_t dst);
101 
108 int gnrc_udp_init(void);
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
Functions to work with different byte orders.
Includes all essential GNRC network stack base modules.
gnrc_pktsnip_t * gnrc_udp_hdr_build(gnrc_pktsnip_t *payload, uint16_t src, uint16_t dst)
Allocate and initialize a fresh UDP header in the packet buffer.
int gnrc_udp_calc_csum(gnrc_pktsnip_t *hdr, gnrc_pktsnip_t *pseudo_hdr)
Calculate the checksum for the given packet.
int gnrc_udp_init(void)
Initialize and start UDP.
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:105
UDP header and helper functions definition.