| 76 | } |
| 77 | |
| 78 | int is_net_proxy_protocol(char *buf, int size) |
| 79 | { |
| 80 | if (size < PROXY_PROTOCOL_V1_HDR_LEN) |
| 81 | return -1; /* don't know yet */ |
| 82 | if (memcmp(buf, PROXY_PROTOCOL_V1_HDR, PROXY_PROTOCOL_V1_HDR_LEN)) |
| 83 | return 0; |
| 84 | /* TODO: support v2 as well? */ |
| 85 | return 1; |
| 86 | } |
| 87 | |
| 88 | static int build_proxy_protocol_v1_hdr(const struct ip_addr *src_ip, |
| 89 | unsigned short src_port, const struct ip_addr *dst_ip, |
no outgoing calls
no test coverage detected