2 * Copyright (C) 2007-2011 Tobias Brunner
3 * Copyright (C) 2007-2011 Martin Willi
4 * Hochschule fuer Technik Rapperswil
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 #include "task_manager_v1.h"
22 #include <sa/tasks/ike_vendor.h>
23 #include <sa/tasks/main_mode.h>
24 #include <sa/tasks/quick_mode.h>
25 #include <sa/tasks/xauth_request.h>
26 #include <sa/tasks/ike_vendor_v1.h>
27 #include <processing/jobs/retransmit_job.h>
28 #include <processing/jobs/delete_ike_sa_job.h>
30 typedef struct exchange_t exchange_t
;
33 * An exchange in the air, used do detect and handle retransmission
38 * Message ID used for this transaction
43 * generated packet for retransmission
48 typedef struct private_task_manager_t private_task_manager_t
;
51 * private data of the task manager
53 struct private_task_manager_t
{
58 task_manager_v1_t
public;
61 * associated IKE_SA we are serving
66 * RNG to create message IDs
71 * Exchange we are currently handling as responder
75 * Message ID of the exchange
80 * Hash of a previously received message
85 * packet for retransmission
92 * Exchange we are currently handling as initiator
96 * Message ID of the exchange
101 * Hash of a previously received message
106 * how many times we have retransmitted so far
111 * packet for retransmission
116 * type of the initated exchange
118 exchange_type_t type
;
123 * List of queued tasks not yet in action
125 linked_list_t
*queued_tasks
;
128 * List of active tasks, initiated by ourselve
130 linked_list_t
*active_tasks
;
133 * List of tasks initiated by peer
135 linked_list_t
*passive_tasks
;
138 * Number of times we retransmit messages before giving up
140 u_int retransmit_tries
;
143 * Retransmission timeout
145 double retransmit_timeout
;
148 * Base to calculate retransmission timeout
150 double retransmit_base
;
154 * flush all tasks in the task manager
156 static void flush(private_task_manager_t
*this)
158 this->queued_tasks
->destroy_offset(this->queued_tasks
,
159 offsetof(task_t
, destroy
));
160 this->queued_tasks
= linked_list_create();
161 this->passive_tasks
->destroy_offset(this->passive_tasks
,
162 offsetof(task_t
, destroy
));
163 this->passive_tasks
= linked_list_create();
164 this->active_tasks
->destroy_offset(this->active_tasks
,
165 offsetof(task_t
, destroy
));
166 this->active_tasks
= linked_list_create();
170 * move a task of a specific type from the queue to the active list
172 static bool activate_task(private_task_manager_t
*this, task_type_t type
)
174 enumerator_t
*enumerator
;
178 enumerator
= this->queued_tasks
->create_enumerator(this->queued_tasks
);
179 while (enumerator
->enumerate(enumerator
, (void**)&task
))
181 if (task
->get_type(task
) == type
)
183 DBG2(DBG_IKE
, " activating %N task", task_type_names
, type
);
184 this->queued_tasks
->remove_at(this->queued_tasks
, enumerator
);
185 this->active_tasks
->insert_last(this->active_tasks
, task
);
190 enumerator
->destroy(enumerator
);
194 METHOD(task_manager_t
, retransmit
, status_t
,
195 private_task_manager_t
*this, u_int32_t message_id
)
197 if (message_id
== this->initiating
.mid
)
203 if (this->initiating
.retransmitted
<= this->retransmit_tries
)
205 timeout
= (u_int32_t
)(this->retransmit_timeout
* 1000.0 *
206 pow(this->retransmit_base
, this->initiating
.retransmitted
));
210 DBG1(DBG_IKE
, "giving up after %d retransmits",
211 this->initiating
.retransmitted
- 1);
212 if (this->ike_sa
->get_state(this->ike_sa
) != IKE_CONNECTING
)
214 charon
->bus
->ike_updown(charon
->bus
, this->ike_sa
, FALSE
);
219 if (this->initiating
.retransmitted
)
221 DBG1(DBG_IKE
, "retransmit %d of request with message ID %d",
222 this->initiating
.retransmitted
, message_id
);
224 packet
= this->initiating
.packet
->clone(this->initiating
.packet
);
225 charon
->sender
->send(charon
->sender
, packet
);
227 this->initiating
.retransmitted
++;
228 job
= (job_t
*)retransmit_job_create(this->initiating
.mid
,
229 this->ike_sa
->get_id(this->ike_sa
));
230 lib
->scheduler
->schedule_job_ms(lib
->scheduler
, job
, timeout
);
235 void migrate_tasks(linked_list_t
*from
, linked_list_t
*to
)
237 enumerator_t
*enumerator
;
240 enumerator
= from
->create_enumerator(from
);
241 while(enumerator
->enumerate(enumerator
, (void**)&task
))
243 DBG4(DBG_IKE
, " Migrating %N task to new queue", task_type_names
, task
->get_type(task
));
244 if(task
->swap_initiator
)
246 task
->swap_initiator(task
);
248 to
->insert_last(to
, task
);
249 from
->remove_at(from
, enumerator
);
251 enumerator
->destroy(enumerator
);
254 METHOD(task_manager_t
, initiate
, status_t
,
255 private_task_manager_t
*this)
257 enumerator_t
*enumerator
;
262 exchange_type_t exchange
= EXCHANGE_TYPE_UNDEFINED
;
263 bool new_mid
= FALSE
;
267 DBG1(DBG_IKE
, "no RNG supported");
271 if (this->initiating
.type
!= EXCHANGE_TYPE_UNDEFINED
)
273 DBG2(DBG_IKE
, "delaying task initiation, %N exchange in progress",
274 exchange_type_names
, this->initiating
.type
);
275 /* do not initiate if we already have a message in the air */
279 if (this->active_tasks
->get_count(this->active_tasks
) == 0)
281 DBG2(DBG_IKE
, "activating new tasks");
282 switch (this->ike_sa
->get_state(this->ike_sa
))
285 activate_task(this, TASK_VENDOR_V1
);
286 if (activate_task(this, TASK_MAIN_MODE
))
291 case IKE_ESTABLISHED
:
292 if (activate_task(this, TASK_QUICK_MODE
))
294 exchange
= QUICK_MODE
;
298 if (activate_task(this, TASK_XAUTH_REQUEST
))
300 exchange
= TRANSACTION
;
311 DBG2(DBG_IKE
, "reinitiating already active tasks");
312 enumerator
= this->active_tasks
->create_enumerator(this->active_tasks
);
313 while (enumerator
->enumerate(enumerator
, (void**)&task
))
315 DBG2(DBG_IKE
, " %N task", task_type_names
, task
->get_type(task
));
316 switch (task
->get_type(task
))
321 case TASK_QUICK_MODE
:
322 exchange
= QUICK_MODE
;
324 case TASK_XAUTH_REQUEST
:
325 exchange
= TRANSACTION
;
333 enumerator
->destroy(enumerator
);
336 if (exchange
== EXCHANGE_TYPE_UNDEFINED
)
338 DBG2(DBG_IKE
, "nothing to initiate");
339 /* nothing to do yet... */
343 me
= this->ike_sa
->get_my_host(this->ike_sa
);
344 other
= this->ike_sa
->get_other_host(this->ike_sa
);
346 message
= message_create(IKEV1_MAJOR_VERSION
, IKEV1_MINOR_VERSION
);
349 this->rng
->get_bytes(this->rng
, sizeof(this->initiating
.mid
),
350 (void*)&this->initiating
.mid
);
352 message
->set_message_id(message
, this->initiating
.mid
);
353 message
->set_source(message
, me
->clone(me
));
354 message
->set_destination(message
, other
->clone(other
));
355 message
->set_exchange_type(message
, exchange
);
356 this->initiating
.type
= exchange
;
357 this->initiating
.retransmitted
= 0;
359 enumerator
= this->active_tasks
->create_enumerator(this->active_tasks
);
360 while (enumerator
->enumerate(enumerator
, (void*)&task
))
362 switch (task
->build(task
, message
))
365 /* task completed, remove it */
366 this->active_tasks
->remove_at(this->active_tasks
, enumerator
);
370 /* task completed, remove it */
371 this->active_tasks
->remove_at(this->active_tasks
, enumerator
);
373 /* migrate the remaining active tasks to the passive queue */
374 migrate_tasks(this->active_tasks
, this->passive_tasks
);
377 /* processed, but task needs another exchange */
381 if (this->ike_sa
->get_state(this->ike_sa
) != IKE_CONNECTING
)
383 charon
->bus
->ike_updown(charon
->bus
, this->ike_sa
, FALSE
);
387 /* critical failure, destroy IKE_SA */
388 enumerator
->destroy(enumerator
);
389 message
->destroy(message
);
394 enumerator
->destroy(enumerator
);
396 /* update exchange type if a task changed it */
397 this->initiating
.type
= message
->get_exchange_type(message
);
399 status
= this->ike_sa
->generate_message(this->ike_sa
, message
,
400 &this->initiating
.packet
);
401 if (status
!= SUCCESS
)
403 /* message generation failed. There is nothing more to do than to
405 message
->destroy(message
);
407 charon
->bus
->ike_updown(charon
->bus
, this->ike_sa
, FALSE
);
410 message
->destroy(message
);
412 charon
->sender
->send(charon
->sender
,
413 this->initiating
.packet
->clone(this->initiating
.packet
));
419 * handle exchange collisions
421 static bool handle_collisions(private_task_manager_t
*this, task_t
*task
)
427 * build a response depending on the "passive" task list
429 static status_t
build_response(private_task_manager_t
*this, message_t
*request
)
431 enumerator_t
*enumerator
;
437 bool migrate
= FALSE
;
439 me
= request
->get_destination(request
);
440 other
= request
->get_source(request
);
442 message
= message_create(IKEV1_MAJOR_VERSION
, IKEV1_MINOR_VERSION
);
443 message
->set_exchange_type(message
, request
->get_exchange_type(request
));
444 /* send response along the path the request came in */
445 message
->set_source(message
, me
->clone(me
));
446 message
->set_destination(message
, other
->clone(other
));
447 message
->set_message_id(message
, request
->get_message_id(request
));
448 message
->set_request(message
, FALSE
);
450 enumerator
= this->passive_tasks
->create_enumerator(this->passive_tasks
);
451 while (enumerator
->enumerate(enumerator
, (void*)&task
))
453 switch (task
->build(task
, message
))
459 /* task completed, remove it */
460 this->passive_tasks
->remove_at(this->passive_tasks
, enumerator
);
461 if (!handle_collisions(this, task
))
467 /* processed, but task needs another exchange */
468 if (handle_collisions(this, task
))
470 this->passive_tasks
->remove_at(this->passive_tasks
,
476 charon
->bus
->ike_updown(charon
->bus
, this->ike_sa
, FALSE
);
479 /* destroy IKE_SA, but SEND response first */
488 enumerator
->destroy(enumerator
);
490 /* message complete, send it */
491 DESTROY_IF(this->responding
.packet
);
492 this->responding
.packet
= NULL
;
493 status
= this->ike_sa
->generate_message(this->ike_sa
, message
,
494 &this->responding
.packet
);
495 message
->destroy(message
);
496 if (status
!= SUCCESS
)
498 charon
->bus
->ike_updown(charon
->bus
, this->ike_sa
, FALSE
);
502 charon
->sender
->send(charon
->sender
,
503 this->responding
.packet
->clone(this->responding
.packet
));
507 migrate_tasks(this->passive_tasks
, this->queued_tasks
);
508 /* Kick off the newly installed tasks */
520 * handle an incoming request message
522 static status_t
process_request(private_task_manager_t
*this,
525 enumerator_t
*enumerator
;
528 if (this->passive_tasks
->get_count(this->passive_tasks
) == 0)
529 { /* create tasks depending on request type, if not already some queued */
530 switch (message
->get_exchange_type(message
))
533 task
= (task_t
*)ike_vendor_v1_create(this->ike_sa
, FALSE
);
534 this->passive_tasks
->insert_last(this->passive_tasks
, task
);
535 task
= (task_t
*)main_mode_create(this->ike_sa
, FALSE
);
536 this->passive_tasks
->insert_last(this->passive_tasks
, task
);
537 task
= (task_t
*)xauth_request_create(this->ike_sa
, FALSE
);
538 this->passive_tasks
->insert_last(this->passive_tasks
, task
);
541 /* TODO-IKEv1: agressive mode */
544 task
= (task_t
*)quick_mode_create(this->ike_sa
, NULL
,
546 this->passive_tasks
->insert_last(this->passive_tasks
, task
);
548 case INFORMATIONAL_V1
:
549 /* TODO-IKEv1: informational */
555 /* let the tasks process the message */
556 enumerator
= this->passive_tasks
->create_enumerator(this->passive_tasks
);
557 while (enumerator
->enumerate(enumerator
, (void*)&task
))
559 switch (task
->process(task
, message
))
562 /* task completed, remove it */
563 this->passive_tasks
->remove_at(this->passive_tasks
, enumerator
);
565 enumerator
->destroy(enumerator
);
568 /* task completed, remove it */
569 this->passive_tasks
->remove_at(this->passive_tasks
, enumerator
);
571 enumerator
->destroy(enumerator
);
572 /* migrate the remaining tasks */
573 migrate_tasks(this->passive_tasks
, this->queued_tasks
);
574 /* Kick off the newly installed tasks */
578 /* processed, but task needs at least another call to build() */
582 charon
->bus
->ike_updown(charon
->bus
, this->ike_sa
, FALSE
);
585 /* critical failure, destroy IKE_SA */
586 this->passive_tasks
->remove_at(this->passive_tasks
, enumerator
);
587 enumerator
->destroy(enumerator
);
592 enumerator
->destroy(enumerator
);
594 return build_response(this, message
);
598 * handle an incoming response message
600 static status_t
process_response(private_task_manager_t
*this,
603 enumerator_t
*enumerator
;
606 if (message
->get_exchange_type(message
) != this->initiating
.type
)
608 DBG1(DBG_IKE
, "received %N response, but expected %N",
609 exchange_type_names
, message
->get_exchange_type(message
),
610 exchange_type_names
, this->initiating
.type
);
611 charon
->bus
->ike_updown(charon
->bus
, this->ike_sa
, FALSE
);
615 enumerator
= this->active_tasks
->create_enumerator(this->active_tasks
);
616 while (enumerator
->enumerate(enumerator
, (void*)&task
))
618 switch (task
->process(task
, message
))
621 /* task completed, remove it */
622 this->active_tasks
->remove_at(this->active_tasks
, enumerator
);
626 /* processed, but task needs another exchange */
630 charon
->bus
->ike_updown(charon
->bus
, this->ike_sa
, FALSE
);
633 /* critical failure, destroy IKE_SA */
634 this->active_tasks
->remove_at(this->active_tasks
, enumerator
);
635 enumerator
->destroy(enumerator
);
640 enumerator
->destroy(enumerator
);
642 this->initiating
.type
= EXCHANGE_TYPE_UNDEFINED
;
643 this->initiating
.packet
->destroy(this->initiating
.packet
);
644 this->initiating
.packet
= NULL
;
646 return initiate(this);
650 * Send a notify in a separate INFORMATIONAL exchange back to the sender.
652 static void send_notify_response(private_task_manager_t
*this,
653 message_t
*request
, notify_type_t type
,
661 if (request
->get_exchange_type(request
) == INFORMATIONAL_V1
)
662 { /* don't respond to INFORMATIONAL requests to avoid a notify war */
663 DBG1(DBG_IKE
, "ignore malformed INFORMATIONAL request");
667 response
= message_create(IKEV1_MAJOR_VERSION
, IKEV1_MINOR_VERSION
);
668 response
->set_exchange_type(response
, INFORMATIONAL_V1
);
669 response
->set_request(response
, TRUE
);
670 this->rng
->get_bytes(this->rng
, sizeof(mid
), (void*)&mid
);
671 response
->set_message_id(response
, mid
);
672 response
->add_notify(response
, FALSE
, type
, data
);
673 me
= this->ike_sa
->get_my_host(this->ike_sa
);
674 if (me
->is_anyaddr(me
))
676 me
= request
->get_destination(request
);
677 this->ike_sa
->set_my_host(this->ike_sa
, me
->clone(me
));
679 other
= this->ike_sa
->get_other_host(this->ike_sa
);
680 if (other
->is_anyaddr(other
))
682 other
= request
->get_source(request
);
683 this->ike_sa
->set_other_host(this->ike_sa
, other
->clone(other
));
685 response
->set_source(response
, me
->clone(me
));
686 response
->set_destination(response
, other
->clone(other
));
687 if (this->ike_sa
->generate_message(this->ike_sa
, response
,
690 charon
->sender
->send(charon
->sender
, packet
);
692 response
->destroy(response
);
696 * Parse the given message and verify that it is valid.
698 static status_t
parse_message(private_task_manager_t
*this, message_t
*msg
)
702 status
= msg
->parse_body(msg
, this->ike_sa
->get_keymat(this->ike_sa
));
704 if (status
!= SUCCESS
)
709 DBG1(DBG_IKE
, "unsupported exchange type");
710 send_notify_response(this, msg
,
711 INVALID_EXCHANGE_TYPE
, chunk_empty
);
714 DBG1(DBG_IKE
, "message parsing failed");
715 send_notify_response(this, msg
,
716 PAYLOAD_MALFORMED
, chunk_empty
);
719 DBG1(DBG_IKE
, "message verification failed");
720 send_notify_response(this, msg
,
721 PAYLOAD_MALFORMED
, chunk_empty
);
724 DBG1(DBG_IKE
, "integrity check failed");
725 send_notify_response(this, msg
,
726 INVALID_HASH_INFORMATION
, chunk_empty
);
729 DBG1(DBG_IKE
, "found encrypted message, but no keys available");
730 send_notify_response(this, msg
,
731 PAYLOAD_MALFORMED
, chunk_empty
);
735 DBG1(DBG_IKE
, "%N %s with message ID %d processing failed",
736 exchange_type_names
, msg
->get_exchange_type(msg
),
737 msg
->get_request(msg
) ?
"request" : "response",
738 msg
->get_message_id(msg
));
740 if (this->ike_sa
->get_state(this->ike_sa
) == IKE_CREATED
)
741 { /* invalid initiation attempt, close SA */
748 METHOD(task_manager_t
, process_message
, status_t
,
749 private_task_manager_t
*this, message_t
*msg
)
755 /* TODO-IKEv1: update hosts more selectively */
756 me
= msg
->get_destination(msg
);
757 other
= msg
->get_source(msg
);
758 mid
= msg
->get_message_id(msg
);
760 if ((mid
&& mid
== this->initiating
.mid
) ||
761 (this->initiating
.mid
== 0 &&
762 this->active_tasks
->get_count(this->active_tasks
)))
764 msg
->set_request(msg
, FALSE
);
765 status
= parse_message(this, msg
);
766 if (status
!= SUCCESS
)
770 this->ike_sa
->set_statistic(this->ike_sa
, STAT_INBOUND
,
771 time_monotonic(NULL
));
772 this->ike_sa
->update_hosts(this->ike_sa
, me
, other
, TRUE
);
773 charon
->bus
->message(charon
->bus
, msg
, FALSE
);
774 if (process_response(this, msg
) != SUCCESS
)
782 hash
= chunk_hash(msg
->get_packet_data(msg
));
783 if (hash
== this->responding
.hash
)
785 DBG1(DBG_IKE
, "received retransmit of request with ID %d, "
786 "retransmitting response", mid
);
787 charon
->sender
->send(charon
->sender
,
788 this->responding
.packet
->clone(this->responding
.packet
));
791 msg
->set_request(msg
, TRUE
);
792 status
= parse_message(this, msg
);
793 if (status
!= SUCCESS
)
797 /* if this IKE_SA is virgin, we check for a config */
798 if (this->ike_sa
->get_ike_cfg(this->ike_sa
) == NULL
)
800 ike_sa_id_t
*ike_sa_id
;
803 ike_cfg
= charon
->backends
->get_ike_cfg(charon
->backends
, me
, other
);
806 /* no config found for these hosts, destroy */
807 DBG1(DBG_IKE
, "no IKE config found for %H...%H, sending %N",
808 me
, other
, notify_type_names
, NO_PROPOSAL_CHOSEN
);
809 send_notify_response(this, msg
,
810 NO_PROPOSAL_CHOSEN
, chunk_empty
);
813 this->ike_sa
->set_ike_cfg(this->ike_sa
, ike_cfg
);
814 ike_cfg
->destroy(ike_cfg
);
815 /* add a timeout if peer does not establish it completely */
816 ike_sa_id
= this->ike_sa
->get_id(this->ike_sa
);
817 job
= (job_t
*)delete_ike_sa_job_create(ike_sa_id
, FALSE
);
818 lib
->scheduler
->schedule_job(lib
->scheduler
, job
,
819 lib
->settings
->get_int(lib
->settings
,
820 "charon.half_open_timeout", HALF_OPEN_IKE_SA_TIMEOUT
));
822 this->ike_sa
->set_statistic(this->ike_sa
, STAT_INBOUND
,
823 time_monotonic(NULL
));
824 this->ike_sa
->update_hosts(this->ike_sa
, me
, other
, TRUE
);
825 charon
->bus
->message(charon
->bus
, msg
, TRUE
);
826 if (process_request(this, msg
) != SUCCESS
)
832 this->responding
.mid
= mid
;
833 this->responding
.hash
= hash
;
838 METHOD(task_manager_t
, queue_task
, void,
839 private_task_manager_t
*this, task_t
*task
)
841 DBG2(DBG_IKE
, "queueing %N task", task_type_names
, task
->get_type(task
));
842 this->queued_tasks
->insert_last(this->queued_tasks
, task
);
845 METHOD(task_manager_t
, adopt_tasks
, void,
846 private_task_manager_t
*this, task_manager_t
*other_public
)
848 private_task_manager_t
*other
= (private_task_manager_t
*)other_public
;
851 /* move queued tasks from other to this */
852 while (other
->queued_tasks
->remove_last(other
->queued_tasks
,
853 (void**)&task
) == SUCCESS
)
855 DBG2(DBG_IKE
, "migrating %N task", task_type_names
, task
->get_type(task
));
856 task
->migrate(task
, this->ike_sa
);
857 this->queued_tasks
->insert_first(this->queued_tasks
, task
);
861 METHOD(task_manager_t
, busy
, bool,
862 private_task_manager_t
*this)
864 return (this->active_tasks
->get_count(this->active_tasks
) > 0);
867 METHOD(task_manager_t
, incr_mid
, void,
868 private_task_manager_t
*this, bool initiate
)
872 METHOD(task_manager_t
, reset
, void,
873 private_task_manager_t
*this, u_int32_t initiate
, u_int32_t respond
)
877 METHOD(task_manager_t
, create_task_enumerator
, enumerator_t
*,
878 private_task_manager_t
*this, task_queue_t queue
)
882 case TASK_QUEUE_ACTIVE
:
883 return this->active_tasks
->create_enumerator(this->active_tasks
);
884 case TASK_QUEUE_PASSIVE
:
885 return this->passive_tasks
->create_enumerator(this->passive_tasks
);
886 case TASK_QUEUE_QUEUED
:
887 return this->queued_tasks
->create_enumerator(this->queued_tasks
);
889 return enumerator_create_empty();
893 METHOD(task_manager_t
, destroy
, void,
894 private_task_manager_t
*this)
898 this->active_tasks
->destroy(this->active_tasks
);
899 this->queued_tasks
->destroy(this->queued_tasks
);
900 this->passive_tasks
->destroy(this->passive_tasks
);
902 DESTROY_IF(this->responding
.packet
);
903 DESTROY_IF(this->initiating
.packet
);
904 DESTROY_IF(this->rng
);
911 task_manager_v1_t
*task_manager_v1_create(ike_sa_t
*ike_sa
)
913 private_task_manager_t
*this;
918 .process_message
= _process_message
,
919 .queue_task
= _queue_task
,
920 .initiate
= _initiate
,
921 .retransmit
= _retransmit
,
922 .incr_mid
= _incr_mid
,
924 .adopt_tasks
= _adopt_tasks
,
926 .create_task_enumerator
= _create_task_enumerator
,
931 .initiating
.type
= EXCHANGE_TYPE_UNDEFINED
,
932 .rng
= lib
->crypto
->create_rng(lib
->crypto
, RNG_WEAK
),
933 .queued_tasks
= linked_list_create(),
934 .active_tasks
= linked_list_create(),
935 .passive_tasks
= linked_list_create(),
936 .retransmit_tries
= lib
->settings
->get_int(lib
->settings
,
937 "charon.retransmit_tries", RETRANSMIT_TRIES
),
938 .retransmit_timeout
= lib
->settings
->get_double(lib
->settings
,
939 "charon.retransmit_timeout", RETRANSMIT_TIMEOUT
),
940 .retransmit_base
= lib
->settings
->get_double(lib
->settings
,
941 "charon.retransmit_base", RETRANSMIT_BASE
),
944 return &this->public;