Lines Matching defs: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;
1577 chk = NULL;
1647 sctp_alloc_a_chunk(stcb, chk);
1648 if (chk == NULL) {
1657 chk->rec.data.TSN_seq = tsn;
1658 chk->no_fr_allowed = 0;
1659 chk->rec.data.stream_seq = strmseq;
1660 chk->rec.data.stream_number = strmno;
1661 chk->rec.data.payloadtype = protocol_id;
1662 chk->rec.data.context = stcb->asoc.context;
1663 chk->rec.data.doing_fast_retransmit = 0;
1664 chk->rec.data.rcv_flags = chunk_flags;
1665 chk->asoc = asoc;
1666 chk->send_size = the_len;
1667 chk->whoTo = net;
1669 chk->data = dmbuf;
1842 sctp_queue_data_for_reasm(stcb, asoc, chk, abort_flag);
1845 * the assoc is now gone and chk was put onto the
2231 struct sctp_tmit_chunk *chk;
2248 chk = TAILQ_FIRST(&asoc->reasmqueue);
2249 if (chk == NULL) {
2254 nxt_todel = asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered + 1;
2255 if ((chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) &&
2256 ((nxt_todel == chk->rec.data.stream_seq) ||
2257 (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED))) {
2276 asoc->tsn_last_delivered = chk->rec.data.TSN_seq - 1;
2277 asoc->str_of_pdapi = chk->rec.data.stream_number;
2278 asoc->ssn_of_pdapi = chk->rec.data.stream_seq;
2279 asoc->pdapi_ppid = chk->rec.data.payloadtype;
2280 asoc->fragment_flags = chk->rec.data.rcv_flags;
3447 /* No update but we do save the chk */
3464 struct sctp_tmit_chunk *chk;
3481 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) {
3482 if (chk->sent < SCTP_DATAGRAM_RESEND) {
3484 chk->rec.data.TSN_seq,
3485 chk->send_size,
3486 chk->snd_count);
3488 } else if (chk->sent == SCTP_DATAGRAM_RESEND) {
3490 } else if (chk->sent < SCTP_DATAGRAM_ACKED) {
3492 } else if (chk->sent > SCTP_DATAGRAM_ACKED) {
5015 struct sctp_tmit_chunk *chk, *nchk;
5026 TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) {
5032 if ((chk->rec.data.stream_number != stream) ||
5033 ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) {
5036 if (chk->rec.data.stream_seq == seq) {
5038 TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
5039 if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) {
5040 asoc->tsn_last_delivered = chk->rec.data.TSN_seq;
5041 asoc->str_of_pdapi = chk->rec.data.stream_number;
5042 asoc->ssn_of_pdapi = chk->rec.data.stream_seq;
5043 asoc->fragment_flags = chk->rec.data.rcv_flags;
5045 asoc->size_on_reasm_queue -= chk->send_size;
5049 if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED &&
5050 SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) {
5065 asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq;
5067 if (chk->data) {
5068 sctp_m_freem(chk->data);
5069 chk->data = NULL;
5071 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
5072 } else if (SCTP_SSN_GT(chk->rec.data.stream_seq, seq)) {
5105 struct sctp_tmit_chunk *chk, *nchk;
5191 TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) {
5192 if (SCTP_TSN_GE(new_cum_tsn, chk->rec.data.TSN_seq)) {
5194 TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
5195 if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) {
5196 asoc->tsn_last_delivered = chk->rec.data.TSN_seq;
5197 asoc->str_of_pdapi = chk->rec.data.stream_number;
5198 asoc->ssn_of_pdapi = chk->rec.data.stream_seq;
5199 asoc->fragment_flags = chk->rec.data.rcv_flags;
5201 asoc->size_on_reasm_queue -= chk->send_size;
5205 if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED &&
5206 SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) {
5221 asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq;
5223 if (chk->data) {
5224 sctp_m_freem(chk->data);
5225 chk->data = NULL;
5227 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);