Skip to content

Commit

Permalink
Put _hash functions out of SRTP_NO_STREAM_LIST block
Browse files Browse the repository at this point in the history
_hash methods are an internal, agnostic to _list implementation.
  • Loading branch information
jmillan committed Nov 30, 2023
1 parent 9a24b4a commit b1f3486
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions srtp/srtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 =
Expand Down Expand Up @@ -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_));
Expand Down Expand Up @@ -5019,5 +5021,3 @@ void srtp_stream_hash_for_each(srtp_stream_hash_t hash,
srtp_stream_list_for_each(list, callback, data);
}
}

#endif

0 comments on commit b1f3486

Please sign in to comment.