pub struct IpAuthenticationHeader {
    pub next_header: u8,
    pub spi: u32,
    pub sequence_number: u32,
    /* private fields */
}
Expand description

IP Authentication Header (rfc4302)

Fields§

§next_header: u8

IP protocol number specifying the next header or transport layer protocol.

See IpNumber or ip_number for a definition of the known values.

§spi: u32

Security Parameters Index

§sequence_number: u32

This unsigned 32-bit field contains a counter value that increases by one for each packet sent.

Implementations§

Create a new authentication header with the given parameters.

Note: The length of the raw_icv slice must be a multiple of 4 and the maximum allowed length is 1016 bytes (IpAuthenticationHeader::MAX_ICV_LEN). If the slice length does not fullfill these requirements the value is not copied and an Err(ValueError::IpAuthenticationHeaderBadIcvLength) is returned. If successfull an Ok(()) is returned.

Read an authentication header from a slice and return the header & unused parts of the slice.

Read an authentication header from the current reader position.

Returns a slice the raw icv value.

Sets the icv value to the given raw value. The length of the slice must be a multiple of 4 and the maximum allowed length is 1016 bytes (IpAuthenticationHeader::MAX_ICV_LEN). If the slice length does not fullfill these requirements the value is not copied and an Err(ValueError::IpAuthenticationHeaderBadIcvLength) is returned. If successfull an Ok(()) is returned.

Writes the given authentication header to the current position.

Length of the header in bytes.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.