This file contains PROXY protocol functions. More...
#include "util/proxy_protocol.h"Data Structures | |
| struct | proxy_protocol_data | 
| Internal struct initialized with function pointers for writing uint16 and uint32.  More... | |
| struct | proxy_protocol_lookup_table | 
| Internal lookup table; could be further generic like sldns_lookup_table for all the future generic stuff.  More... | |
Functions | |
| void | pp_init (void(*write_uint16)(void *buf, uint16_t data), void(*write_uint32)(void *buf, uint32_t data)) | 
| Initialize the internal proxy structure.   | |
| const char * | pp_lookup_error (enum pp_parse_errors error) | 
| Lookup the parsing error description.   | |
| size_t | pp2_write_to_buf (uint8_t *buf, size_t buflen, struct sockaddr_in *src, int stream) | 
| Write a PROXYv2 header at the current position of the buffer.   | |
| int | pp2_read_header (uint8_t *buf, size_t buflen) | 
| Read a PROXYv2 header from the current position of the buffer.   | |
Variables | |
| struct proxy_protocol_data | pp_data | 
| static struct proxy_protocol_lookup_table | pp_parse_errors_data [] | 
| Internal parsing error text; could be exposed with pp_lookup_error.   | |
This file contains PROXY protocol functions.
| void pp_init | ( | void(*)(void *buf, uint16_t data) | write_uint16, | 
| void(*)(void *buf, uint32_t data) | write_uint32 | ||
| ) | 
Initialize the internal proxy structure.
| write_uint16 | pointer to a function that can write uint16. | 
| write_uint32 | pointer to a function that can write uint32. | 
Referenced by libworker_setup(), main(), and worker_init().
| const char * pp_lookup_error | ( | enum pp_parse_errors | error | ) | 
Lookup the parsing error description.
| error | parsing error from pp2_read_header. | 
References error(), and pp_parse_errors_data.
Referenced by comm_point_tcp_handle_read(), and ssl_handle_read().
| size_t pp2_write_to_buf | ( | uint8_t * | buf, | 
| size_t | buflen, | ||
| struct sockaddr_in * | src, | ||
| int | stream | ||
| ) | 
Write a PROXYv2 header at the current position of the buffer.
| buf | pointer to the buffer to write data to. | 
| buflen | available size on the buffer. | 
| src | the source address. | 
| stream | if the protocol is stream or datagram. | 
References PP2_HEADER_SIZE, PP2_SIG, and PP2_VERSION.
| int pp2_read_header | ( | uint8_t * | buf, | 
| size_t | buflen | ||
| ) | 
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 | pointer to the buffer data to read from. | 
| buflen | available size on the buffer. | 
References PP2_HEADER_SIZE, PP2_SIG, and PP2_VERSION.
Referenced by comm_point_tcp_handle_read(), consume_pp2_header(), and ssl_handle_read().
      
  | 
  static | 
Internal parsing error text; could be exposed with pp_lookup_error.
Referenced by pp_lookup_error().