src/core/ngx_proxy_protocol.h - nginx source code

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Roman Arutyunyan
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #ifndef _NGX_PROXY_PROTOCOL_H_INCLUDED_
  6. #define _NGX_PROXY_PROTOCOL_H_INCLUDED_


  7. #include <ngx_config.h>
  8. #include <ngx_core.h>


  9. #define NGX_PROXY_PROTOCOL_V1_MAX_HEADER  107
  10. #define NGX_PROXY_PROTOCOL_MAX_HEADER     4096


  11. struct ngx_proxy_protocol_s {
  12.     ngx_str_t           src_addr;
  13.     ngx_str_t           dst_addr;
  14.     in_port_t           src_port;
  15.     in_port_t           dst_port;
  16.     ngx_str_t           tlvs;
  17. };


  18. u_char *ngx_proxy_protocol_read(ngx_connection_t *c, u_char *buf,
  19.     u_char *last);
  20. u_char *ngx_proxy_protocol_write(ngx_connection_t *c, u_char *buf,
  21.     u_char *last);
  22. ngx_int_t ngx_proxy_protocol_get_tlv(ngx_connection_t *c, ngx_str_t *name,
  23.     ngx_str_t *value);


  24. #endif /* _NGX_PROXY_PROTOCOL_H_INCLUDED_ */