Home | History | Annotate | Download | only in replay

Lines Matching refs:rdbx

2  * rdbx.c
46 #include "rdbx.h"
66 * rdbx implementation notes
185 * rdbx
195 rdbx_init(rdbx_t *rdbx, unsigned long ws) {
199 if (bitvector_alloc(&rdbx->bitmask, ws) != 0)
202 index_init(&rdbx->index);
212 rdbx_uninit(rdbx_t *rdbx) {
213 bitvector_dealloc(&rdbx->bitmask);
219 * rdbx_set_roc(rdbx, roc) initalizes the rdbx_t at the location rdbx
227 rdbx_set_roc(rdbx_t *rdbx, uint32_t roc) {
228 bitvector_set_to_zero(&rdbx->bitmask);
235 if (roc < (rdbx->index >> 16))
238 rdbx->index &= 0xffff; /* retain lowest 16 bits */
239 rdbx->index |= ((uint64_t)roc) << 16; /* set ROC */
246 * rdbx_get_packet_index(rdbx) returns the value of the packet index
247 * for the rdbx_t pointed to by rdbx
252 rdbx_get_packet_index(const rdbx_t *rdbx) {
253 return rdbx->index;
257 * rdbx_get_window_size(rdbx) returns the value of the window size
258 * for the rdbx_t pointed to by rdbx
263 rdbx_get_window_size(const rdbx_t *rdbx) {
264 return bitvector_get_length(&rdbx->bitmask);
269 * which is at rdbx->index + delta is in the rdb
273 rdbx_check(const rdbx_t *rdbx, int delta) {
277 } else if ((int)(bitvector_get_length(&rdbx->bitmask) - 1) + delta < 0) {
280 } else if (bitvector_get_bit(&rdbx->bitmask,
281 (int)(bitvector_get_length(&rdbx->bitmask) - 1) + delta) == 1) {
291 * rdbx_add_index adds the xtd_seq_num_t at rdbx->window_start + d to
295 * indicated that the index does not appear in the rdbx, e.g., a mutex
296 * should protect the rdbx between these calls if need be
300 rdbx_add_index(rdbx_t *rdbx, int delta) {
304 index_advance(&rdbx->index, delta);
305 bitvector_left_shift(&rdbx->bitmask, delta);
306 bitvector_set_bit(&rdbx->bitmask, bitvector_get_length(&rdbx->bitmask) - 1);
309 bitvector_set_bit(&rdbx->bitmask, -delta);
320 * rdbx_estimate_index(rdbx, guess, s)
322 * given an rdbx and a sequence number s (from a newly arrived packet),
329 rdbx_estimate_index(const rdbx_t *rdbx,
334 * if the sequence number and rollover counter in the rdbx are
343 if (high32(rdbx->index) > 0 ||
344 low32(rdbx->index) > seq_num_median)
346 if (rdbx->index > seq_num_median)
348 return index_guess(&rdbx->index, guess, s);
357 return s - (uint16_t) low32(rdbx->index);
359 return s - (uint16_t) rdbx->index;