Lines Matching refs:chk

166     struct sctp_tmit_chunk *chk)
174 read_queue_e->sinfo_stream = chk->rec.data.stream_number;
175 read_queue_e->sinfo_ssn = chk->rec.data.stream_seq;
176 read_queue_e->sinfo_flags = (chk->rec.data.rcv_flags << 8);
177 read_queue_e->sinfo_ppid = chk->rec.data.payloadtype;
180 read_queue_e->sinfo_tsn = chk->rec.data.TSN_seq;
181 read_queue_e->sinfo_cumtsn = chk->rec.data.TSN_seq;
183 read_queue_e->whoFrom = chk->whoTo;
186 atomic_add_int(&chk->whoTo->ref_count, 1);
187 read_queue_e->data = chk->data;
370 struct sctp_tmit_chunk *chk, *nchk;
387 TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) {
388 TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
389 asoc->size_on_reasm_queue -= chk->send_size;
395 if (chk->data) {
396 sctp_m_freem(chk->data);
397 chk->data = NULL;
400 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
406 TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) {
407 if (chk->rec.data.TSN_seq != (asoc->tsn_last_delivered + 1)) {
411 stream_no = chk->rec.data.stream_number;
413 if (nxt_todel != chk->rec.data.stream_seq &&
414 (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == 0) {
421 if (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) {
423 control = sctp_build_readq_entry_chk(stcb, chk);
430 if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG)
434 sctp_mark_non_revokable(asoc, chk->rec.data.TSN_seq);
440 if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG)
444 sctp_mark_non_revokable(asoc, chk->rec.data.TSN_seq);
447 chk->data, end, chk->rec.data.TSN_seq,
478 TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
479 if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) {
481 if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == 0) {
484 if ((chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) == 0) {
487 } else if (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) {
494 asoc->tsn_of_pdapi_last_delivered = chk->rec.data.TSN_seq;
495 asoc->last_flags_delivered = chk->rec.data.rcv_flags;
496 asoc->last_strm_seq_delivered = chk->rec.data.stream_seq;
497 asoc->last_strm_no_delivered = chk->rec.data.stream_number;
499 asoc->tsn_last_delivered = chk->rec.data.TSN_seq;
500 asoc->size_on_reasm_queue -= chk->send_size;
502 /* free up the chk */
503 chk->data = NULL;
504 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
731 struct sctp_tmit_chunk *chk;
735 chk = TAILQ_FIRST(&asoc->reasmqueue);
736 if (chk == NULL) {
740 if ((chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) == 0) {
744 tsn = chk->rec.data.TSN_seq;
745 TAILQ_FOREACH(chk, &asoc->reasmqueue, sctp_next) {
746 if (tsn != chk->rec.data.TSN_seq) {
749 *t_size += chk->send_size;
750 if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) {
761 struct sctp_tmit_chunk *chk;
766 chk = TAILQ_FIRST(&asoc->reasmqueue);
767 if (chk == NULL) {
775 asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered + 1;
776 if ((chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) &&
777 (nxt_todel == chk->rec.data.stream_seq ||
778 (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED))) {
797 chk->rec.data.TSN_seq - 1;
799 chk->rec.data.stream_number;
800 asoc->ssn_of_pdapi = chk->rec.data.stream_seq;
801 asoc->pdapi_ppid = chk->rec.data.payloadtype;
802 asoc->fragment_flags = chk->rec.data.rcv_flags;
832 struct sctp_tmit_chunk *chk, int *abort_flag)
843 TAILQ_INSERT_HEAD(&asoc->reasmqueue, chk, sctp_next);
848 asoc->size_on_reasm_queue = chk->send_size;
850 if (chk->rec.data.TSN_seq == cum_ackp1) {
852 (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) !=
862 chk->rec.data.TSN_seq,
863 chk->rec.data.stream_number,
864 chk->rec.data.stream_seq);
870 (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) == SCTP_DATA_FIRST_FRAG) {
879 chk->rec.data.TSN_seq,
880 chk->rec.data.stream_number,
881 chk->rec.data.stream_seq);
891 if (chk->rec.data.stream_number !=
895 chk->rec.data.stream_number,
900 chk->rec.data.TSN_seq,
901 chk->rec.data.stream_number,
902 chk->rec.data.stream_seq);
909 chk->rec.data.stream_seq != asoc->ssn_of_pdapi) {
912 chk->rec.data.stream_seq,
917 chk->rec.data.TSN_seq,
918 chk->rec.data.stream_number,
919 chk->rec.data.stream_seq);
931 if (SCTP_TSN_GT(at->rec.data.TSN_seq, chk->rec.data.TSN_seq)) {
937 asoc->size_on_reasm_queue += chk->send_size;
940 TAILQ_INSERT_BEFORE(at, chk, sctp_next);
942 } else if (at->rec.data.TSN_seq == chk->rec.data.TSN_seq) {
951 if (chk->data) {
952 sctp_m_freem(chk->data);
953 chk->data = NULL;
955 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
965 asoc->size_on_reasm_queue += chk->send_size;
967 TAILQ_INSERT_AFTER(&asoc->reasmqueue, at, chk, sctp_next);
974 prev_tsn = chk->rec.data.TSN_seq - 1;
985 * Insert chk MUST be a MIDDLE or LAST
988 if ((chk->rec.data.rcv_flags & SCTP_DATA_FRAG_MASK) ==
994 chk->rec.data.TSN_seq,
995 chk->rec.data.stream_number,
996 chk->rec.data.stream_seq);
1003 if (chk->rec.data.stream_number !=
1010 chk->rec.data.stream_number,
1015 chk->rec.data.TSN_seq,
1016 chk->rec.data.stream_number,
1017 chk->rec.data.stream_seq);
1024 if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) !=
1034 chk->rec.data.TSN_seq,
1035 (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0);
1043 chk->rec.data.stream_seq !=
1050 chk->rec.data.stream_seq,
1055 chk->rec.data.TSN_seq,
1056 chk->rec.data.stream_number,
1057 chk->rec.data.stream_seq);
1066 /* Insert chk MUST be a FIRST */
1067 if ((chk->rec.data.rcv_flags & SCTP_DATA_FRAG_MASK) !=
1072 chk->rec.data.TSN_seq,
1073 chk->rec.data.stream_number,
1074 chk->rec.data.stream_seq);
1085 post_tsn = chk->rec.data.TSN_seq + 1;
1092 /* Insert chk MUST be a last fragment */
1093 if ((chk->rec.data.rcv_flags & SCTP_DATA_FRAG_MASK)
1095 SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is FIRST, we must be LAST\n");
1099 chk->rec.data.TSN_seq,
1100 chk->rec.data.stream_number,
1101 chk->rec.data.stream_seq);
1113 * Insert chk CAN be MIDDLE or FIRST NOT
1116 if ((chk->rec.data.rcv_flags & SCTP_DATA_FRAG_MASK) ==
1118 SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is a MIDDLE/LAST\n");
1122 chk->rec.data.TSN_seq,
1123 chk->rec.data.stream_number,
1124 chk->rec.data.stream_seq);
1131 if (chk->rec.data.stream_number !=
1137 SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Gak, Evil plot, ssn:%d not the same as at:%d\n",
1138 chk->rec.data.stream_number,
1143 chk->rec.data.TSN_seq,
1144 chk->rec.data.stream_number,
1145 chk->rec.data.stream_seq);
1152 if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) !=
1162 chk->rec.data.TSN_seq,
1163 (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0);
1171 chk->rec.data.stream_seq !=
1177 SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Gak, Evil plot, sseq:%d not the same as at:%d\n",
1178 chk->rec.data.stream_seq,
1183 chk->rec.data.TSN_seq,
1184 chk->rec.data.stream_number,
1185 chk->rec.data.stream_seq);
1266 /* struct sctp_tmit_chunk *chk; */
1267 struct sctp_tmit_chunk *chk;
1281 chk = NULL;
1582 chk = NULL;
1652 sctp_alloc_a_chunk(stcb, chk);
1653 if (chk == NULL) {
1662 chk->rec.data.TSN_seq = tsn;
1663 chk->no_fr_allowed = 0;
1664 chk->rec.data.stream_seq = strmseq;
1665 chk->rec.data.stream_number = strmno;
1666 chk->rec.data.payloadtype = protocol_id;
1667 chk->rec.data.context = stcb->asoc.context;
1668 chk->rec.data.doing_fast_retransmit = 0;
1669 chk->rec.data.rcv_flags = chunk_flags;
1670 chk->asoc = asoc;
1671 chk->send_size = the_len;
1672 chk->whoTo = net;
1674 chk->data = dmbuf;
1847 sctp_queue_data_for_reasm(stcb, asoc, chk, abort_flag);
1850 * the assoc is now gone and chk was put onto the
2235 struct sctp_tmit_chunk *chk;
2252 chk = TAILQ_FIRST(&asoc->reasmqueue);
2253 if (chk == NULL) {
2258 nxt_todel = asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered + 1;
2259 if ((chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) &&
2260 ((nxt_todel == chk->rec.data.stream_seq) ||
2261 (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED))) {
2280 asoc->tsn_last_delivered = chk->rec.data.TSN_seq - 1;
2281 asoc->str_of_pdapi = chk->rec.data.stream_number;
2282 asoc->ssn_of_pdapi = chk->rec.data.stream_seq;
2283 asoc->pdapi_ppid = chk->rec.data.payloadtype;
2284 asoc->fragment_flags = chk->rec.data.rcv_flags;
3449 /* No update but we do save the chk */
3466 struct sctp_tmit_chunk *chk;
3477 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) {
3478 if (chk->sent < SCTP_DATAGRAM_RESEND) {
3480 chk->rec.data.TSN_seq,
3481 chk->send_size,
3482 chk->snd_count);
3484 } else if (chk->sent == SCTP_DATAGRAM_RESEND) {
3486 } else if (chk->sent < SCTP_DATAGRAM_ACKED) {
3488 } else if (chk->sent > SCTP_DATAGRAM_ACKED) {
5013 struct sctp_tmit_chunk *chk, *nchk;
5024 TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) {
5030 if ((chk->rec.data.stream_number != stream) ||
5031 ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) {
5034 if (chk->rec.data.stream_seq == seq) {
5036 TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
5037 if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) {
5038 asoc->tsn_last_delivered = chk->rec.data.TSN_seq;
5039 asoc->str_of_pdapi = chk->rec.data.stream_number;
5040 asoc->ssn_of_pdapi = chk->rec.data.stream_seq;
5041 asoc->fragment_flags = chk->rec.data.rcv_flags;
5043 asoc->size_on_reasm_queue -= chk->send_size;
5047 if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED &&
5048 SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) {
5063 asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq;
5065 if (chk->data) {
5066 sctp_m_freem(chk->data);
5067 chk->data = NULL;
5069 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
5070 } else if (SCTP_SSN_GT(chk->rec.data.stream_seq, seq)) {
5103 struct sctp_tmit_chunk *chk, *nchk;
5189 TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) {
5190 if (SCTP_TSN_GE(new_cum_tsn, chk->rec.data.TSN_seq)) {
5192 TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
5193 if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) {
5194 asoc->tsn_last_delivered = chk->rec.data.TSN_seq;
5195 asoc->str_of_pdapi = chk->rec.data.stream_number;
5196 asoc->ssn_of_pdapi = chk->rec.data.stream_seq;
5197 asoc->fragment_flags = chk->rec.data.rcv_flags;
5199 asoc->size_on_reasm_queue -= chk->send_size;
5203 if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED &&
5204 SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) {
5219 asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq;
5221 if (chk->data) {
5222 sctp_m_freem(chk->data);
5223 chk->data = NULL;
5225 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);