Lines Matching refs:chk

60 	struct sctp_tmit_chunk *chk;
67 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) {
68 if (chk->sent == SCTP_DATAGRAM_RESEND) {
73 TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) {
74 if (chk->sent == SCTP_DATAGRAM_RESEND) {
78 TAILQ_FOREACH(chk, &asoc->asconf_send_queue, sctp_next) {
79 if (chk->sent == SCTP_DATAGRAM_RESEND) {
429 struct sctp_tmit_chunk *chk, *nchk;
433 TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) {
434 if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.tsn)) {
435 SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n",
436 (void *)chk, chk->rec.data.tsn, asoc->last_acked_seq);
437 if (chk->sent != SCTP_DATAGRAM_NR_ACKED) {
438 if (asoc->strmout[chk->rec.data.sid].chunks_on_queues > 0) {
439 asoc->strmout[chk->rec.data.sid].chunks_on_queues--;
442 if ((asoc->strmout[chk->rec.data.sid].chunks_on_queues == 0) &&
443 (asoc->strmout[chk->rec.data.sid].state == SCTP_STREAM_RESET_PENDING) &&
444 TAILQ_EMPTY(&asoc->strmout[chk->rec.data.sid].outqueue)) {
447 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next);
448 if (PR_SCTP_ENABLED(chk->flags)) {
452 if (chk->data) {
454 sctp_free_bufspace(stcb, asoc, chk, 1);
455 sctp_m_freem(chk->data);
456 chk->data = NULL;
457 if (asoc->prsctp_supported && PR_SCTP_BUF_ENABLED(chk->flags)) {
462 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
466 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) {
467 SCTP_PRINTF("chk:%p TSN:%x\n", (void *)chk, chk->rec.data.tsn);
487 struct sctp_tmit_chunk *chk, *nchk;
550 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) {
551 if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.tsn)) {
553 SCTP_PRINTF("Our list is out of order? last_acked:%x chk:%x\n",
554 (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.tsn);
557 panic("last acked >= chk on sent-Q");
568 if ((chk->whoTo == net) && (chk->sent < SCTP_DATAGRAM_ACKED)) {
579 sctp_log_fr(chk->rec.data.tsn,
580 chk->sent_rcv_time.tv_sec,
581 chk->sent_rcv_time.tv_usec,
584 if ((chk->sent_rcv_time.tv_sec > min_wait.tv_sec) && (window_probe == 0)) {
592 chk->sent_rcv_time.tv_sec,
593 chk->sent_rcv_time.tv_usec,
597 } else if ((chk->sent_rcv_time.tv_sec == min_wait.tv_sec) &&
603 if (chk->sent_rcv_time.tv_usec >= min_wait.tv_usec) {
611 if (stcb->asoc.prsctp_supported && PR_SCTP_TTL_ENABLED(chk->flags)) {
613 if (timevalcmp(&now, &chk->rec.data.timetodrop, >)) {
615 if (chk->data) {
617 chk,
625 if (stcb->asoc.prsctp_supported && PR_SCTP_RTX_ENABLED(chk->flags)) {
627 if (chk->snd_count > chk->rec.data.timetodrop.tv_sec) {
628 if (chk->data) {
630 chk,
638 if (chk->sent < SCTP_DATAGRAM_RESEND) {
643 tsnfirst = chk->rec.data.tsn;
645 tsnlast = chk->rec.data.tsn;
647 sctp_log_fr(chk->rec.data.tsn, chk->snd_count,
651 if (chk->rec.data.chunk_was_revoked) {
653 chk->whoTo->cwnd -= chk->book_size;
654 chk->rec.data.chunk_was_revoked = 0;
660 chk->whoTo->flight_size,
661 chk->book_size,
662 (uint32_t)(uintptr_t)chk->whoTo,
663 chk->rec.data.tsn);
665 sctp_flight_size_decrease(chk);
666 sctp_total_flight_decrease(stcb, chk);
667 stcb->asoc.peers_rwnd += chk->send_size;
670 chk->sent = SCTP_DATAGRAM_RESEND;
671 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;
675 chk->rec.data.doing_fast_retransmit = 0;
678 if (chk->do_rtt) {
679 if (chk->whoTo->rto_needed == 0) {
680 chk->whoTo->rto_needed = 1;
683 chk->do_rtt = 0;
685 sctp_free_remote_addr(chk->whoTo);
686 chk->no_fr_allowed = 1;
687 chk->whoTo = alt;
690 chk->no_fr_allowed = 0;
692 chk->rec.data.fast_retran_tsn = stcb->asoc.sending_seq;
694 chk->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.tsn;
701 chk->no_fr_allowed = 1;
704 } else if (chk->sent == SCTP_DATAGRAM_ACKED) {
706 could_be_sent = chk;
709 if (chk->sent == SCTP_DATAGRAM_RESEND) {
736 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
737 if (chk->sent == SCTP_DATAGRAM_RESEND) {
740 if ((chk->whoTo == net) &&
741 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) {
742 sctp_free_remote_addr(chk->whoTo);
743 chk->whoTo = alt;
744 if (chk->sent != SCTP_DATAGRAM_RESEND) {
745 chk->sent = SCTP_DATAGRAM_RESEND;
746 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;
783 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
784 if (chk->sent < SCTP_DATAGRAM_RESEND) {
787 chk->whoTo->flight_size,
788 chk->book_size,
789 (uint32_t)(uintptr_t)chk->whoTo,
790 chk->rec.data.tsn);
793 sctp_flight_size_increase(chk);
794 sctp_total_flight_increase(stcb, chk);
1113 struct sctp_tmit_chunk *strrst = NULL, *chk = NULL;
1140 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
1141 if ((chk->whoTo == net) &&
1142 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) {
1143 sctp_free_remote_addr(chk->whoTo);
1144 if (chk->sent != SCTP_DATAGRAM_RESEND) {
1145 chk->sent = SCTP_DATAGRAM_RESEND;
1146 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;
1149 chk->whoTo = alt;
1156 * alternates for ALL chk's in queue
1176 struct sctp_tmit_chunk *asconf, *chk;
1223 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
1224 if ((chk->whoTo == net) &&
1225 (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) {
1226 sctp_free_remote_addr(chk->whoTo);
1227 chk->whoTo = alt;
1228 if (chk->sent != SCTP_DATAGRAM_RESEND) {
1229 chk->sent = SCTP_DATAGRAM_RESEND;
1230 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;
1236 TAILQ_FOREACH(chk, &stcb->asoc.asconf_send_queue, sctp_next) {
1237 if (chk->whoTo != alt) {
1238 sctp_free_remote_addr(chk->whoTo);
1239 chk->whoTo = alt;
1242 if (asconf->sent != SCTP_DATAGRAM_RESEND && chk->sent != SCTP_DATAGRAM_UNSENT)
1244 chk->sent = SCTP_DATAGRAM_RESEND;
1245 chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;