PP2Tlvs

Enum PP2Tlvs 

Source
#[repr(u8)]
pub enum PP2Tlvs { TypeAlpn(Vec<Vec<u8>>), TypeAuthority(String), TypeCrc32c(u32), TypeNoop = 4, TypeUniqId(Vec<u8>), TypeSsl { client: PP2TlvClient, verify: u32, }, TypeSubtypeSslVersion(Cow<'static, str>), TypeSubtypeSslCn(Cow<'static, str>), TypeSubtypeSslCipher(Cow<'static, str>), TypeSubtypeSslSigAlg(Cow<'static, str>), TypeSubtypeSslKeyAlg(Cow<'static, str>), TypeNetNs(String), }
Expand description

Can be used for testing.

Variants§

§

TypeAlpn(Vec<Vec<u8>>)

Application-Layer Protocol Negotiation (ALPN).

§

TypeAuthority(String)

“SNI” i.e the “server_name” extension as defined by RFC3546 UTF8-encoded string

§

TypeCrc32c(u32)

32-bit number storing the CRC32c checksum of the PROXY protocol header

§

TypeNoop = 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.

§

TypeUniqId(Vec<u8>)

opaque byte sequence of up to 128 bytes generated by the upstream proxy that uniquely identifies the connection.

§

TypeSsl

SSL properties

Fields

§verify: u32
§

TypeSubtypeSslVersion(Cow<'static, str>)

US-ASCII string representation of the TLS version (format?)

§

TypeSubtypeSslCn(Cow<'static, str>)

In all cases, the string representation (in UTF8) of the Common Name field (OID: 2.5.4.3) of the client certificate’s Distinguished Name, is appended using the TLV format and the type PP2_SUBTYPE_SSL_CN. E.g. “example.com”.

§

TypeSubtypeSslCipher(Cow<'static, str>)

US-ASCII string name of the used cipher, for example “ECDHE-RSA-AES128-GCM-SHA256”.

§

TypeSubtypeSslSigAlg(Cow<'static, str>)

US-ASCII string name of the algorithm used to sign the certificate presented by the frontend when the incoming connection was made over an SSL/TLS transport layer, for example “SHA256”.

§

TypeSubtypeSslKeyAlg(Cow<'static, str>)

US-ASCII string name of the algorithm used to generate the key of the certificate presented by the frontend when the incoming connection was made over an SSL/TLS transport layer, for example “RSA2048”.

§

TypeNetNs(String)

US-ASCII string representation of the namespace’s name

Implementations§

Source§

impl PP2Tlvs

Source

pub const TLV_TYPE_MAIN_RANGES: &'static [RangeInclusive<u8>]

A constraints by range of all types.

Source

pub const TLV_TYPE_SSL_SUB_RANGE: &'static [RangeInclusive<u8>]

A constraints for the SSL subtypes.

Source

pub const TYPE_ALPN: u8 = 1u8

Source

pub const TYPE_AUTHORITY: u8 = 2u8

Source

pub const TYPE_CRC32C: u8 = 3u8

Source

pub const TYPE_NOOP: u8 = 4u8

Source

pub const TYPE_UNIQID: u8 = 5u8

Source

pub const TYPE_SSL: u8 = 32u8

Source

pub const TYPE_SUBTYPE_SSL_VERSION: u8 = 33u8

Source

pub const TYPE_SUBTYPE_SSL_CN: u8 = 34u8

Source

pub const TYPE_SUBTYPE_SSL_CIPHER: u8 = 35u8

Source

pub const TYPE_SUBTYPE_SSL_SIGALG: u8 = 36u8

Source

pub const TYPE_SUBTYPE_SSL_KEYALG: u8 = 37u8

Source

pub const TYPE_NETNS: u8 = 48u8

Source

pub fn contains_subtype(&self) -> bool

Source

pub fn conntains_subtype_discr(discr: u8) -> bool

Trait Implementations§

Source§

impl Clone for PP2Tlvs

Source§

fn clone(&self) -> PP2Tlvs

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 PP2Tlvs

Source§

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

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

impl Display for PP2Tlvs

Source§

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

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

impl From<&PP2Tlvs> for u8

Source§

fn from(value: &PP2Tlvs) -> Self

Converts to this type from the input type.
Source§

impl From<PP2Tlvs> for u8

Source§

fn from(value: PP2Tlvs) -> Self

Converts to this type from the input type.
Source§

impl PP2TlvDump for PP2Tlvs

Source§

fn get_type(&self) -> u8

Returns the type number of the TLV.
Source§

fn dump(&self, cur: &mut Cursor<Vec<u8>>) -> HaProxRes<()>

Writes the content of the instance to the TLV’s payload. It must NOT write the TLV header, it is written before and after. Read more
Source§

impl PP2TlvRestore for PP2Tlvs

Implementation of the PP2TlvRestore for the build-in protocol PP2Tlvs items.

Source§

fn contains_subtype(&self) -> bool

Should return true if the current instance contains subtypes.
Source§

fn is_in_range(tlv_type: u8, tlv_parent_type: Option<u8>) -> bool

Checks if the current TLV is in range of the tlv_parent_type parent. If tlv_parent_type is None then the tlv_type can be checked against the main range. The tlv_parent_type is set when the current tlv_type is a subset of the parent. Read more
Source§

fn restore(tlv_type: u8, cur: &mut Cursor<&[u8]>) -> HaProxRes<Self>
where Self: Sized,

A function which is called when the parsing reaches the TLV’s payload. The cursor is poiniting to the beginning of the payload and the inner buffer is a slice from the main buffer of size of the TLV’s payload. Read more
Source§

impl PartialEq for PP2Tlvs

Source§

fn eq(&self, other: &PP2Tlvs) -> 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 Eq for PP2Tlvs

Source§

impl StructuralPartialEq for PP2Tlvs

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.