UDPHeader


C Specification

#include <dolphin/ip.h>

#define UDP_HLEN    8

typedef struct UDPHeader
{
    u16 src;    // source port number
    u16 dst;    // destination port number
    u16 len;    // length
    u16 sum;    // check sum
} UDPHeader;

Description

In a UDP datagram, the UDP header follows the IP header, supplying information specific to the UDP protocol..

A UDP datagram is encapsulated in an IP datagram as shown below:

IP header

UDP header

UDP data

See Also

Postel, J. B., 1981 "User Datagram Protocol", RFC 768 (Aug.).