Struct etherparse::UdpHeader[][src]

pub struct UdpHeader {
    pub source_port: u16,
    pub destination_port: u16,
    pub length: u16,
    pub checksum: u16,
}

Udp header according to rfc768.

Fields

Source port of the packet (optional).

Destination port of the packet.

Length of the packet (includes the udp header length of 8 bytes).

The checksum of the packet. The checksum is calculated from a pseudo header, the udp header and the payload. The pseudo header is composed of source and destination address, protocol number

Methods

impl UdpHeader
[src]

Returns an udp header for the given parameters

Calculate an udp header given an ipv4 header and the payload

Calculates the upd header checksum based on a ipv4 header.

Calculates the upd header checksum based on a ipv4 header.

Calculate an udp header given an ipv6 header and the payload

Calculates the checksum of the current udp header given an ipv6 header and the payload.

Calculates the checksum of the current udp header given an ipv6 source & destination address plus the payload.

Tries to read an udp header from the current position.

Write the udp header without recalculating the checksum or length.

Trait Implementations

impl Clone for UdpHeader
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for UdpHeader
[src]

Formats the value using the given formatter. Read more

impl Eq for UdpHeader
[src]

impl PartialEq for UdpHeader
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for UdpHeader
[src]

Returns the "default value" for a type. Read more

impl SerializedSize for UdpHeader
[src]

SERIALIZED_SIZE: usize = 8

Size of the header itself

Auto Trait Implementations

impl Send for UdpHeader

impl Sync for UdpHeader