|
ginnOS
The reference: libc, the libraries and the kernel
|
UDP (RFC 768): datagrams between ports. More...
#include "ipv4.h"Go to the source code of this file.
Macros | |
| #define | UDP_HEADER_SIZE 8 |
Functions | |
| void | udp_receive (netif_t *netif, const ipv4_header_t *ip, const uint8_t *datagram, uint32_t length) |
| a received UDP datagram (net_lock held): checks it and gives it to the socket for its port, or answers "port unreachable". | |
| bool | udp_send (uint32_t source, uint16_t source_port, uint32_t dst, uint16_t dst_port, uint8_t *datagram, uint32_t length) |
| send a datagram (net_lock held). | |
UDP (RFC 768): datagrams between ports.
| #define UDP_HEADER_SIZE 8 |
| void udp_receive | ( | netif_t * | netif, |
| const ipv4_header_t * | ip, | ||
| const uint8_t * | datagram, | ||
| uint32_t | length ) |
a received UDP datagram (net_lock held): checks it and gives it to the socket for its port, or answers "port unreachable".
| bool udp_send | ( | uint32_t | source, |
| uint16_t | source_port, | ||
| uint32_t | dst, | ||
| uint16_t | dst_port, | ||
| uint8_t * | datagram, | ||
| uint32_t | length ) |
send a datagram (net_lock held).
the first UDP_HEADER_SIZE bytes of datagram are the room for the header, which this fills in.
| source | the source address, or 0 for the address of the interface the datagram goes out on. |
| length | the length with the header. |