GNRC's implementation of the UDP protocol.
More...
GNRC's implementation of the UDP protocol.
|
| file | udp.h |
| | UDP GNRC definition.
|
| |
◆ gnrc_udp_calc_csum()
Calculate the checksum for the given packet.
- Parameters
-
| [in] | hdr | Pointer to the UDP header |
| [in] | pseudo_hdr | Pointer to the network layer header |
- Returns
- 0 on success
-
-EBADMSG if
hdr is not of type GNRC_NETTYPE_UDP
-
-EFAULT if
hdr or pseudo_hdr is NULL
-
-ENOENT if gnrc_pktsnip_t::type of
pseudo_hdr is not known
◆ gnrc_udp_hdr_build()
Allocate and initialize a fresh UDP header in the packet buffer.
- Parameters
-
| [in] | payload | Payload contained in the UDP packet |
| [in] | src | Source port in host byte order |
| [in] | dst | Destination port in host byte order |
- Returns
- pointer to the newly created (and allocated) header
-
NULL on
src == NULL, dst == NULL, src_len != 2, dst_len != 2 or on allocation error
- Precondition
src > 0 and dst > 0
◆ gnrc_udp_init()
| int gnrc_udp_init |
( |
void |
| ) |
|
Initialize and start UDP.
- Returns
- PID of the UDP thread
-
negative value on error