[][src]Crate ppp

A Proxy Protocol Parser written in Rust using nom. Supports both text and binary versions of the header. A general function is provided to parse either version using a single call. When using the general function, performance depends almost entirely on the type of header.

Modules

error

The error type used by the parsers.

model

Types representing both text and binary versions of HAProxy's proxy protocol header.

Functions

parse_header

A parser that can handle both version 1 and version 2 of the proxy protocol header.

parse_v1_header

Parses a version 1 header of HAProxy's proxy protocol. Supports TCP with IPv4 and IPv6 addresses, as well as UNKNOWN address information.

parse_v2_header

Parse the first 16 bytes of the protocol header; the only required payload. The 12 byte signature and 4 bytes used to describe the connection and header information. The adress portion of the header, as denoted by the last 2 bytes of the required payload, must be present a header with invalid addresses or TLVs (Type-Length-Value) can be determined to be invalid.

to_bytes

Creates a String from a valid Version 1 header. See the protocol specification for the definition of valid text headers.

to_string

Creates a String from a valid Version 1 header. See the protocol specification for the definition of valid text headers.