Added factory function to create task_manager_t implementations.
This commit is contained in:
@@ -67,7 +67,7 @@ sa/child_sa.c sa/child_sa.h \
|
||||
sa/ike_sa.c sa/ike_sa.h \
|
||||
sa/ike_sa_id.c sa/ike_sa_id.h \
|
||||
sa/ike_sa_manager.c sa/ike_sa_manager.h \
|
||||
sa/task_manager.h sa/task_manager_v2.c sa/task_manager_v2.h \
|
||||
sa/task_manager.h sa/task_manager.c sa/task_manager_v2.c sa/task_manager_v2.h \
|
||||
sa/task_manager_v1.c sa/task_manager_v1.h \
|
||||
sa/keymat.h sa/keymat.c sa/keymat_v2.c sa/keymat_v2.h \
|
||||
sa/keymat_v1.c sa/keymat_v1.h \
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <daemon.h>
|
||||
#include <utils/linked_list.h>
|
||||
#include <utils/lexparser.h>
|
||||
#include <sa/task_manager_v2.h>
|
||||
#include <sa/tasks/ike_init.h>
|
||||
#include <sa/tasks/ike_natd.h>
|
||||
#include <sa/tasks/ike_mobike.h>
|
||||
@@ -2225,7 +2224,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, ike_version_t version)
|
||||
"charon.keep_alive", KEEPALIVE_INTERVAL),
|
||||
);
|
||||
|
||||
this->task_manager = &(task_manager_v2_create(&this->public)->task_manager);
|
||||
this->task_manager = task_manager_create(&this->public);
|
||||
this->my_host->set_port(this->my_host, IKEV2_UDP_PORT);
|
||||
|
||||
return &this->public;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Tobias Brunner
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#include "task_manager.h"
|
||||
#include "task_manager_v1.h"
|
||||
#include "task_manager_v2.h"
|
||||
|
||||
/**
|
||||
* See header
|
||||
*/
|
||||
task_manager_t *task_manager_create(ike_sa_t *ike_sa)
|
||||
{
|
||||
switch (ike_sa->get_version(ike_sa))
|
||||
{
|
||||
case IKEV1:
|
||||
return &task_manager_v1_create(ike_sa)->task_manager;
|
||||
case IKEV2:
|
||||
return &task_manager_v2_create(ike_sa)->task_manager;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user