Lines Matching refs:rdbx

175 srtp_err_status_t srtp_rdbx_init(srtp_rdbx_t *rdbx, unsigned long ws)  in srtp_rdbx_init()  argument
181 if (bitvector_alloc(&rdbx->bitmask, ws) != 0) { in srtp_rdbx_init()
185 srtp_index_init(&rdbx->index); in srtp_rdbx_init()
193 srtp_err_status_t srtp_rdbx_dealloc(srtp_rdbx_t *rdbx) in srtp_rdbx_dealloc() argument
195 bitvector_dealloc(&rdbx->bitmask); in srtp_rdbx_dealloc()
207 srtp_err_status_t srtp_rdbx_set_roc(srtp_rdbx_t *rdbx, uint32_t roc) in srtp_rdbx_set_roc() argument
209 bitvector_set_to_zero(&rdbx->bitmask); in srtp_rdbx_set_roc()
216 if (roc < (rdbx->index >> 16)) { in srtp_rdbx_set_roc()
220 rdbx->index &= 0xffff; /* retain lowest 16 bits */ in srtp_rdbx_set_roc()
221 rdbx->index |= ((uint64_t)roc) << 16; /* set ROC */ in srtp_rdbx_set_roc()
232 srtp_xtd_seq_num_t srtp_rdbx_get_packet_index(const srtp_rdbx_t *rdbx) in srtp_rdbx_get_packet_index() argument
234 return rdbx->index; in srtp_rdbx_get_packet_index()
242 unsigned long srtp_rdbx_get_window_size(const srtp_rdbx_t *rdbx) in srtp_rdbx_get_window_size() argument
244 return bitvector_get_length(&rdbx->bitmask); in srtp_rdbx_get_window_size()
251 srtp_err_status_t srtp_rdbx_check(const srtp_rdbx_t *rdbx, int delta) in srtp_rdbx_check() argument
255 } else if ((int)(bitvector_get_length(&rdbx->bitmask) - 1) + delta < 0) { in srtp_rdbx_check()
259 &rdbx->bitmask, in srtp_rdbx_check()
260 (int)(bitvector_get_length(&rdbx->bitmask) - 1) + delta) == in srtp_rdbx_check()
278 srtp_err_status_t srtp_rdbx_add_index(srtp_rdbx_t *rdbx, int delta) in srtp_rdbx_add_index() argument
282 srtp_index_advance(&rdbx->index, delta); in srtp_rdbx_add_index()
283 bitvector_left_shift(&rdbx->bitmask, delta); in srtp_rdbx_add_index()
284 bitvector_set_bit(&rdbx->bitmask, in srtp_rdbx_add_index()
285 bitvector_get_length(&rdbx->bitmask) - 1); in srtp_rdbx_add_index()
288 bitvector_set_bit(&rdbx->bitmask, in srtp_rdbx_add_index()
289 bitvector_get_length(&rdbx->bitmask) - 1 + delta); in srtp_rdbx_add_index()
305 int32_t srtp_rdbx_estimate_index(const srtp_rdbx_t *rdbx, in srtp_rdbx_estimate_index() argument
319 if (high32(rdbx->index) > 0 || low32(rdbx->index) > seq_num_median) in srtp_rdbx_estimate_index()
321 if (rdbx->index > seq_num_median) in srtp_rdbx_estimate_index()
324 return srtp_index_guess(&rdbx->index, guess, s); in srtp_rdbx_estimate_index()
334 return s - (uint16_t)low32(rdbx->index); in srtp_rdbx_estimate_index()
336 return s - (uint16_t)rdbx->index; in srtp_rdbx_estimate_index()
346 uint32_t srtp_rdbx_get_roc(const srtp_rdbx_t *rdbx) in srtp_rdbx_get_roc() argument
351 roc = ((high32(rdbx->index) << 16) | (low32(rdbx->index) >> 16)); in srtp_rdbx_get_roc()
353 roc = (uint32_t)(rdbx->index >> 16); in srtp_rdbx_get_roc()
366 srtp_err_status_t srtp_rdbx_set_roc_seq(srtp_rdbx_t *rdbx, in srtp_rdbx_set_roc_seq() argument
375 if (roc < (rdbx->index >> 16)) { in srtp_rdbx_set_roc_seq()
379 rdbx->index = seq; in srtp_rdbx_set_roc_seq()
380 rdbx->index |= ((uint64_t)roc) << 16; /* set ROC */ in srtp_rdbx_set_roc_seq()
383 bitvector_set_to_zero(&rdbx->bitmask); in srtp_rdbx_set_roc_seq()