#[repr(packed)]
pub struct Ipv4Prefix { /* private fields */ }
Expand description

An IPv4 prefix is the payload PDU for route origin authorisation in IPv4.

Implementations

The payload type of an IPv4 prefix.

Creates a new IPv4 prefix from all the various fields.

Returns the flags field of the prefix.

The only flag currently used is the least significant but that is 1 for an announcement and 0 for a withdrawal.

Returns the prefix length.

Returns the max length.

Returns the prefix as IPv4 address.

Returns the autonomous system number.

Writes a value to a writer.

Returns the value of the version field of the header.

Returns the value of the session field of the header.

Note that this field is used for other purposes in some PDU types.

Returns the PDU size.

The size is returned as a u32 since that type is used in the header.

Reads a value from a reader.

If a value with a different PDU type is received, returns an error.

Tries to read a value from a reader.

If a different PDU type is received, returns the header as the error case of the ok case.

Reads only the payload part of a value from a reader.

Assuming that the header was already read and is passed via header, the function reads the rest of the PUD from the reader and returns the complete value.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Returns the “default value” for a type. 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 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.