Lines Matching refs:chk
61 struct sctp_tmit_chunk *chk; in sctp_audit_retranmission_queue() local
68 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_audit_retranmission_queue()
69 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
74 TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
75 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
79 TAILQ_FOREACH(chk, &asoc->asconf_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
80 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
443 struct sctp_tmit_chunk *chk, *nchk; in sctp_recover_sent_list() local
447 TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { in sctp_recover_sent_list()
448 if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.tsn)) { in sctp_recover_sent_list()
450 (void *)chk, chk->rec.data.tsn, asoc->last_acked_seq); in sctp_recover_sent_list()
451 if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { in sctp_recover_sent_list()
452 if (asoc->strmout[chk->rec.data.sid].chunks_on_queues > 0) { in sctp_recover_sent_list()
453 asoc->strmout[chk->rec.data.sid].chunks_on_queues--; in sctp_recover_sent_list()
456 if ((asoc->strmout[chk->rec.data.sid].chunks_on_queues == 0) && in sctp_recover_sent_list()
457 (asoc->strmout[chk->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) && in sctp_recover_sent_list()
458 TAILQ_EMPTY(&asoc->strmout[chk->rec.data.sid].outqueue)) { in sctp_recover_sent_list()
461 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); in sctp_recover_sent_list()
462 if (PR_SCTP_ENABLED(chk->flags)) { in sctp_recover_sent_list()
466 if (chk->data) { in sctp_recover_sent_list()
468 sctp_free_bufspace(stcb, asoc, chk, 1); in sctp_recover_sent_list()
469 sctp_m_freem(chk->data); in sctp_recover_sent_list()
470 chk->data = NULL; in sctp_recover_sent_list()
471 if (asoc->prsctp_supported && PR_SCTP_BUF_ENABLED(chk->flags)) { in sctp_recover_sent_list()
476 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_recover_sent_list()
480 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_recover_sent_list()
481 SCTP_PRINTF("chk:%p TSN:%x\n", (void *)chk, chk->rec.data.tsn); in sctp_recover_sent_list()
501 struct sctp_tmit_chunk *chk, *nchk; in sctp_mark_all_for_resend() local
563 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) { in sctp_mark_all_for_resend()
564 if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.tsn)) { in sctp_mark_all_for_resend()
567 (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.tsn); in sctp_mark_all_for_resend()
581 if ((chk->whoTo == net) && (chk->sent < SCTP_DATAGRAM_ACKED)) { in sctp_mark_all_for_resend()
592 sctp_log_fr(chk->rec.data.tsn, in sctp_mark_all_for_resend()
593 chk->sent_rcv_time.tv_sec, in sctp_mark_all_for_resend()
594 chk->sent_rcv_time.tv_usec, in sctp_mark_all_for_resend()
597 if ((chk->sent_rcv_time.tv_sec > min_wait.tv_sec) && (window_probe == 0)) { in sctp_mark_all_for_resend()
605 chk->sent_rcv_time.tv_sec, in sctp_mark_all_for_resend()
606 chk->sent_rcv_time.tv_usec, in sctp_mark_all_for_resend()
610 } else if ((chk->sent_rcv_time.tv_sec == min_wait.tv_sec) && in sctp_mark_all_for_resend()
616 if (chk->sent_rcv_time.tv_usec >= min_wait.tv_usec) { in sctp_mark_all_for_resend()
624 if (stcb->asoc.prsctp_supported && PR_SCTP_TTL_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
626 if (timevalcmp(&now, &chk->rec.data.timetodrop, >)) { in sctp_mark_all_for_resend()
628 if (chk->data) { in sctp_mark_all_for_resend()
630 chk, in sctp_mark_all_for_resend()
638 if (stcb->asoc.prsctp_supported && PR_SCTP_RTX_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
640 if (chk->snd_count > chk->rec.data.timetodrop.tv_sec) { in sctp_mark_all_for_resend()
641 if (chk->data) { in sctp_mark_all_for_resend()
643 chk, in sctp_mark_all_for_resend()
651 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
656 tsnfirst = chk->rec.data.tsn; in sctp_mark_all_for_resend()
658 tsnlast = chk->rec.data.tsn; in sctp_mark_all_for_resend()
660 sctp_log_fr(chk->rec.data.tsn, chk->snd_count, in sctp_mark_all_for_resend()
664 if (chk->rec.data.chunk_was_revoked) { in sctp_mark_all_for_resend()
666 chk->whoTo->cwnd -= chk->book_size; in sctp_mark_all_for_resend()
667 chk->rec.data.chunk_was_revoked = 0; in sctp_mark_all_for_resend()
673 chk->whoTo->flight_size, in sctp_mark_all_for_resend()
674 chk->book_size, in sctp_mark_all_for_resend()
675 (uint32_t)(uintptr_t)chk->whoTo, in sctp_mark_all_for_resend()
676 chk->rec.data.tsn); in sctp_mark_all_for_resend()
678 sctp_flight_size_decrease(chk); in sctp_mark_all_for_resend()
679 sctp_total_flight_decrease(stcb, chk); in sctp_mark_all_for_resend()
680 stcb->asoc.peers_rwnd += chk->send_size; in sctp_mark_all_for_resend()
683 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
684 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_mark_all_for_resend()
688 chk->rec.data.doing_fast_retransmit = 0; in sctp_mark_all_for_resend()
691 if (chk->do_rtt) { in sctp_mark_all_for_resend()
692 if (chk->whoTo->rto_needed == 0) { in sctp_mark_all_for_resend()
693 chk->whoTo->rto_needed = 1; in sctp_mark_all_for_resend()
696 chk->do_rtt = 0; in sctp_mark_all_for_resend()
698 sctp_free_remote_addr(chk->whoTo); in sctp_mark_all_for_resend()
699 chk->no_fr_allowed = 1; in sctp_mark_all_for_resend()
700 chk->whoTo = alt; in sctp_mark_all_for_resend()
703 chk->no_fr_allowed = 0; in sctp_mark_all_for_resend()
705 chk->rec.data.fast_retran_tsn = stcb->asoc.sending_seq; in sctp_mark_all_for_resend()
707 chk->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.tsn; in sctp_mark_all_for_resend()
714 chk->no_fr_allowed = 1; in sctp_mark_all_for_resend()
717 } else if (chk->sent == SCTP_DATAGRAM_ACKED) { in sctp_mark_all_for_resend()
719 could_be_sent = chk; in sctp_mark_all_for_resend()
722 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
749 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_mark_all_for_resend()
750 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
753 if ((chk->whoTo == net) && in sctp_mark_all_for_resend()
754 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_mark_all_for_resend()
755 sctp_free_remote_addr(chk->whoTo); in sctp_mark_all_for_resend()
756 chk->whoTo = alt; in sctp_mark_all_for_resend()
757 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
758 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
759 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_mark_all_for_resend()
796 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_mark_all_for_resend()
797 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
800 chk->whoTo->flight_size, in sctp_mark_all_for_resend()
801 chk->book_size, in sctp_mark_all_for_resend()
802 (uint32_t)(uintptr_t)chk->whoTo, in sctp_mark_all_for_resend()
803 chk->rec.data.tsn); in sctp_mark_all_for_resend()
806 sctp_flight_size_increase(chk); in sctp_mark_all_for_resend()
807 sctp_total_flight_increase(stcb, chk); in sctp_mark_all_for_resend()
1121 struct sctp_tmit_chunk *strrst = NULL, *chk = NULL; in sctp_strreset_timer() local
1147 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_strreset_timer()
1148 if ((chk->whoTo == net) && in sctp_strreset_timer()
1149 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_strreset_timer()
1150 sctp_free_remote_addr(chk->whoTo); in sctp_strreset_timer()
1151 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_strreset_timer()
1152 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_strreset_timer()
1153 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_strreset_timer()
1156 chk->whoTo = alt; in sctp_strreset_timer()
1185 struct sctp_tmit_chunk *asconf, *chk; in sctp_asconf_timer() local
1232 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_asconf_timer()
1233 if ((chk->whoTo == net) && in sctp_asconf_timer()
1234 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_asconf_timer()
1235 sctp_free_remote_addr(chk->whoTo); in sctp_asconf_timer()
1236 chk->whoTo = alt; in sctp_asconf_timer()
1237 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_asconf_timer()
1238 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1239 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()
1245 TAILQ_FOREACH(chk, &stcb->asoc.asconf_send_queue, sctp_next) { in sctp_asconf_timer()
1246 if (chk->whoTo != alt) { in sctp_asconf_timer()
1247 sctp_free_remote_addr(chk->whoTo); in sctp_asconf_timer()
1248 chk->whoTo = alt; in sctp_asconf_timer()
1251 if (asconf->sent != SCTP_DATAGRAM_RESEND && chk->sent != SCTP_DATAGRAM_UNSENT) in sctp_asconf_timer()
1253 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1254 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()