Enum ExtensionType

Source
#[repr(u8)]
pub enum ExtensionType { ALPN = 1, Authority = 2, CRC32C = 3, NoOp = 4, UniqueId = 5, NetworkNamespace = 48, }
Expand description

Supported types for TypeLengthValue payloads.

Variants§

§

ALPN = 1

Application-Layer Protocol Negotiation (ALPN). It is a byte sequence defining the upper layer protocol in use over the connection. The most common use case will be to pass the exact copy of the ALPN extension of the Transport Layer Security (TLS) protocol as defined by RFC7301.

§

Authority = 2

Contains the host name value passed by the client, as an UTF8-encoded string. In case of TLS being used on the client connection, this is the exact copy of the “server_name” extension as defined by RFC3546, section 3.1, often referred to as “SNI”. There are probably other situations where an authority can be mentioned on a connection without TLS being involved at all.

§

CRC32C = 3

The value of the type PP2_TYPE_CRC32C is a 32-bit number storing the CRC32c checksum of the PROXY protocol header.

When the checksum is supported by the sender after constructing the header the sender MUST:

  • Initialize the checksum field to ’0’s.
  • Calculate the CRC32c checksum of the PROXY header as described in RFC4960, Appendix B.
  • Put the resultant value into the checksum field, and leave the rest of the bits unchanged.

If the checksum is provided as part of the PROXY header and the checksum functionality is supported by the receiver, the receiver MUST:

  • Store the received CRC32c checksum value aside.
  • Replace the 32 bits of the checksum field in the received PROXY header with all ’0’s and calculate a CRC32c checksum value of the whole PROXY header.
  • Verify that the calculated CRC32c checksum is the same as the received CRC32c checksum. If it is not, the receiver MUST treat the TCP connection providing the header as invalid.

The default procedure for handling an invalid TCP connection is to abort it.

§

NoOp = 4

The TLV of this type should be ignored when parsed. The value is zero or more bytes. Can be used for data padding or alignment. Note that it can be used to align only by 3 or more bytes because a TLV can not be smaller than that.

§

UniqueId = 5

The value of the type PP2_TYPE_UNIQUE_ID is an opaque byte sequence of up to 128 bytes generated by the upstream proxy that uniquely identifies the connection.

The unique ID can be used to easily correlate connections across multiple layers of proxies, without needing to look up IP addresses and port numbers.

§

NetworkNamespace = 48

The type PP2_TYPE_NETNS defines the value as the US-ASCII string representation of the namespace’s name.

Trait Implementations§

Source§

impl Clone for ExtensionType

Source§

fn clone(&self) -> ExtensionType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExtensionType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ExtensionType

Source§

fn eq(&self, other: &ExtensionType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ExtensionType

Source§

impl Eq for ExtensionType

Source§

impl StructuralPartialEq for ExtensionType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.