Lines Matching refs:d1

88   DTLS1_STATE *d1;  in dtls1_new()  local
93 d1 = OPENSSL_malloc(sizeof *d1); in dtls1_new()
94 if (d1 == NULL) { in dtls1_new()
98 memset(d1, 0, sizeof *d1); in dtls1_new()
100 d1->buffered_messages = pqueue_new(); in dtls1_new()
101 d1->sent_messages = pqueue_new(); in dtls1_new()
103 if (!d1->buffered_messages || !d1->sent_messages) { in dtls1_new()
104 pqueue_free(d1->buffered_messages); in dtls1_new()
105 pqueue_free(d1->sent_messages); in dtls1_new()
106 OPENSSL_free(d1); in dtls1_new()
111 ssl->d1 = d1; in dtls1_new()
126 while ((item = pqueue_pop(ssl->d1->buffered_messages)) != NULL) { in dtls1_clear_queues()
132 while ((item = pqueue_pop(ssl->d1->sent_messages)) != NULL) { in dtls1_clear_queues()
142 if (ssl == NULL || ssl->d1 == NULL) { in dtls1_free()
148 pqueue_free(ssl->d1->buffered_messages); in dtls1_free()
149 pqueue_free(ssl->d1->sent_messages); in dtls1_free()
151 OPENSSL_free(ssl->d1); in dtls1_free()
152 ssl->d1 = NULL; in dtls1_free()
163 if (ssl->d1->next_timeout.tv_sec == 0 && ssl->d1->next_timeout.tv_usec == 0) { in dtls1_start_timer()
164 ssl->d1->timeout_duration = 1; in dtls1_start_timer()
168 get_current_time(ssl, &ssl->d1->next_timeout); in dtls1_start_timer()
171 ssl->d1->next_timeout.tv_sec += ssl->d1->timeout_duration; in dtls1_start_timer()
173 &ssl->d1->next_timeout); in dtls1_start_timer()
182 if (ssl->d1->next_timeout.tv_sec == 0 && ssl->d1->next_timeout.tv_usec == 0) { in DTLSv1_get_timeout()
191 if (ssl->d1->next_timeout.tv_sec < timenow.tv_sec || in DTLSv1_get_timeout()
192 (ssl->d1->next_timeout.tv_sec == timenow.tv_sec && in DTLSv1_get_timeout()
193 ssl->d1->next_timeout.tv_usec <= timenow.tv_usec)) { in DTLSv1_get_timeout()
199 memcpy(out, &ssl->d1->next_timeout, sizeof(struct timeval)); in DTLSv1_get_timeout()
234 ssl->d1->timeout_duration *= 2; in dtls1_double_timeout()
235 if (ssl->d1->timeout_duration > 60) { in dtls1_double_timeout()
236 ssl->d1->timeout_duration = 60; in dtls1_double_timeout()
243 ssl->d1->num_timeouts = 0; in dtls1_stop_timer()
244 memset(&ssl->d1->next_timeout, 0, sizeof(struct timeval)); in dtls1_stop_timer()
245 ssl->d1->timeout_duration = 1; in dtls1_stop_timer()
247 &ssl->d1->next_timeout); in dtls1_stop_timer()
253 ssl->d1->num_timeouts++; in dtls1_check_timeout_num()
256 if (ssl->d1->num_timeouts > DTLS1_MTU_TIMEOUTS && in dtls1_check_timeout_num()
261 ssl->d1->mtu = (unsigned)mtu; in dtls1_check_timeout_num()
265 if (ssl->d1->num_timeouts > DTLS1_MAX_TIMEOUTS) { in dtls1_check_timeout_num()
312 const struct hm_header_st *msg_hdr = &ssl->d1->w_msg_hdr; in dtls1_set_handshake_header()
316 ssl->d1->handshake_write_seq = ssl->d1->next_handshake_write_seq; in dtls1_set_handshake_header()
317 ssl->d1->next_handshake_write_seq++; in dtls1_set_handshake_header()
319 dtls1_set_message_header(ssl, htype, len, ssl->d1->handshake_write_seq, 0, in dtls1_set_handshake_header()