From: Amaury Denoyelle Date: Tue, 3 Nov 2020 16:10:00 +0000 (+0100) Subject: MINOR: ssl: instantiate stats module X-Git-Tag: v2.4-dev1~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9963fa74d2fabd288b285b17d414b258b37533c2;p=thirdparty%2Fhaproxy.git MINOR: ssl: instantiate stats module This module is responsible for providing statistics for ssl. It allocates counters for frontend/backend/listener/server objects. --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 6f28c4f4e7..bd95bdfbca 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include #include #include @@ -139,6 +139,35 @@ static BIO_METHOD *ha_meth; DECLARE_STATIC_POOL(ssl_sock_ctx_pool, "ssl_sock_ctx_pool", sizeof(struct ssl_sock_ctx)); +/* ssl stats module */ +enum { + SSL_ST_STATS_COUNT /* must be the last member of the enum */ +}; + +static struct name_desc ssl_stats[] = { +}; + +static struct ssl_counters { +} ssl_counters; + +static void ssl_fill_stats(void *data, struct field *stats) +{ + //struct ssl_counters *counters = data; +} + +static struct stats_module ssl_stats_module = { + .name = "ssl", + .fill_stats = ssl_fill_stats, + .stats = ssl_stats, + .stats_count = SSL_ST_STATS_COUNT, + .counters = &ssl_counters, + .counters_size = sizeof(ssl_counters), + .domain_flags = MK_STATS_PROXY_DOMAIN(STATS_PX_CAP_FE|STATS_PX_CAP_LI|STATS_PX_CAP_BE|STATS_PX_CAP_SRV), + .clearable = 1, +}; + +INITCALL1(STG_REGISTER, stats_register_module, &ssl_stats_module); + static struct task *ssl_sock_io_cb(struct task *, void *, unsigned short); static int ssl_sock_handshake(struct connection *conn, unsigned int flag);