From: William Lallemand Date: Mon, 23 Dec 2024 09:58:56 +0000 (+0100) Subject: MINOR: ssl: change visibility of ssl_stats_module X-Git-Tag: v3.2-dev2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e6af9723333709ce604007f294848c8926ac851;p=thirdparty%2Fhaproxy.git MINOR: ssl: change visibility of ssl_stats_module In order to add stats from other files, the ssl_stats_module need to be visible from other files. This moves the ssl_counters definition in ssl_sock-t.h and removes the static of ssl_stats_module. --- diff --git a/include/haproxy/ssl_sock-t.h b/include/haproxy/ssl_sock-t.h index f864595f75..410a789a16 100644 --- a/include/haproxy/ssl_sock-t.h +++ b/include/haproxy/ssl_sock-t.h @@ -327,5 +327,11 @@ extern const char *SSL_SOCK_KEYTYPE_NAMES[]; extern struct pool_head *ssl_sock_client_sni_pool; +struct ssl_counters { + long long sess; + long long reused_sess; + long long failed_handshake; +}; + #endif /* USE_OPENSSL */ #endif /* _HAPROXY_SSL_SOCK_T_H */ diff --git a/include/haproxy/ssl_sock.h b/include/haproxy/ssl_sock.h index b4a7e3af9d..bd32ef2f90 100644 --- a/include/haproxy/ssl_sock.h +++ b/include/haproxy/ssl_sock.h @@ -54,6 +54,7 @@ extern int ssl_client_sni_index; extern struct pool_head *pool_head_ssl_keylog; extern struct pool_head *pool_head_ssl_keylog_str; extern struct list openssl_providers; +extern struct stats_module ssl_stats_module; int ssl_sock_prep_ctx_and_inst(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_conf, SSL_CTX *ctx, struct ckch_inst *ckch_inst, char **err); diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 7e8603a4b0..45d34b246c 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -169,11 +169,7 @@ static struct stat_col ssl_stats[] = { .desc = "Total number of failed handshake" }, }; -static struct ssl_counters { - long long sess; - long long reused_sess; - long long failed_handshake; -} ssl_counters; +static struct ssl_counters ssl_counters; static int ssl_fill_stats(void *data, struct field *stats, unsigned int *selected_field) { @@ -208,7 +204,7 @@ static int ssl_fill_stats(void *data, struct field *stats, unsigned int *selecte return 1; } -static struct stats_module ssl_stats_module = { +struct stats_module ssl_stats_module = { .name = "ssl", .fill_stats = ssl_fill_stats, .stats = ssl_stats,