Lines Matching refs:frag

63     hm_fragment *frag = NULL;  in dtls1_hm_fragment_new()  local
67 if ((frag = OPENSSL_zalloc(sizeof(*frag))) == NULL) in dtls1_hm_fragment_new()
72 OPENSSL_free(frag); in dtls1_hm_fragment_new()
78 frag->fragment = buf; in dtls1_hm_fragment_new()
85 OPENSSL_free(frag); in dtls1_hm_fragment_new()
90 frag->reassembly = bitmask; in dtls1_hm_fragment_new()
92 return frag; in dtls1_hm_fragment_new()
95 void dtls1_hm_fragment_free(hm_fragment *frag) in dtls1_hm_fragment_free() argument
97 if (!frag) in dtls1_hm_fragment_free()
100 OPENSSL_free(frag->fragment); in dtls1_hm_fragment_free()
101 OPENSSL_free(frag->reassembly); in dtls1_hm_fragment_free()
102 OPENSSL_free(frag); in dtls1_hm_fragment_free()
490 hm_fragment *frag; in dtls1_retrieve_buffered_fragment() local
500 frag = (hm_fragment *)item->data; in dtls1_retrieve_buffered_fragment()
502 if (frag->msg_header.seq < s->d1->handshake_read_seq) { in dtls1_retrieve_buffered_fragment()
507 || frag->msg_header.seq != 0 in dtls1_retrieve_buffered_fragment()
516 dtls1_hm_fragment_free(frag); in dtls1_retrieve_buffered_fragment()
519 frag = NULL; in dtls1_retrieve_buffered_fragment()
536 dtls1_hm_fragment_free(frag); in dtls1_retrieve_buffered_fragment()
539 frag = nextfrag; in dtls1_retrieve_buffered_fragment()
551 if (frag->reassembly != NULL) in dtls1_retrieve_buffered_fragment()
554 if (s->d1->handshake_read_seq == frag->msg_header.seq || chretran) { in dtls1_retrieve_buffered_fragment()
555 size_t frag_len = frag->msg_header.frag_len; in dtls1_retrieve_buffered_fragment()
559 ret = dtls1_preprocess_fragment(s, &frag->msg_header); in dtls1_retrieve_buffered_fragment()
561 if (ret && frag->msg_header.frag_len > 0) { in dtls1_retrieve_buffered_fragment()
564 memcpy(&p[frag->msg_header.frag_off], frag->fragment, in dtls1_retrieve_buffered_fragment()
565 frag->msg_header.frag_len); in dtls1_retrieve_buffered_fragment()
568 dtls1_hm_fragment_free(frag); in dtls1_retrieve_buffered_fragment()
597 hm_fragment *frag = NULL; in dtls1_reassemble_fragment() local
620 frag = dtls1_hm_fragment_new(msg_hdr->msg_len, 1); in dtls1_reassemble_fragment()
621 if (frag == NULL) in dtls1_reassemble_fragment()
623 memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr)); in dtls1_reassemble_fragment()
624 frag->msg_header.frag_len = frag->msg_header.msg_len; in dtls1_reassemble_fragment()
625 frag->msg_header.frag_off = 0; in dtls1_reassemble_fragment()
627 frag = (hm_fragment *)item->data; in dtls1_reassemble_fragment()
628 if (frag->msg_header.msg_len != msg_hdr->msg_len) { in dtls1_reassemble_fragment()
630 frag = NULL; in dtls1_reassemble_fragment()
640 if (frag->reassembly == NULL) { in dtls1_reassemble_fragment()
658 frag->fragment + msg_hdr->frag_off, in dtls1_reassemble_fragment()
665 RSMBLY_BITMASK_MARK(frag->reassembly, (long)msg_hdr->frag_off, in dtls1_reassemble_fragment()
670 RSMBLY_BITMASK_IS_COMPLETE(frag->reassembly, (long)msg_hdr->msg_len, in dtls1_reassemble_fragment()
674 OPENSSL_free(frag->reassembly); in dtls1_reassemble_fragment()
675 frag->reassembly = NULL; in dtls1_reassemble_fragment()
679 item = pitem_new(seq64be, frag); in dtls1_reassemble_fragment()
700 dtls1_hm_fragment_free(frag); in dtls1_reassemble_fragment()
708 hm_fragment *frag = NULL; in dtls1_process_out_of_seq_message() local
759 frag = dtls1_hm_fragment_new(frag_len, 0); in dtls1_process_out_of_seq_message()
760 if (frag == NULL) in dtls1_process_out_of_seq_message()
763 memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr)); in dtls1_process_out_of_seq_message()
770 frag->fragment, frag_len, 0, in dtls1_process_out_of_seq_message()
778 item = pitem_new(seq64be, frag); in dtls1_process_out_of_seq_message()
799 dtls1_hm_fragment_free(frag); in dtls1_process_out_of_seq_message()
1096 hm_fragment *frag; in dtls1_retransmit_buffered_messages() local
1102 frag = (hm_fragment *)item->data; in dtls1_retransmit_buffered_messages()
1105 (frag->msg_header.seq, in dtls1_retransmit_buffered_messages()
1106 frag->msg_header.is_ccs), &found) <= 0) in dtls1_retransmit_buffered_messages()
1116 hm_fragment *frag; in dtls1_buffer_message() local
1126 frag = dtls1_hm_fragment_new(s->init_num, 0); in dtls1_buffer_message()
1127 if (frag == NULL) in dtls1_buffer_message()
1130 memcpy(frag->fragment, s->init_buf->data, s->init_num); in dtls1_buffer_message()
1138 dtls1_hm_fragment_free(frag); in dtls1_buffer_message()
1144 dtls1_hm_fragment_free(frag); in dtls1_buffer_message()
1149 frag->msg_header.msg_len = s->d1->w_msg_hdr.msg_len; in dtls1_buffer_message()
1150 frag->msg_header.seq = s->d1->w_msg_hdr.seq; in dtls1_buffer_message()
1151 frag->msg_header.type = s->d1->w_msg_hdr.type; in dtls1_buffer_message()
1152 frag->msg_header.frag_off = 0; in dtls1_buffer_message()
1153 frag->msg_header.frag_len = s->d1->w_msg_hdr.msg_len; in dtls1_buffer_message()
1154 frag->msg_header.is_ccs = is_ccs; in dtls1_buffer_message()
1157 frag->msg_header.saved_retransmit_state.wrlmethod = s->rlayer.wrlmethod; in dtls1_buffer_message()
1158 frag->msg_header.saved_retransmit_state.wrl = s->rlayer.wrl; in dtls1_buffer_message()
1164 char)(dtls1_get_queue_priority(frag->msg_header.seq, in dtls1_buffer_message()
1165 frag->msg_header.is_ccs) >> 8); in dtls1_buffer_message()
1168 char)(dtls1_get_queue_priority(frag->msg_header.seq, in dtls1_buffer_message()
1169 frag->msg_header.is_ccs)); in dtls1_buffer_message()
1171 item = pitem_new(seq64be, frag); in dtls1_buffer_message()
1173 dtls1_hm_fragment_free(frag); in dtls1_buffer_message()
1186 hm_fragment *frag; in dtls1_retransmit_message() local
1204 frag = (hm_fragment *)item->data; in dtls1_retransmit_message()
1206 if (frag->msg_header.is_ccs) in dtls1_retransmit_message()
1211 memcpy(s->init_buf->data, frag->fragment, in dtls1_retransmit_message()
1212 frag->msg_header.msg_len + header_length); in dtls1_retransmit_message()
1213 s->init_num = frag->msg_header.msg_len + header_length; in dtls1_retransmit_message()
1215 dtls1_set_message_header_int(s, frag->msg_header.type, in dtls1_retransmit_message()
1216 frag->msg_header.msg_len, in dtls1_retransmit_message()
1217 frag->msg_header.seq, 0, in dtls1_retransmit_message()
1218 frag->msg_header.frag_len); in dtls1_retransmit_message()
1227 s->rlayer.wrlmethod = frag->msg_header.saved_retransmit_state.wrlmethod; in dtls1_retransmit_message()
1228 s->rlayer.wrl = frag->msg_header.saved_retransmit_state.wrl; in dtls1_retransmit_message()
1236 ret = dtls1_do_write(s, frag->msg_header.is_ccs ? in dtls1_retransmit_message()