udp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 
22 #ifndef NET_GNRC_UDP_H
23 #define NET_GNRC_UDP_H
24 
25 #include <stdint.h>
26 
27 #include "byteorder.h"
28 #include "net/gnrc.h"
29 #include "net/udp.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
47 #ifndef CONFIG_GNRC_UDP_MSG_QUEUE_SIZE_EXP
48 #define CONFIG_GNRC_UDP_MSG_QUEUE_SIZE_EXP (3U)
49 #endif
50 
54 #ifndef GNRC_UDP_PRIO
55 #define GNRC_UDP_PRIO (THREAD_PRIORITY_MAIN - 2)
56 #endif
57 
61 #ifndef GNRC_UDP_STACK_SIZE
62 #define GNRC_UDP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
63 #endif
64 
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 
84 int gnrc_udp_calc_csum(gnrc_pktsnip_t *hdr, gnrc_pktsnip_t *pseudo_hdr);
85 
99 gnrc_pktsnip_t *gnrc_udp_hdr_build(gnrc_pktsnip_t *payload, uint16_t src,
100  uint16_t dst);
101 
108 int gnrc_udp_init(void);
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif /* NET_GNRC_UDP_H */
115 
gnrc.h
Includes all essential GNRC network stack base modules.
byteorder.h
Functions to work with different byte orders.
gnrc_udp_init
int gnrc_udp_init(void)
Initialize and start UDP.
gnrc_udp_hdr_build
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.
gnrc_udp_calc_csum
int gnrc_udp_calc_csum(gnrc_pktsnip_t *hdr, gnrc_pktsnip_t *pseudo_hdr)
Calculate the checksum for the given packet.
udp.h
UDP header and helper functions definition.
gnrc_pktsnip
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:108