eea2320e0fba56cb140996a678e611e585b3282a
[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 #include "task_manager_v1.h"
18 #include "task_manager_v2.h"
19
20 /**
21 * See header
22 */
23 task_manager_t *task_manager_create(ike_sa_t *ike_sa)
24 {
25 switch (ike_sa->get_version(ike_sa))
26 {
27 case IKEV1:
28 return &task_manager_v1_create(ike_sa)->task_manager;
29 case IKEV2:
30 return &task_manager_v2_create(ike_sa)->task_manager;
31 }
32 return NULL;
33 }