Lines Matching refs:d1

84 	if ((s->d1 = calloc(1, sizeof(*s->d1))) == NULL)
87 if ((s->d1->unprocessed_rcds.q = pqueue_new()) == NULL)
89 if ((s->d1->buffered_messages = pqueue_new()) == NULL)
91 if ((s->d1->sent_messages = pqueue_new()) == NULL)
93 if ((s->d1->buffered_app_data.q = pqueue_new()) == NULL)
97 s->d1->cookie_len = sizeof(s->d1->cookie);
158 dtls1_drain_records(s->d1->unprocessed_rcds.q);
159 dtls1_drain_fragments(s->d1->buffered_messages);
160 dtls1_drain_fragments(s->d1->sent_messages);
161 dtls1_drain_rcontents(s->d1->buffered_app_data.q);
172 if (s->d1 == NULL)
177 pqueue_free(s->d1->unprocessed_rcds.q);
178 pqueue_free(s->d1->buffered_messages);
179 pqueue_free(s->d1->sent_messages);
180 pqueue_free(s->d1->buffered_app_data.q);
182 freezero(s->d1, sizeof(*s->d1));
183 s->d1 = NULL;
195 if (s->d1) {
196 unprocessed_rcds = s->d1->unprocessed_rcds.q;
197 buffered_messages = s->d1->buffered_messages;
198 sent_messages = s->d1->sent_messages;
199 buffered_app_data = s->d1->buffered_app_data.q;
200 mtu = s->d1->mtu;
204 memset(s->d1, 0, sizeof(*s->d1));
206 s->d1->unprocessed_rcds.epoch =
210 s->d1->cookie_len = sizeof(s->d1->cookie);
214 s->d1->mtu = mtu;
217 s->d1->unprocessed_rcds.q = unprocessed_rcds;
218 s->d1->buffered_messages = buffered_messages;
219 s->d1->sent_messages = sent_messages;
220 s->d1->buffered_app_data.q = buffered_app_data;
279 if (s->d1->next_timeout.tv_sec == 0 && s->d1->next_timeout.tv_usec == 0) {
280 s->d1->timeout_duration = 1;
284 gettimeofday(&(s->d1->next_timeout), NULL);
287 s->d1->next_timeout.tv_sec += s->d1->timeout_duration;
289 &s->d1->next_timeout);
298 if (s->d1->next_timeout.tv_sec == 0 && s->d1->next_timeout.tv_usec == 0) {
306 if (s->d1->next_timeout.tv_sec < timenow.tv_sec ||
307 (s->d1->next_timeout.tv_sec == timenow.tv_sec &&
308 s->d1->next_timeout.tv_usec <= timenow.tv_usec)) {
314 memcpy(timeleft, &(s->d1->next_timeout), sizeof(struct timeval));
356 s->d1->timeout_duration *= 2;
357 if (s->d1->timeout_duration > 60)
358 s->d1->timeout_duration = 60;
366 memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st));
367 memset(&(s->d1->next_timeout), 0, sizeof(struct timeval));
368 s->d1->timeout_duration = 1;
370 &(s->d1->next_timeout));
378 s->d1->timeout.num_alerts++;
381 if (s->d1->timeout.num_alerts > 2) {
382 s->d1->mtu = BIO_ctrl(SSL_get_wbio(s),
387 if (s->d1->timeout.num_alerts > DTLS1_TMO_ALERT_COUNT) {
409 s->d1->timeout.read_timeouts++;
410 if (s->d1->timeout.read_timeouts > DTLS1_TMO_READ_COUNT) {
411 s->d1->timeout.read_timeouts = 1;
427 s->d1->listen = 1;