This file contains PROXY protocol functions. More...
Functions | |
int | pp2_write_to_buf (struct sldns_buffer *buf, struct sockaddr_storage *src, int stream) |
Write a PROXYv2 header at the current position of the buffer. More... | |
struct pp2_header * | pp2_read_header (struct sldns_buffer *buf) |
Read a PROXYv2 header from the current position of the buffer. More... | |
This file contains PROXY protocol functions.
int pp2_write_to_buf | ( | struct sldns_buffer * | buf, |
struct sockaddr_storage * | src, | ||
int | stream | ||
) |
Write a PROXYv2 header at the current position of the buffer.
buf | the buffer to write to. |
src | the source address. |
stream | if the protocol is stream or datagram. |
References PP2_HEADER_SIZE, PP2_SIG, sldns_buffer_remaining(), and sldns_buffer_write().
struct pp2_header* pp2_read_header | ( | struct sldns_buffer * | buf | ) |
Read a PROXYv2 header from the current position of the buffer.
It does initial validation and returns a pointer to the buffer position on success.
buf | the buffer to read from. |
References log_err(), PP2_HEADER_SIZE, PP2_SIG, sldns_buffer_begin(), and sldns_buffer_remaining().
Referenced by comm_point_tcp_handle_read(), consume_pp2_header(), and ssl_handle_read().