gnrc/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 GNRC_UDP_H
23 #define 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 
38 #ifndef GNRC_UDP_MSG_QUEUE_SIZE
39 #define GNRC_UDP_MSG_QUEUE_SIZE (8U)
40 #endif
41 
45 #ifndef GNRC_UDP_PRIO
46 #define GNRC_UDP_PRIO (THREAD_PRIORITY_MAIN - 2)
47 #endif
48 
52 #ifndef GNRC_UDP_STACK_SIZE
53 #define GNRC_UDP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
54 #endif
55 
67 int gnrc_udp_calc_csum(gnrc_pktsnip_t *hdr, gnrc_pktsnip_t *pseudo_hdr);
68 
80 gnrc_pktsnip_t *gnrc_udp_hdr_build(gnrc_pktsnip_t *payload, uint16_t src,
81  uint16_t dst);
82 
89 int gnrc_udp_init(void);
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* GNRC_UDP_H */
96 
int gnrc_udp_init(void)
Initialize and start UDP.
int gnrc_udp_calc_csum(gnrc_pktsnip_t *hdr, gnrc_pktsnip_t *pseudo_hdr)
Calculate the checksum for the given packet.
Includes all essential GNRC network stack base modules.
Functions to work with different byte orders.
Type to represent parts (either headers or payload) of a packet, called snips.
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.
UDP header and helper functions definition.