Lines Matching refs:chk

58 	struct sctp_tmit_chunk *chk;  in sctp_audit_retranmission_queue()  local
65 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_audit_retranmission_queue()
66 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
71 TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
72 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
76 TAILQ_FOREACH(chk, &asoc->asconf_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
77 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
438 struct sctp_tmit_chunk *chk, *nchk; in sctp_recover_sent_list() local
442 TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { in sctp_recover_sent_list()
443 if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.tsn)) { in sctp_recover_sent_list()
445 (void *)chk, chk->rec.data.tsn, asoc->last_acked_seq); in sctp_recover_sent_list()
446 if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { in sctp_recover_sent_list()
447 if (asoc->strmout[chk->rec.data.sid].chunks_on_queues > 0) { in sctp_recover_sent_list()
448 asoc->strmout[chk->rec.data.sid].chunks_on_queues--; in sctp_recover_sent_list()
451 if ((asoc->strmout[chk->rec.data.sid].chunks_on_queues == 0) && in sctp_recover_sent_list()
452 (asoc->strmout[chk->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) && in sctp_recover_sent_list()
453 TAILQ_EMPTY(&asoc->strmout[chk->rec.data.sid].outqueue)) { in sctp_recover_sent_list()
456 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); in sctp_recover_sent_list()
457 if (PR_SCTP_ENABLED(chk->flags)) { in sctp_recover_sent_list()
461 if (chk->data) { in sctp_recover_sent_list()
463 sctp_free_bufspace(stcb, asoc, chk, 1); in sctp_recover_sent_list()
464 sctp_m_freem(chk->data); in sctp_recover_sent_list()
465 chk->data = NULL; in sctp_recover_sent_list()
466 if (asoc->prsctp_supported && PR_SCTP_BUF_ENABLED(chk->flags)) { in sctp_recover_sent_list()
471 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_recover_sent_list()
475 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_recover_sent_list()
476 SCTP_PRINTF("chk:%p TSN:%x\n", (void *)chk, chk->rec.data.tsn); in sctp_recover_sent_list()
496 struct sctp_tmit_chunk *chk, *nchk; in sctp_mark_all_for_resend() local
560 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) { in sctp_mark_all_for_resend()
561 if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.tsn)) { in sctp_mark_all_for_resend()
564 (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.tsn); in sctp_mark_all_for_resend()
578 if ((chk->whoTo == net) && (chk->sent < SCTP_DATAGRAM_ACKED)) { in sctp_mark_all_for_resend()
589 sctp_log_fr(chk->rec.data.tsn, in sctp_mark_all_for_resend()
590 (uint32_t)chk->sent_rcv_time.tv_sec, in sctp_mark_all_for_resend()
591 chk->sent_rcv_time.tv_usec, in sctp_mark_all_for_resend()
594 if ((chk->sent_rcv_time.tv_sec > min_wait.tv_sec) && (window_probe == 0)) { in sctp_mark_all_for_resend()
602 (uint32_t)chk->sent_rcv_time.tv_sec, in sctp_mark_all_for_resend()
603 chk->sent_rcv_time.tv_usec, in sctp_mark_all_for_resend()
607 } else if ((chk->sent_rcv_time.tv_sec == min_wait.tv_sec) && in sctp_mark_all_for_resend()
613 if (chk->sent_rcv_time.tv_usec >= min_wait.tv_usec) { in sctp_mark_all_for_resend()
621 if (stcb->asoc.prsctp_supported && PR_SCTP_TTL_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
623 if (timevalcmp(&now, &chk->rec.data.timetodrop, >)) { in sctp_mark_all_for_resend()
625 if (chk->data) { in sctp_mark_all_for_resend()
627 chk, in sctp_mark_all_for_resend()
635 if (stcb->asoc.prsctp_supported && PR_SCTP_RTX_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
637 if (chk->snd_count > chk->rec.data.timetodrop.tv_sec) { in sctp_mark_all_for_resend()
638 if (chk->data) { in sctp_mark_all_for_resend()
640 chk, in sctp_mark_all_for_resend()
648 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
653 tsnfirst = chk->rec.data.tsn; in sctp_mark_all_for_resend()
655 tsnlast = chk->rec.data.tsn; in sctp_mark_all_for_resend()
657 sctp_log_fr(chk->rec.data.tsn, chk->snd_count, in sctp_mark_all_for_resend()
661 if (chk->rec.data.chunk_was_revoked) { in sctp_mark_all_for_resend()
663 chk->whoTo->cwnd -= chk->book_size; in sctp_mark_all_for_resend()
664 chk->rec.data.chunk_was_revoked = 0; in sctp_mark_all_for_resend()
670 chk->whoTo->flight_size, in sctp_mark_all_for_resend()
671 chk->book_size, in sctp_mark_all_for_resend()
672 (uint32_t)(uintptr_t)chk->whoTo, in sctp_mark_all_for_resend()
673 chk->rec.data.tsn); in sctp_mark_all_for_resend()
675 sctp_flight_size_decrease(chk); in sctp_mark_all_for_resend()
676 sctp_total_flight_decrease(stcb, chk); in sctp_mark_all_for_resend()
677 stcb->asoc.peers_rwnd += chk->send_size; in sctp_mark_all_for_resend()
680 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
681 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_mark_all_for_resend()
685 chk->rec.data.doing_fast_retransmit = 0; in sctp_mark_all_for_resend()
688 if (chk->do_rtt) { in sctp_mark_all_for_resend()
689 if (chk->whoTo->rto_needed == 0) { in sctp_mark_all_for_resend()
690 chk->whoTo->rto_needed = 1; in sctp_mark_all_for_resend()
693 chk->do_rtt = 0; in sctp_mark_all_for_resend()
695 sctp_free_remote_addr(chk->whoTo); in sctp_mark_all_for_resend()
696 chk->no_fr_allowed = 1; in sctp_mark_all_for_resend()
697 chk->whoTo = alt; in sctp_mark_all_for_resend()
700 chk->no_fr_allowed = 0; in sctp_mark_all_for_resend()
702 chk->rec.data.fast_retran_tsn = stcb->asoc.sending_seq; in sctp_mark_all_for_resend()
704 chk->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.tsn; in sctp_mark_all_for_resend()
711 chk->no_fr_allowed = 1; in sctp_mark_all_for_resend()
714 } else if (chk->sent == SCTP_DATAGRAM_ACKED) { in sctp_mark_all_for_resend()
716 could_be_sent = chk; in sctp_mark_all_for_resend()
719 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
746 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_mark_all_for_resend()
747 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
750 if ((chk->whoTo == net) && in sctp_mark_all_for_resend()
751 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_mark_all_for_resend()
752 sctp_free_remote_addr(chk->whoTo); in sctp_mark_all_for_resend()
753 chk->whoTo = alt; in sctp_mark_all_for_resend()
754 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
755 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
756 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_mark_all_for_resend()
793 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_mark_all_for_resend()
794 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
797 chk->whoTo->flight_size, in sctp_mark_all_for_resend()
798 chk->book_size, in sctp_mark_all_for_resend()
799 (uint32_t)(uintptr_t)chk->whoTo, in sctp_mark_all_for_resend()
800 chk->rec.data.tsn); in sctp_mark_all_for_resend()
803 sctp_flight_size_increase(chk); in sctp_mark_all_for_resend()
804 sctp_total_flight_increase(stcb, chk); in sctp_mark_all_for_resend()
1118 struct sctp_tmit_chunk *strrst = NULL, *chk = NULL; in sctp_strreset_timer() local
1144 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_strreset_timer()
1145 if ((chk->whoTo == net) && in sctp_strreset_timer()
1146 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_strreset_timer()
1147 sctp_free_remote_addr(chk->whoTo); in sctp_strreset_timer()
1148 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_strreset_timer()
1149 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_strreset_timer()
1150 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_strreset_timer()
1153 chk->whoTo = alt; in sctp_strreset_timer()
1182 struct sctp_tmit_chunk *asconf, *chk; in sctp_asconf_timer() local
1229 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_asconf_timer()
1230 if ((chk->whoTo == net) && in sctp_asconf_timer()
1231 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_asconf_timer()
1232 sctp_free_remote_addr(chk->whoTo); in sctp_asconf_timer()
1233 chk->whoTo = alt; in sctp_asconf_timer()
1234 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_asconf_timer()
1235 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1236 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()
1242 TAILQ_FOREACH(chk, &stcb->asoc.asconf_send_queue, sctp_next) { in sctp_asconf_timer()
1243 if (chk->whoTo != alt) { in sctp_asconf_timer()
1244 sctp_free_remote_addr(chk->whoTo); in sctp_asconf_timer()
1245 chk->whoTo = alt; in sctp_asconf_timer()
1248 if (asconf->sent != SCTP_DATAGRAM_RESEND && chk->sent != SCTP_DATAGRAM_UNSENT) in sctp_asconf_timer()
1250 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1251 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()