#[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 receivedCRC32c
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
impl Clone for ExtensionType
Source§fn clone(&self) -> ExtensionType
fn clone(&self) -> ExtensionType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more