User datagram header. More...
#include <udp_header.h>
Data Fields | |
uint16_t | source_port |
Source Port is an optional field, when meaningful, it indicates the port of the sending process, and may be assumed to be the port to which a reply should be addressed in the absence of any other information. | |
uint16_t | destination_port |
Destination port has a meaning within the context of a particular internet destination address. | |
uint16_t | total_length |
Length is the length in octets of this user datagram including this header and the data. | |
uint16_t | checksum |
Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets. |
User datagram header.
uint16_t udp_header::checksum |
Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.
The pseudo header conceptually prefixed to the UDP header contains the source address, the destination address, the protocol, and the UDP length. This information gives protection against misrouted datagrams. If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic). An all zero transmitted checksum value means that the transmitter generated no checksum (for debugging or for higher level protocols that don't care).
Referenced by udp_process_packet(), and udp_sendto_message().
uint16_t udp_header::destination_port |
Destination port has a meaning within the context of a particular internet destination address.
Referenced by udp_process_packet(), and udp_sendto_message().
uint16_t udp_header::source_port |
Source Port is an optional field, when meaningful, it indicates the port of the sending process, and may be assumed to be the port to which a reply should be addressed in the absence of any other information.
If not used, a value of zero is inserted.
Referenced by udp_recvfrom_message(), and udp_sendto_message().
uint16_t udp_header::total_length |
Length is the length in octets of this user datagram including this header and the data.
This means the minimum value of the length is eight.
Referenced by udp_process_packet(), and udp_sendto_message().