plugin-loader: Optionally use load option in each plugin section to load plugins
[strongswan.git] / src / libcharon / sa / task_manager.c
1 /*
2 * Copyright (C) 2011 Tobias Brunner
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 #include "task_manager.h"
17
18 #include <sa/ikev1/task_manager_v1.h>
19 #include <sa/ikev2/task_manager_v2.h>
20
21 /**
22 * See header
23 */
24 task_manager_t *task_manager_create(ike_sa_t *ike_sa)
25 {
26 switch (ike_sa->get_version(ike_sa))
27 {
28 case IKEV1:
29 #ifdef USE_IKEV1
30 return &task_manager_v1_create(ike_sa)->task_manager;
31 #endif
32 break;
33 case IKEV2:
34 #ifdef USE_IKEV2
35 return &task_manager_v2_create(ike_sa)->task_manager;
36 #endif
37 break;
38 default:
39 break;
40 }
41 return NULL;
42 }
43