Lines Matching refs:d1

69     DTLS1_STATE *d1;
77 if ((d1 = OPENSSL_zalloc(sizeof(*d1))) == NULL) {
82 d1->buffered_messages = pqueue_new();
83 d1->sent_messages = pqueue_new();
86 d1->cookie_len = sizeof(s->d1->cookie);
89 d1->link_mtu = 0;
90 d1->mtu = 0;
92 if (d1->buffered_messages == NULL || d1->sent_messages == NULL) {
93 pqueue_free(d1->buffered_messages);
94 pqueue_free(d1->sent_messages);
95 OPENSSL_free(d1);
100 s->d1 = d1;
119 while ((item = pqueue_pop(s->d1->buffered_messages)) != NULL) {
131 while ((item = pqueue_pop(s->d1->sent_messages)) != NULL) {
145 if (s->d1 != NULL) {
147 pqueue_free(s->d1->buffered_messages);
148 pqueue_free(s->d1->sent_messages);
151 OPENSSL_free(s->d1);
152 s->d1 = NULL;
164 if (s->d1) {
165 DTLS_timer_cb timer_cb = s->d1->timer_cb;
167 buffered_messages = s->d1->buffered_messages;
168 sent_messages = s->d1->sent_messages;
169 mtu = s->d1->mtu;
170 link_mtu = s->d1->link_mtu;
174 memset(s->d1, 0, sizeof(*s->d1));
177 s->d1->timer_cb = timer_cb;
180 s->d1->cookie_len = sizeof(s->d1->cookie);
184 s->d1->mtu = mtu;
185 s->d1->link_mtu = link_mtu;
188 s->d1->buffered_messages = buffered_messages;
189 s->d1->sent_messages = sent_messages;
223 s->d1->link_mtu = larg;
234 s->d1->mtu = larg;
250 memset(&s->d1->next_timeout, 0, sizeof(s->d1->next_timeout));
259 if (s->d1->next_timeout.tv_sec == 0 && s->d1->next_timeout.tv_usec == 0) {
261 if (s->d1->timer_cb != NULL)
262 s->d1->timeout_duration_us = s->d1->timer_cb(s, 0);
264 s->d1->timeout_duration_us = 1000000;
268 get_current_time(&(s->d1->next_timeout));
272 sec = s->d1->timeout_duration_us / 1000000;
273 usec = s->d1->timeout_duration_us - (sec * 1000000);
275 s->d1->next_timeout.tv_sec += sec;
276 s->d1->next_timeout.tv_usec += usec;
278 if (s->d1->next_timeout.tv_usec >= 1000000) {
279 s->d1->next_timeout.tv_sec++;
280 s->d1->next_timeout.tv_usec -= 1000000;
284 &(s->d1->next_timeout));
292 if (s->d1->next_timeout.tv_sec == 0 && s->d1->next_timeout.tv_usec == 0) {
300 if (s->d1->next_timeout.tv_sec < timenow.tv_sec ||
301 (s->d1->next_timeout.tv_sec == timenow.tv_sec &&
302 s->d1->next_timeout.tv_usec <= timenow.tv_usec)) {
308 memcpy(timeleft, &(s->d1->next_timeout), sizeof(struct timeval));
347 s->d1->timeout_duration_us *= 2;
348 if (s->d1->timeout_duration_us > 60000000)
349 s->d1->timeout_duration_us = 60000000;
355 s->d1->timeout_num_alerts = 0;
356 memset(&s->d1->next_timeout, 0, sizeof(s->d1->next_timeout));
357 s->d1->timeout_duration_us = 1000000;
359 &(s->d1->next_timeout));
368 s->d1->timeout_num_alerts++;
371 if (s->d1->timeout_num_alerts > 2
375 if (mtu < s->d1->mtu)
376 s->d1->mtu = mtu;
379 if (s->d1->timeout_num_alerts > DTLS1_TMO_ALERT_COUNT) {
395 if (s->d1->timer_cb != NULL)
396 s->d1->timeout_duration_us = s->d1->timer_cb(s, s->d1->timeout_duration_us);
821 s->d1->handshake_read_seq = 1;
822 s->d1->handshake_write_seq = 1;
823 s->d1->next_handshake_write_seq = 1;
887 if (s->d1->link_mtu) {
888 s->d1->mtu =
889 s->d1->link_mtu - BIO_dgram_get_mtu_overhead(SSL_get_wbio(s));
890 s->d1->link_mtu = 0;
894 if (s->d1->mtu < dtls1_min_mtu(s)) {
896 s->d1->mtu =
903 if (s->d1->mtu < dtls1_min_mtu(s)) {
905 s->d1->mtu = dtls1_min_mtu(s);
907 (long)s->d1->mtu, NULL);
930 size_t mtu = s->d1->mtu;
964 s->d1->timer_cb = cb;