summaryrefslogtreecommitdiff
path: root/src/charon/control
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 20:30:44 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 20:30:44 +0000
commit74f0bbfc53cb5fa519e4e27ece53735ab51b397c (patch)
tree0dbab9c835be15577ff05b474b6361bb326d66ce /src/charon/control
parent5c1fa2516bda1ccf8eb00178c0beb196c2020a94 (diff)
downloadvyos-strongswan-74f0bbfc53cb5fa519e4e27ece53735ab51b397c.tar.gz
vyos-strongswan-74f0bbfc53cb5fa519e4e27ece53735ab51b397c.zip
- New upstream release.
Diffstat (limited to 'src/charon/control')
-rw-r--r--src/charon/control/controller.c61
-rw-r--r--src/charon/control/controller.h8
2 files changed, 38 insertions, 31 deletions
diff --git a/src/charon/control/controller.c b/src/charon/control/controller.c
index 2d1decd88..c124f439a 100644
--- a/src/charon/control/controller.c
+++ b/src/charon/control/controller.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * $Id: controller.c 3820 2008-04-17 11:22:37Z martin $
+ * $Id: controller.c 4192 2008-07-18 15:51:40Z martin $
*/
#include "controller.h"
@@ -118,21 +118,22 @@ static enumerator_t* create_ike_sa_enumerator(controller_t *this)
*/
static bool initiate_listener(interface_bus_listener_t *this, signal_t signal,
level_t level, int thread, ike_sa_t *ike_sa,
- char* format, va_list args)
+ void* data, char* format, va_list args)
{
if (this->ike_sa == ike_sa)
{
- if (!this->callback(this->param, signal, level, ike_sa, format, args))
+ if (!this->callback(this->param, signal, level, ike_sa, data,
+ format, args))
{
return FALSE;
}
switch (signal)
{
- case CHILD_UP_SUCCESS:
+ case CHD_UP_SUCCESS:
this->status = SUCCESS;
return FALSE;
case IKE_UP_FAILED:
- case CHILD_UP_FAILED:
+ case CHD_UP_FAILED:
return FALSE;
default:
break;
@@ -200,11 +201,12 @@ static status_t initiate(private_controller_t *this,
*/
static bool terminate_ike_listener(interface_bus_listener_t *this, signal_t signal,
level_t level, int thread, ike_sa_t *ike_sa,
- char* format, va_list args)
+ void* data, char* format, va_list args)
{
if (this->ike_sa == ike_sa)
{
- if (!this->callback(this->param, signal, level, ike_sa, format, args))
+ if (!this->callback(this->param, signal, level, ike_sa,
+ data, format, args))
{
return FALSE;
}
@@ -234,7 +236,7 @@ static status_t terminate_ike_execute(interface_job_t *job)
listener->id, FALSE);
if (ike_sa == NULL)
{
- SIG(IKE_DOWN_FAILED, "unable to terminate, IKE_SA with "
+ SIG_IKE(DOWN_FAILED, "unable to terminate, IKE_SA with "
"ID %d not found", listener->id);
return NOT_FOUND;
}
@@ -277,22 +279,23 @@ static status_t terminate_ike(controller_t *this, u_int32_t unique_id,
*/
static bool terminate_child_listener(interface_bus_listener_t *this, signal_t signal,
level_t level, int thread, ike_sa_t *ike_sa,
- char* format, va_list args)
+ void* data, char* format, va_list args)
{
if (this->ike_sa == ike_sa)
{
- if (!this->callback(this->param, signal, level, ike_sa, format, args))
+ if (!this->callback(this->param, signal, level, ike_sa,
+ data, format, args))
{
return FALSE;
}
switch (signal)
{
- case CHILD_DOWN_SUCCESS:
+ case CHD_DOWN_SUCCESS:
case IKE_DOWN_SUCCESS:
this->status = SUCCESS;
return FALSE;
case IKE_DOWN_FAILED:
- case CHILD_DOWN_FAILED:
+ case CHD_DOWN_FAILED:
return FALSE;
default:
break;
@@ -315,8 +318,8 @@ static status_t terminate_child_execute(interface_job_t *job)
listener->id, TRUE);
if (ike_sa == NULL)
{
- SIG(CHILD_DOWN_FAILED, "unable to terminate, CHILD_SA with "
- "ID %d not found", listener->id);
+ SIG_CHD(DOWN_FAILED, NULL, "unable to terminate, CHILD_SA with "
+ "ID %d not found", listener->id);
return NOT_FOUND;
}
listener->ike_sa = ike_sa;
@@ -335,8 +338,8 @@ static status_t terminate_child_execute(interface_job_t *job)
if (child_sa == NULL)
{
- SIG(CHILD_DOWN_FAILED, "unable to terminate, established CHILD_SA with "
- "ID %d not found", listener->id);
+ SIG_CHD(DOWN_FAILED, NULL, "unable to terminate, established "
+ "CHILD_SA with ID %d not found", listener->id);
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
return NOT_FOUND;
}
@@ -380,20 +383,21 @@ static status_t terminate_child(controller_t *this, u_int32_t reqid,
*/
static bool route_listener(interface_bus_listener_t *this, signal_t signal,
level_t level, int thread, ike_sa_t *ike_sa,
- char* format, va_list args)
+ void* data, char* format, va_list args)
{
if (this->ike_sa == ike_sa)
{
- if (!this->callback(this->param, signal, level, ike_sa, format, args))
+ if (!this->callback(this->param, signal, level, ike_sa,
+ data, format, args))
{
return FALSE;
}
switch (signal)
{
- case CHILD_ROUTE_SUCCESS:
+ case CHD_ROUTE_SUCCESS:
this->status = SUCCESS;
return FALSE;
- case CHILD_ROUTE_FAILED:
+ case CHD_ROUTE_FAILED:
return FALSE;
default:
break;
@@ -458,20 +462,21 @@ static status_t route(controller_t *this,
*/
static bool unroute_listener(interface_bus_listener_t *this, signal_t signal,
level_t level, int thread, ike_sa_t *ike_sa,
- char* format, va_list args)
+ void* data, char* format, va_list args)
{
if (this->ike_sa == ike_sa)
{
- if (!this->callback(this->param, signal, level, ike_sa, format, args))
+ if (!this->callback(this->param, signal, level, ike_sa,
+ data, format, args))
{
return FALSE;
}
switch (signal)
{
- case CHILD_UNROUTE_SUCCESS:
+ case CHD_UNROUTE_SUCCESS:
this->status = SUCCESS;
return FALSE;
- case CHILD_UNROUTE_FAILED:
+ case CHD_UNROUTE_FAILED:
return FALSE;
default:
break;
@@ -491,8 +496,8 @@ static status_t unroute_execute(interface_job_t *job)
listener->id, TRUE);
if (ike_sa == NULL)
{
- SIG(CHILD_DOWN_FAILED, "unable to unroute, CHILD_SA with "
- "ID %d not found", listener->id);
+ SIG_CHD(DOWN_FAILED, NULL, "unable to unroute, CHILD_SA with "
+ "ID %d not found", listener->id);
return NOT_FOUND;
}
listener->ike_sa = ike_sa;
@@ -533,7 +538,7 @@ static status_t unroute(controller_t *this, u_int32_t reqid,
* See header
*/
bool controller_cb_empty(void *param, signal_t signal, level_t level,
- ike_sa_t *ike_sa, char *format, va_list args)
+ ike_sa_t *ike_sa, void *data, char *format, va_list args)
{
return TRUE;
}
@@ -554,7 +559,7 @@ controller_t *controller_create(void)
private_controller_t *this = malloc_thing(private_controller_t);
this->public.create_ike_sa_enumerator = (enumerator_t*(*)(controller_t*))create_ike_sa_enumerator;
- this->public.initiate = (status_t(*)(controller_t*,peer_cfg_t*,child_cfg_t*,bool(*)(void*,signal_t,level_t,ike_sa_t*,char*,va_list),void*))initiate;
+ this->public.initiate = (status_t(*)(controller_t*,peer_cfg_t*,child_cfg_t*,controller_cb_t,void*))initiate;
this->public.terminate_ike = (status_t(*)(controller_t*,u_int32_t,controller_cb_t, void*))terminate_ike;
this->public.terminate_child = (status_t(*)(controller_t*,u_int32_t,controller_cb_t, void *param))terminate_child;
this->public.route = (status_t(*)(controller_t*,peer_cfg_t*, child_cfg_t*,controller_cb_t,void*))route;
diff --git a/src/charon/control/controller.h b/src/charon/control/controller.h
index 643611965..f40af0260 100644
--- a/src/charon/control/controller.h
+++ b/src/charon/control/controller.h
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * $Id: controller.h 3804 2008-04-14 11:37:46Z martin $
+ * $Id: controller.h 4192 2008-07-18 15:51:40Z martin $
*/
/**
@@ -37,7 +37,8 @@
* @return FALSE to return from invoked function
*/
typedef bool(*controller_cb_t)(void* param, signal_t signal, level_t level,
- ike_sa_t* ike_sa, char* format, va_list args);
+ ike_sa_t* ike_sa, void *data,
+ char* format, va_list args);
/**
* Empty callback function for controller_t functions.
@@ -46,7 +47,8 @@ typedef bool(*controller_cb_t)(void* param, signal_t signal, level_t level,
* this function to the controllers methods.
*/
bool controller_cb_empty(void *param, signal_t signal, level_t level,
- ike_sa_t *ike_sa, char *format, va_list args);
+ ike_sa_t *ike_sa, void *data,
+ char *format, va_list args);
typedef struct controller_t controller_t;