CLEANUP: tcp: use the build options list to report transparent modes

This removes 6 #ifdef from haproxy.c.
This commit is contained in:
Willy Tarreau 2016-12-21 18:55:02 +01:00
parent dba5002c4c
commit ba96291600
2 changed files with 22 additions and 23 deletions

View File

@ -431,29 +431,6 @@ static void display_build_opts()
printf("Built without Lua support\n"); printf("Built without Lua support\n");
#endif #endif
#if defined(CONFIG_HAP_TRANSPARENT)
printf("Built with transparent proxy support using:"
#if defined(IP_TRANSPARENT)
" IP_TRANSPARENT"
#endif
#if defined(IPV6_TRANSPARENT)
" IPV6_TRANSPARENT"
#endif
#if defined(IP_FREEBIND)
" IP_FREEBIND"
#endif
#if defined(IP_BINDANY)
" IP_BINDANY"
#endif
#if defined(IPV6_BINDANY)
" IPV6_BINDANY"
#endif
#if defined(SO_BINDANY)
" SO_BINDANY"
#endif
"\n");
#endif
list_for_each_entry(item, &build_opts_list, list) { list_for_each_entry(item, &build_opts_list, list) {
puts(item->str); puts(item->str);
} }

View File

@ -1875,6 +1875,28 @@ static void __tcp_protocol_init(void)
tcp_res_cont_keywords_register(&tcp_res_cont_actions); tcp_res_cont_keywords_register(&tcp_res_cont_actions);
http_req_keywords_register(&http_req_actions); http_req_keywords_register(&http_req_actions);
http_res_keywords_register(&http_res_actions); http_res_keywords_register(&http_res_actions);
hap_register_build_opts("Built with transparent proxy support using:"
#if defined(IP_TRANSPARENT)
" IP_TRANSPARENT"
#endif
#if defined(IPV6_TRANSPARENT)
" IPV6_TRANSPARENT"
#endif
#if defined(IP_FREEBIND)
" IP_FREEBIND"
#endif
#if defined(IP_BINDANY)
" IP_BINDANY"
#endif
#if defined(IPV6_BINDANY)
" IPV6_BINDANY"
#endif
#if defined(SO_BINDANY)
" SO_BINDANY"
#endif
"", 0);
} }