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]

[src]

Returns an udp header for the given parameters

[src]

Calculate an udp header given an ipv4 header and the payload

[src]

Calculates the upd header checksum based on a ipv4 header.

[src]

Calculates the upd header checksum based on a ipv4 header.

[src]

Calculate an udp header given an ipv6 header and the payload

[src]

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

[src]

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

[src]

Tries to read an udp header from the current position.

[src]

Write the udp header without recalculating the checksum or length.

Trait Implementations

impl Clone for UdpHeader
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for UdpHeader
[src]

[src]

Formats the value using the given formatter. Read more

impl Eq for UdpHeader
[src]

impl PartialEq for UdpHeader
[src]

[src]

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

[src]

This method tests for !=.

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