#include <netinet/in.h>
#include <common/config.h>
-#include <common/standard.h>
+#include <common/initcall.h>
#include <common/hathreads.h>
+#include <common/standard.h>
#include <types/listener.h>
#include <types/proxy.h>
void mworker_accept_wrapper(int fd);
+/* simplified way to declare static build options in a file */
+#define REGISTER_BUILD_OPTS(str) \
+ INITCALL2(STG_REGISTER, hap_register_build_opts, (str), 0)
+
#endif /* _TYPES_GLOBAL_H */
/*
#include <common/buffer.h>
#include <common/errors.h>
#include <common/initcall.h>
+#include <types/global.h>
#include <proto/arg.h>
#include <proto/http_fetch.h>
#include <proto/log.h>
__attribute__((constructor))
static void __51d_init(void)
{
- /* register sample fetch and conversion keywords */
- hap_register_build_opts("Built with 51Degrees support.", 0);
hap_register_post_check(init_51degrees);
hap_register_post_deinit(deinit_51degrees);
}
+
+REGISTER_BUILD_OPTS("Built with 51Degrees support.");
#include <common/config.h>
#include <common/errors.h>
#include <common/hathreads.h>
+#include <common/initcall.h>
#include <proto/acl.h>
#include <proto/log.h>
return NULL;
}
-__attribute__((constructor))
-static void __auth_init(void)
-{
- hap_register_build_opts("Encrypted password support via crypt(3): yes", 0);
-}
+REGISTER_BUILD_OPTS("Encrypted password support via crypt(3): yes");
__attribute__((constructor))
static void __comp_fetch_init(void)
{
- char *ptr = NULL;
- int i;
-
#ifdef USE_SLZ
slz_make_crc_table();
slz_prepare_dist_table();
#if defined(USE_ZLIB) && defined(DEFAULT_MAXZLIBMEM)
global.maxzlibmem = DEFAULT_MAXZLIBMEM * 1024U * 1024U;
#endif
+}
+
+static void comp_register_build_opts(void)
+{
+ char *ptr = NULL;
+ int i;
+
#ifdef USE_ZLIB
memprintf(&ptr, "Built with zlib version : " ZLIB_VERSION);
memprintf(&ptr, "%s\nRunning on zlib version : %s", ptr, zlibVersion());
hap_register_build_opts(ptr, 1);
}
+
+INITCALL0(STG_REGISTER, comp_register_build_opts);
#include <common/errors.h>
#include <common/http.h>
#include <common/initcall.h>
+#include <types/global.h>
#include <proto/arg.h>
#include <proto/http_fetch.h>
#include <proto/log.h>
__attribute__((constructor))
static void __da_init(void)
{
- /* register sample fetch and format conversion keywords */
- hap_register_build_opts("Built with DeviceAtlas support.", 0);
hap_register_post_check(init_deviceatlas);
hap_register_post_deinit(deinit_deviceatlas);
}
+
+REGISTER_BUILD_OPTS("Built with DeviceAtlas support.");
#include <common/cfgparse.h>
#include <common/hathreads.h>
#include <common/standard.h>
+#include <types/global.h>
#include <proto/fd.h>
#if defined(DEBUG_THREAD) || defined(DEBUG_FULL)
memset(lock_stats, 0, sizeof(lock_stats));
#endif
- hap_register_build_opts("Built with multi-threading support.", 0);
}
#endif // USE_THREAD
#endif
return nbthread;
}
+
+REGISTER_BUILD_OPTS("Built with multi-threading support.");
__attribute__((constructor))
static void __hlua_init(void)
+{
+ cfg_register_postparser("hlua", hlua_check_config);
+}
+
+static void hlua_register_build_options(void)
{
char *ptr = NULL;
+
memprintf(&ptr, "Built with Lua version : %s", LUA_RELEASE);
hap_register_build_opts(ptr, 1);
- cfg_register_postparser("hlua", hlua_check_config);
}
+
+INITCALL0(STG_REGISTER, hlua_register_build_options);
return sock;
}
-__attribute__((constructor))
-static void __ns_init(void)
-{
- hap_register_build_opts("Built with network namespace support.", 0);
-}
+REGISTER_BUILD_OPTS("Built with network namespace support.");
INITCALL1(STG_REGISTER, http_res_keywords_register, &http_res_actions);
-__attribute__((constructor))
-static void __tcp_protocol_init(void)
-{
- hap_register_build_opts("Built with transparent proxy support using:"
+REGISTER_BUILD_OPTS("Built with transparent proxy support using:"
#if defined(IP_TRANSPARENT)
- " IP_TRANSPARENT"
+ " IP_TRANSPARENT"
#endif
#if defined(IPV6_TRANSPARENT)
- " IPV6_TRANSPARENT"
+ " IPV6_TRANSPARENT"
#endif
#if defined(IP_FREEBIND)
- " IP_FREEBIND"
+ " IP_FREEBIND"
#endif
#if defined(IP_BINDANY)
- " IP_BINDANY"
+ " IP_BINDANY"
#endif
#if defined(IPV6_BINDANY)
- " IPV6_BINDANY"
+ " IPV6_BINDANY"
#endif
#if defined(SO_BINDANY)
- " SO_BINDANY"
+ " SO_BINDANY"
#endif
- "", 0);
-}
+ "");
/*
return 1;
}
-__attribute__((constructor))
-static void __regex_init(void)
+static void regex_register_build_options(void)
{
char *ptr = NULL;
hap_register_build_opts(ptr, 1);
}
+INITCALL0(STG_REGISTER, regex_register_build_options);
+
/*
* Local variables:
* c-indent-level: 8
__attribute__((constructor))
static void __ssl_sock_init(void)
{
- char *ptr;
- int i;
-
STACK_OF(SSL_COMP)* cm;
if (global_ssl.listen_default_ciphers)
hap_register_post_check(tlskeys_finalize_config);
#endif
- ptr = NULL;
+ global.ssl_session_max_cost = SSL_SESSION_MAX_COST;
+ global.ssl_handshake_max_cost = SSL_HANDSHAKE_MAX_COST;
+
+#ifndef OPENSSL_NO_DH
+ ssl_dh_ptr_index = SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL, NULL);
+ hap_register_post_deinit(ssl_free_dh);
+#endif
+#ifndef OPENSSL_NO_ENGINE
+ hap_register_post_deinit(ssl_free_engines);
+#endif
+ /* Load SSL string for the verbose & debug mode. */
+ ERR_load_SSL_strings();
+}
+
+/* Compute and register the version string */
+static void ssl_register_build_options()
+{
+ char *ptr = NULL;
+ int i;
+
memprintf(&ptr, "Built with OpenSSL version : "
#ifdef OPENSSL_IS_BORINGSSL
"BoringSSL");
memprintf(&ptr, "%s %s", ptr, methodVersions[i].name);
hap_register_build_opts(ptr, 1);
+}
- global.ssl_session_max_cost = SSL_SESSION_MAX_COST;
- global.ssl_handshake_max_cost = SSL_HANDSHAKE_MAX_COST;
+INITCALL0(STG_REGISTER, ssl_register_build_options);
-#ifndef OPENSSL_NO_DH
- ssl_dh_ptr_index = SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL, NULL);
- hap_register_post_deinit(ssl_free_dh);
-#endif
-#ifndef OPENSSL_NO_ENGINE
- hap_register_post_deinit(ssl_free_engines);
-#endif
- /* Load SSL string for the verbose & debug mode. */
- ERR_load_SSL_strings();
-}
#ifndef OPENSSL_NO_ENGINE
void ssl_free_engines(void) {
#include <common/buffer.h>
#include <common/errors.h>
#include <common/initcall.h>
+#include <types/global.h>
#include <proto/arg.h>
#include <proto/log.h>
#include <proto/proto_http.h>
__attribute__((constructor))
static void __wurfl_init(void)
{
- /* register sample fetch and format conversion keywords */
- hap_register_build_opts("Built with WURFL support.", 0);
hap_register_post_check(ha_wurfl_init);
hap_register_post_deinit(ha_wurfl_deinit);
}
ha_wurfl_log("WURFL: retrieve header request returns [%s]\n", ((ha_wurfl_header_t *)wh)->header_value);
return ((ha_wurfl_header_t *)wh)->header_value;
}
+
+REGISTER_BUILD_OPTS("Built with WURFL support.");