• Home
  • Raw
  • Download

Lines Matching refs:rec_blocks

1223     if (lg_crcv->rec_blocks.used &&  in coap_request_missing_q_block2()
1224 (lg_crcv->rec_blocks.used < 2 || in coap_request_missing_q_block2()
1225 ((lg_crcv->rec_blocks.range[0].end + 1) / COAP_MAX_PAYLOADS(session) != in coap_request_missing_q_block2()
1226 (lg_crcv->rec_blocks.range[1].begin -1) / COAP_MAX_PAYLOADS(session)))) { in coap_request_missing_q_block2()
1227 block = lg_crcv->rec_blocks.range[0].end + 1; in coap_request_missing_q_block2()
1247 for (i = 0; i < lg_crcv->rec_blocks.used; i++) { in coap_request_missing_q_block2()
1248 if (block < (int)lg_crcv->rec_blocks.range[i].begin && in coap_request_missing_q_block2()
1249 lg_crcv->rec_blocks.range[i].begin != 0) { in coap_request_missing_q_block2()
1259 for (; block < (int)lg_crcv->rec_blocks.range[i].begin && in coap_request_missing_q_block2()
1267 if (block < (int)lg_crcv->rec_blocks.range[i].end) { in coap_request_missing_q_block2()
1268 block = lg_crcv->rec_blocks.range[i].end; in coap_request_missing_q_block2()
1295 lg_crcv->rec_blocks.retry++; in coap_request_missing_q_block2()
1297 lg_crcv->rec_blocks.processing_payload_set = block_payload_set; in coap_request_missing_q_block2()
1298 coap_ticks(&lg_crcv->rec_blocks.last_seen); in coap_request_missing_q_block2()
1330 if (p->block_option == COAP_OPTION_Q_BLOCK2 && p->rec_blocks.used) { in coap_block_check_lg_crcv_timeouts()
1332 ((size_t)1 << p->rec_blocks.retry); in coap_block_check_lg_crcv_timeouts()
1334 if (p->rec_blocks.retry >= COAP_NON_MAX_RETRANSMIT(session)) { in coap_block_check_lg_crcv_timeouts()
1342 if (p->rec_blocks.last_seen + scaled_timeout <= now) { in coap_block_check_lg_crcv_timeouts()
1345 if (*tim_rem > p->rec_blocks.last_seen + scaled_timeout - now) { in coap_block_check_lg_crcv_timeouts()
1346 *tim_rem = p->rec_blocks.last_seen + scaled_timeout - now; in coap_block_check_lg_crcv_timeouts()
1437 check_if_received_block(coap_rblock_t *rec_blocks, uint32_t block_num) { in check_if_received_block() argument
1440 for (i = 0; i < rec_blocks->used; i++) { in check_if_received_block()
1441 if (block_num < rec_blocks->range[i].begin) in check_if_received_block()
1443 if (block_num <= rec_blocks->range[i].end) in check_if_received_block()
1450 check_all_blocks_in(coap_rblock_t *rec_blocks, size_t total_blocks) { in check_all_blocks_in() argument
1454 for (i = 0; i < rec_blocks->used; i++) { in check_all_blocks_in()
1455 if (block < rec_blocks->range[i].begin) in check_all_blocks_in()
1457 if (block < rec_blocks->range[i].end) in check_all_blocks_in()
1458 block = rec_blocks->range[i].end; in check_all_blocks_in()
1471 coap_rblock_t *rec_blocks) { in check_all_blocks_in_for_payload_set() argument
1472 if (rec_blocks->used && in check_all_blocks_in_for_payload_set()
1473 (rec_blocks->range[0].end + 1) / COAP_MAX_PAYLOADS(session) > in check_all_blocks_in_for_payload_set()
1474 rec_blocks->processing_payload_set) in check_all_blocks_in_for_payload_set()
1481 coap_rblock_t *rec_blocks) { in check_any_blocks_next_payload_set() argument
1482 if (rec_blocks->used > 1 && in check_any_blocks_next_payload_set()
1483 rec_blocks->range[1].begin / COAP_MAX_PAYLOADS(session) == in check_any_blocks_next_payload_set()
1484 rec_blocks->processing_payload_set) in check_any_blocks_next_payload_set()
1520 if (p->block_option == COAP_OPTION_Q_BLOCK1 && p->rec_blocks.used) { in coap_block_check_lg_srcv_timeouts()
1522 ((size_t)1 << p->rec_blocks.retry); in coap_block_check_lg_srcv_timeouts()
1524 if (p->rec_blocks.retry >= COAP_NON_MAX_RETRANSMIT(session)) { in coap_block_check_lg_srcv_timeouts()
1528 if (p->rec_blocks.last_seen + scaled_timeout <= now) { in coap_block_check_lg_srcv_timeouts()
1539 for (i = 0; i < p->rec_blocks.used; i++) { in coap_block_check_lg_srcv_timeouts()
1540 if (block < (int)p->rec_blocks.range[i].begin && in coap_block_check_lg_srcv_timeouts()
1541 p->rec_blocks.range[i].begin != 0) { in coap_block_check_lg_srcv_timeouts()
1543 no_blocks += p->rec_blocks.range[i].begin - block; in coap_block_check_lg_srcv_timeouts()
1545 if (block < (int)p->rec_blocks.range[i].end) { in coap_block_check_lg_srcv_timeouts()
1546 block = p->rec_blocks.range[i].end; in coap_block_check_lg_srcv_timeouts()
1570 for (i = 0; i < p->rec_blocks.used; i++) { in coap_block_check_lg_srcv_timeouts()
1571 if (block < (int)p->rec_blocks.range[i].begin && in coap_block_check_lg_srcv_timeouts()
1572 p->rec_blocks.range[i].begin != 0) { in coap_block_check_lg_srcv_timeouts()
1580 for (; block < (int)p->rec_blocks.range[i].begin; block++) { in coap_block_check_lg_srcv_timeouts()
1586 if (block < (int)p->rec_blocks.range[i].end) { in coap_block_check_lg_srcv_timeouts()
1587 block = p->rec_blocks.range[i].end; in coap_block_check_lg_srcv_timeouts()
1603 p->rec_blocks.retry++; in coap_block_check_lg_srcv_timeouts()
1604 coap_ticks(&p->rec_blocks.last_seen); in coap_block_check_lg_srcv_timeouts()
1606 if (*tim_rem > p->rec_blocks.last_seen + scaled_timeout - now) { in coap_block_check_lg_srcv_timeouts()
1607 *tim_rem = p->rec_blocks.last_seen + scaled_timeout - now; in coap_block_check_lg_srcv_timeouts()
2513 update_received_blocks(coap_rblock_t *rec_blocks, uint32_t block_num) { in update_received_blocks() argument
2517 rec_blocks->retry = 0; in update_received_blocks()
2519 for (i = 0; i < rec_blocks->used; i++) { in update_received_blocks()
2520 if (block_num >= rec_blocks->range[i].begin && in update_received_blocks()
2521 block_num <= rec_blocks->range[i].end) in update_received_blocks()
2524 if (block_num < rec_blocks->range[i].begin) { in update_received_blocks()
2525 if (block_num + 1 == rec_blocks->range[i].begin) { in update_received_blocks()
2526 rec_blocks->range[i].begin = block_num; in update_received_blocks()
2529 if (rec_blocks->used == COAP_RBLOCK_CNT -1) in update_received_blocks()
2532 memmove(&rec_blocks->range[i+1], &rec_blocks->range[i], in update_received_blocks()
2533 (rec_blocks->used - i) * sizeof(rec_blocks->range[0])); in update_received_blocks()
2534 rec_blocks->range[i].begin = rec_blocks->range[i].end = block_num; in update_received_blocks()
2535 rec_blocks->used++; in update_received_blocks()
2539 if (block_num == rec_blocks->range[i].end + 1) { in update_received_blocks()
2540 rec_blocks->range[i].end = block_num; in update_received_blocks()
2541 if (i + 1 < rec_blocks->used) { in update_received_blocks()
2542 if (rec_blocks->range[i+1].begin == block_num + 1) { in update_received_blocks()
2544 rec_blocks->range[i].end = rec_blocks->range[i+1].end; in update_received_blocks()
2545 if (i+2 < rec_blocks->used) { in update_received_blocks()
2546 memmove(&rec_blocks->range[i+1], &rec_blocks->range[i+2], in update_received_blocks()
2547 (rec_blocks->used - (i+2)) * sizeof(rec_blocks->range[0])); in update_received_blocks()
2549 rec_blocks->used--; in update_received_blocks()
2555 if (i == rec_blocks->used) { in update_received_blocks()
2556 if (rec_blocks->used == COAP_RBLOCK_CNT -1) in update_received_blocks()
2559 rec_blocks->range[i].begin = rec_blocks->range[i].end = block_num; in update_received_blocks()
2560 rec_blocks->used++; in update_received_blocks()
2562 coap_ticks(&rec_blocks->last_seen); in update_received_blocks()
2738 if (!check_if_received_block(&p->rec_blocks, block.num)) { in coap_handle_request_put_block()
2740 if (!update_received_blocks(&p->rec_blocks, block.num)) { in coap_handle_request_put_block()
2755 p->rec_blocks.processing_payload_set = in coap_handle_request_put_block()
2769 !check_all_blocks_in(&p->rec_blocks, in coap_handle_request_put_block()
2777 if (check_all_blocks_in(&p->rec_blocks, in coap_handle_request_put_block()
2781 if (p->rec_blocks.used == 1 && in coap_handle_request_put_block()
2782 (p->rec_blocks.range[0].end % COAP_MAX_PAYLOADS(session)) + 1 in coap_handle_request_put_block()
2785 block.num = p->rec_blocks.range[0].end; in coap_handle_request_put_block()
3453 p->rec_blocks.used = 0; in coap_handle_response_get_block()
3455 p->rec_blocks.processing_payload_set = 0; in coap_handle_response_get_block()
3532 if (!check_if_received_block(&p->rec_blocks, block.num)) { in coap_handle_response_get_block()
3540 if (block_opt == COAP_OPTION_Q_BLOCK2 && p->rec_blocks.used && in coap_handle_response_get_block()
3541 this_payload_set > p->rec_blocks.processing_payload_set && in coap_handle_response_get_block()
3542 this_payload_set != p->rec_blocks.latest_payload_set) { in coap_handle_response_get_block()
3545 p->rec_blocks.latest_payload_set = this_payload_set; in coap_handle_response_get_block()
3548 if (!update_received_blocks(&p->rec_blocks, block.num)) { in coap_handle_response_get_block()
3572 if (block.m || !check_all_blocks_in(&p->rec_blocks, in coap_handle_response_get_block()
3583 if (check_all_blocks_in(&p->rec_blocks, in coap_handle_response_get_block()
3588 &p->rec_blocks)) { in coap_handle_response_get_block()
3589 block.num = p->rec_blocks.range[0].end; in coap_handle_response_get_block()
3591 p->rec_blocks.processing_payload_set = in coap_handle_response_get_block()
3594 &p->rec_blocks)) { in coap_handle_response_get_block()