Lines Matching refs:chk
57 struct sctp_tmit_chunk *chk; in sctp_audit_retranmission_queue() local
64 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_audit_retranmission_queue()
65 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
70 TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
71 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
75 TAILQ_FOREACH(chk, &asoc->asconf_send_queue, sctp_next) { in sctp_audit_retranmission_queue()
76 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_audit_retranmission_queue()
437 struct sctp_tmit_chunk *chk, *nchk; in sctp_recover_sent_list() local
441 TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { in sctp_recover_sent_list()
442 if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.tsn)) { in sctp_recover_sent_list()
444 (void *)chk, chk->rec.data.tsn, asoc->last_acked_seq); in sctp_recover_sent_list()
445 if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { in sctp_recover_sent_list()
446 if (asoc->strmout[chk->rec.data.sid].chunks_on_queues > 0) { in sctp_recover_sent_list()
447 asoc->strmout[chk->rec.data.sid].chunks_on_queues--; in sctp_recover_sent_list()
450 if ((asoc->strmout[chk->rec.data.sid].chunks_on_queues == 0) && in sctp_recover_sent_list()
451 (asoc->strmout[chk->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) && in sctp_recover_sent_list()
452 TAILQ_EMPTY(&asoc->strmout[chk->rec.data.sid].outqueue)) { in sctp_recover_sent_list()
455 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); in sctp_recover_sent_list()
456 if (PR_SCTP_ENABLED(chk->flags)) { in sctp_recover_sent_list()
460 if (chk->data) { in sctp_recover_sent_list()
462 sctp_free_bufspace(stcb, asoc, chk, 1); in sctp_recover_sent_list()
463 sctp_m_freem(chk->data); in sctp_recover_sent_list()
464 chk->data = NULL; in sctp_recover_sent_list()
465 if (asoc->prsctp_supported && PR_SCTP_BUF_ENABLED(chk->flags)) { in sctp_recover_sent_list()
470 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_recover_sent_list()
474 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_recover_sent_list()
475 SCTP_PRINTF("chk:%p TSN:%x\n", (void *)chk, chk->rec.data.tsn); in sctp_recover_sent_list()
495 struct sctp_tmit_chunk *chk, *nchk; in sctp_mark_all_for_resend() local
559 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) { in sctp_mark_all_for_resend()
560 if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.tsn)) { in sctp_mark_all_for_resend()
563 (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.tsn); in sctp_mark_all_for_resend()
577 if ((chk->whoTo == net) && (chk->sent < SCTP_DATAGRAM_ACKED)) { in sctp_mark_all_for_resend()
588 sctp_log_fr(chk->rec.data.tsn, in sctp_mark_all_for_resend()
589 (uint32_t)chk->sent_rcv_time.tv_sec, in sctp_mark_all_for_resend()
590 chk->sent_rcv_time.tv_usec, in sctp_mark_all_for_resend()
593 if ((chk->sent_rcv_time.tv_sec > min_wait.tv_sec) && (window_probe == 0)) { in sctp_mark_all_for_resend()
601 (uint32_t)chk->sent_rcv_time.tv_sec, in sctp_mark_all_for_resend()
602 chk->sent_rcv_time.tv_usec, in sctp_mark_all_for_resend()
606 } else if ((chk->sent_rcv_time.tv_sec == min_wait.tv_sec) && in sctp_mark_all_for_resend()
612 if (chk->sent_rcv_time.tv_usec >= min_wait.tv_usec) { in sctp_mark_all_for_resend()
620 if (stcb->asoc.prsctp_supported && PR_SCTP_TTL_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
622 if (timevalcmp(&now, &chk->rec.data.timetodrop, >)) { in sctp_mark_all_for_resend()
624 if (chk->data) { in sctp_mark_all_for_resend()
626 chk, in sctp_mark_all_for_resend()
634 if (stcb->asoc.prsctp_supported && PR_SCTP_RTX_ENABLED(chk->flags)) { in sctp_mark_all_for_resend()
636 if (chk->snd_count > chk->rec.data.timetodrop.tv_sec) { in sctp_mark_all_for_resend()
637 if (chk->data) { in sctp_mark_all_for_resend()
639 chk, in sctp_mark_all_for_resend()
647 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
652 tsnfirst = chk->rec.data.tsn; in sctp_mark_all_for_resend()
654 tsnlast = chk->rec.data.tsn; in sctp_mark_all_for_resend()
656 sctp_log_fr(chk->rec.data.tsn, chk->snd_count, in sctp_mark_all_for_resend()
660 if (chk->rec.data.chunk_was_revoked) { in sctp_mark_all_for_resend()
662 chk->whoTo->cwnd -= chk->book_size; in sctp_mark_all_for_resend()
663 chk->rec.data.chunk_was_revoked = 0; in sctp_mark_all_for_resend()
669 chk->whoTo->flight_size, in sctp_mark_all_for_resend()
670 chk->book_size, in sctp_mark_all_for_resend()
671 (uint32_t)(uintptr_t)chk->whoTo, in sctp_mark_all_for_resend()
672 chk->rec.data.tsn); in sctp_mark_all_for_resend()
674 sctp_flight_size_decrease(chk); in sctp_mark_all_for_resend()
675 sctp_total_flight_decrease(stcb, chk); in sctp_mark_all_for_resend()
676 stcb->asoc.peers_rwnd += chk->send_size; in sctp_mark_all_for_resend()
679 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
680 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_mark_all_for_resend()
684 chk->rec.data.doing_fast_retransmit = 0; in sctp_mark_all_for_resend()
687 if (chk->do_rtt) { in sctp_mark_all_for_resend()
688 if (chk->whoTo->rto_needed == 0) { in sctp_mark_all_for_resend()
689 chk->whoTo->rto_needed = 1; in sctp_mark_all_for_resend()
692 chk->do_rtt = 0; in sctp_mark_all_for_resend()
694 sctp_free_remote_addr(chk->whoTo); in sctp_mark_all_for_resend()
695 chk->no_fr_allowed = 1; in sctp_mark_all_for_resend()
696 chk->whoTo = alt; in sctp_mark_all_for_resend()
699 chk->no_fr_allowed = 0; in sctp_mark_all_for_resend()
701 chk->rec.data.fast_retran_tsn = stcb->asoc.sending_seq; in sctp_mark_all_for_resend()
703 chk->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.tsn; in sctp_mark_all_for_resend()
710 chk->no_fr_allowed = 1; in sctp_mark_all_for_resend()
713 } else if (chk->sent == SCTP_DATAGRAM_ACKED) { in sctp_mark_all_for_resend()
715 could_be_sent = chk; in sctp_mark_all_for_resend()
718 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
745 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_mark_all_for_resend()
746 if (chk->sent == SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
749 if ((chk->whoTo == net) && in sctp_mark_all_for_resend()
750 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_mark_all_for_resend()
751 sctp_free_remote_addr(chk->whoTo); in sctp_mark_all_for_resend()
752 chk->whoTo = alt; in sctp_mark_all_for_resend()
753 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
754 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_mark_all_for_resend()
755 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_mark_all_for_resend()
792 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_mark_all_for_resend()
793 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_mark_all_for_resend()
796 chk->whoTo->flight_size, in sctp_mark_all_for_resend()
797 chk->book_size, in sctp_mark_all_for_resend()
798 (uint32_t)(uintptr_t)chk->whoTo, in sctp_mark_all_for_resend()
799 chk->rec.data.tsn); in sctp_mark_all_for_resend()
802 sctp_flight_size_increase(chk); in sctp_mark_all_for_resend()
803 sctp_total_flight_increase(stcb, chk); in sctp_mark_all_for_resend()
1117 struct sctp_tmit_chunk *strrst = NULL, *chk = NULL; in sctp_strreset_timer() local
1143 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_strreset_timer()
1144 if ((chk->whoTo == net) && in sctp_strreset_timer()
1145 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_strreset_timer()
1146 sctp_free_remote_addr(chk->whoTo); in sctp_strreset_timer()
1147 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_strreset_timer()
1148 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_strreset_timer()
1149 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_strreset_timer()
1152 chk->whoTo = alt; in sctp_strreset_timer()
1181 struct sctp_tmit_chunk *asconf, *chk; in sctp_asconf_timer() local
1228 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_asconf_timer()
1229 if ((chk->whoTo == net) && in sctp_asconf_timer()
1230 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) { in sctp_asconf_timer()
1231 sctp_free_remote_addr(chk->whoTo); in sctp_asconf_timer()
1232 chk->whoTo = alt; in sctp_asconf_timer()
1233 if (chk->sent != SCTP_DATAGRAM_RESEND) { in sctp_asconf_timer()
1234 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1235 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()
1241 TAILQ_FOREACH(chk, &stcb->asoc.asconf_send_queue, sctp_next) { in sctp_asconf_timer()
1242 if (chk->whoTo != alt) { in sctp_asconf_timer()
1243 sctp_free_remote_addr(chk->whoTo); in sctp_asconf_timer()
1244 chk->whoTo = alt; in sctp_asconf_timer()
1247 if (asconf->sent != SCTP_DATAGRAM_RESEND && chk->sent != SCTP_DATAGRAM_UNSENT) in sctp_asconf_timer()
1249 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_asconf_timer()
1250 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; in sctp_asconf_timer()