Skip to content

Commit

Permalink
loxilb-io/loxilb#675 Initial support for proxy protocol v2
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed Nov 24, 2024
1 parent a3edc2f commit 9a33276
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions common/parsing_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,27 @@ struct sctp_cookie {
__be32 cookie;
};

struct proxy_hdr_v2 {
__u8 sig[12]; /* hex 0D 0A 0D 0A 00 0D 0A 51 55 49 54 0A */
__u8 ver_cmd; /* protocol version and command */
__u8 family; /* protocol family and address */
__be16 len; /* number of following bytes part of the header */
};

struct proxy_ipv4_hdr { /* for TCP/UDP over IPv4, len = 12 */
__be32 src_addr;
__be32 dst_addr;
__be16 src_port;
__be16 dst_port;
};

struct proxy_ipv6_hdr { /* for TCP/UDP over IPv4, len = 36 */
__u8 src_addr[16];
__u8 dst_addr[16];
__be16 src_port;
__be16 dst_port;
};

struct mkrt_args {
uint32_t seq;
uint8_t fin:1;
Expand Down

0 comments on commit 9a33276

Please sign in to comment.