From b1f34862c3ab93eb40d31b5878273dc8d86f0958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?= Date: Thu, 30 Nov 2023 15:17:14 +0100 Subject: [PATCH] Put _hash functions out of SRTP_NO_STREAM_LIST block _hash methods are an internal, agnostic to _list implementation. --- srtp/srtp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/srtp/srtp.c b/srtp/srtp.c index f0a4f6886..fe7502095 100644 --- a/srtp/srtp.c +++ b/srtp/srtp.c @@ -4838,6 +4838,12 @@ srtp_err_status_t srtp_get_stream_roc(srtp_t session, return srtp_err_status_ok; } +#define SRTP_STREAM_HASH_SIZE 32 + +struct srtp_stream_hash_t_ { + srtp_stream_list_t *list; +} srtp_stream_hash_t_; + #ifndef SRTP_NO_STREAM_LIST /* in the default implementation, we have an intrusive doubly-linked list */ @@ -4847,12 +4853,6 @@ typedef struct srtp_stream_list_ctx_t_ { srtp_stream_ctx_t data; } srtp_stream_list_ctx_t_; -#define SRTP_STREAM_HASH_SIZE 32 - -struct srtp_stream_hash_t_ { - srtp_stream_list_t *list; -} srtp_stream_hash_t_; - srtp_err_status_t srtp_stream_list_alloc(srtp_stream_list_t *list_ptr) { srtp_stream_list_t list = @@ -4931,6 +4931,8 @@ void srtp_stream_list_for_each(srtp_stream_list_t list, } } +#endif + srtp_err_status_t srtp_stream_hash_alloc(srtp_stream_hash_t *hash_ptr) { srtp_stream_hash_t hash = srtp_crypto_alloc(sizeof(srtp_stream_hash_t_)); @@ -5019,5 +5021,3 @@ void srtp_stream_hash_for_each(srtp_stream_hash_t hash, srtp_stream_list_for_each(list, callback, data); } } - -#endif