summaryrefslogtreecommitdiff
path: root/src/manager/controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/manager/controller')
-rw-r--r--src/manager/controller/auth_controller.c17
-rw-r--r--src/manager/controller/auth_controller.h7
-rw-r--r--src/manager/controller/config_controller.c16
-rw-r--r--src/manager/controller/config_controller.h8
-rw-r--r--src/manager/controller/control_controller.c18
-rw-r--r--src/manager/controller/control_controller.h8
-rw-r--r--src/manager/controller/gateway_controller.c16
-rw-r--r--src/manager/controller/gateway_controller.h8
-rw-r--r--src/manager/controller/ikesa_controller.c17
-rw-r--r--src/manager/controller/ikesa_controller.h7
10 files changed, 59 insertions, 63 deletions
diff --git a/src/manager/controller/auth_controller.c b/src/manager/controller/auth_controller.c
index c9a9b5461..5f2de5154 100644
--- a/src/manager/controller/auth_controller.c
+++ b/src/manager/controller/auth_controller.c
@@ -37,14 +37,14 @@ struct private_auth_controller_t {
manager_t *manager;
};
-static void login(private_auth_controller_t *this, request_t *request)
+static void login(private_auth_controller_t *this, fast_request_t *request)
{
request->set(request, "action", "check");
request->set(request, "title", "Login");
request->render(request, "templates/auth/login.cs");
}
-static void check(private_auth_controller_t *this, request_t *request)
+static void check(private_auth_controller_t *this, fast_request_t *request)
{
char *username, *password;
@@ -61,20 +61,20 @@ static void check(private_auth_controller_t *this, request_t *request)
}
}
-static void logout(private_auth_controller_t *this, request_t *request)
+static void logout(private_auth_controller_t *this, fast_request_t *request)
{
this->manager->logout(this->manager);
request->redirect(request, "auth/login");
}
-METHOD(controller_t, get_name, char*,
+METHOD(fast_controller_t, get_name, char*,
private_auth_controller_t *this)
{
return "auth";
}
-METHOD(controller_t, handle, void,
- private_auth_controller_t *this, request_t *request, char *action,
+METHOD(fast_controller_t, handle, void,
+ private_auth_controller_t *this, fast_request_t *request, char *action,
char *p2, char *p3, char *p4, char *p5)
{
if (action)
@@ -95,7 +95,7 @@ METHOD(controller_t, handle, void,
request->redirect(request, "auth/login");
}
-METHOD(controller_t, destroy, void,
+METHOD(fast_controller_t, destroy, void,
private_auth_controller_t *this)
{
free(this);
@@ -104,7 +104,7 @@ METHOD(controller_t, destroy, void,
/*
* see header file
*/
-controller_t *auth_controller_create(context_t *context, void *param)
+fast_controller_t *auth_controller_create(fast_context_t *context, void *param)
{
private_auth_controller_t *this;
@@ -121,4 +121,3 @@ controller_t *auth_controller_create(context_t *context, void *param)
return &this->public.controller;
}
-
diff --git a/src/manager/controller/auth_controller.h b/src/manager/controller/auth_controller.h
index 8489d9dd3..07292273d 100644
--- a/src/manager/controller/auth_controller.h
+++ b/src/manager/controller/auth_controller.h
@@ -21,8 +21,7 @@
#ifndef AUTH_CONTROLLER_H_
#define AUTH_CONTROLLER_H_
-
-#include <controller.h>
+#include <fast_controller.h>
typedef struct auth_controller_t auth_controller_t;
@@ -34,12 +33,12 @@ struct auth_controller_t {
/**
* Implements controller_t interface.
*/
- controller_t controller;
+ fast_controller_t controller;
};
/**
* Create a auth_controller controller instance.
*/
-controller_t *auth_controller_create(context_t *context, void *param);
+fast_controller_t *auth_controller_create(fast_context_t *context, void *param);
#endif /** AUTH_CONTROLLER_H_ @}*/
diff --git a/src/manager/controller/config_controller.c b/src/manager/controller/config_controller.c
index 154ab615e..bc93c542d 100644
--- a/src/manager/controller/config_controller.c
+++ b/src/manager/controller/config_controller.c
@@ -44,7 +44,7 @@ struct private_config_controller_t {
* read XML of a peerconfig element and fill template
*/
static void process_peerconfig(private_config_controller_t *this,
- enumerator_t *e, request_t *r)
+ enumerator_t *e, fast_request_t *r)
{
xml_t *xml;
enumerator_t *e1, *e2, *e3;
@@ -115,7 +115,7 @@ static void process_peerconfig(private_config_controller_t *this,
}
}
-static void list(private_config_controller_t *this, request_t *r)
+static void list(private_config_controller_t *this, fast_request_t *r)
{
gateway_t *gateway;
xml_t *xml;
@@ -149,14 +149,14 @@ static void list(private_config_controller_t *this, request_t *r)
}
}
-METHOD(controller_t, get_name, char*,
+METHOD(fast_controller_t, get_name, char*,
private_config_controller_t *this)
{
return "config";
}
-METHOD(controller_t, handle, void,
- private_config_controller_t *this, request_t *request, char *action,
+METHOD(fast_controller_t, handle, void,
+ private_config_controller_t *this, fast_request_t *request, char *action,
char *p2, char *p3, char *p4, char *p5)
{
if (!this->manager->logged_in(this->manager))
@@ -177,7 +177,7 @@ METHOD(controller_t, handle, void,
return request->redirect(request, "config/list");
}
-METHOD(controller_t, destroy, void,
+METHOD(fast_controller_t, destroy, void,
private_config_controller_t *this)
{
free(this);
@@ -186,7 +186,8 @@ METHOD(controller_t, destroy, void,
/*
* see header file
*/
-controller_t *config_controller_create(context_t *context, void *param)
+fast_controller_t *config_controller_create(fast_context_t *context,
+ void *param)
{
private_config_controller_t *this;
@@ -203,4 +204,3 @@ controller_t *config_controller_create(context_t *context, void *param)
return &this->public.controller;
}
-
diff --git a/src/manager/controller/config_controller.h b/src/manager/controller/config_controller.h
index a84678c9a..504ec8c3b 100644
--- a/src/manager/controller/config_controller.h
+++ b/src/manager/controller/config_controller.h
@@ -21,8 +21,7 @@
#ifndef CONFIG_CONTROLLER_H_
#define CONFIG_CONTROLLER_H_
-
-#include <controller.h>
+#include <fast_controller.h>
typedef struct config_controller_t config_controller_t;
@@ -34,12 +33,13 @@ struct config_controller_t {
/**
* Implements controller_t interface.
*/
- controller_t controller;
+ fast_controller_t controller;
};
/**
* Create a config_controller controller instance.
*/
-controller_t *config_controller_create(context_t *context, void *param);
+fast_controller_t *config_controller_create(fast_context_t *context,
+ void *param);
#endif /** CONFIG_CONTROLLER_H_ @}*/
diff --git a/src/manager/controller/control_controller.c b/src/manager/controller/control_controller.c
index 68238d02f..f275986d2 100644
--- a/src/manager/controller/control_controller.c
+++ b/src/manager/controller/control_controller.c
@@ -43,7 +43,7 @@ struct private_control_controller_t {
/**
* handle the result of a control operation
*/
-static void handle_result(private_control_controller_t *this, request_t *r,
+static void handle_result(private_control_controller_t *this, fast_request_t *r,
enumerator_t *e)
{
enumerator_t *e1;
@@ -93,7 +93,7 @@ static void handle_result(private_control_controller_t *this, request_t *r,
/**
* initiate an IKE or CHILD SA
*/
-static void initiate(private_control_controller_t *this, request_t *r,
+static void initiate(private_control_controller_t *this, fast_request_t *r,
bool ike, char *config)
{
gateway_t *gateway;
@@ -108,7 +108,7 @@ static void initiate(private_control_controller_t *this, request_t *r,
/**
* terminate an IKE or CHILD SA
*/
-static void terminate(private_control_controller_t *this, request_t *r,
+static void terminate(private_control_controller_t *this, fast_request_t *r,
bool ike, u_int32_t id)
{
gateway_t *gateway;
@@ -120,14 +120,14 @@ static void terminate(private_control_controller_t *this, request_t *r,
handle_result(this, r, e);
}
-METHOD(controller_t, get_name, char*,
+METHOD(fast_controller_t, get_name, char*,
private_control_controller_t *this)
{
return "control";
}
-METHOD(controller_t, handle, void,
- private_control_controller_t *this, request_t *request, char *action,
+METHOD(fast_controller_t, handle, void,
+ private_control_controller_t *this, fast_request_t *request, char *action,
char *str, char *p3, char *p4, char *p5)
{
if (!this->manager->logged_in(this->manager))
@@ -174,7 +174,7 @@ METHOD(controller_t, handle, void,
return request->redirect(request, "ikesa/list");
}
-METHOD(controller_t, destroy, void,
+METHOD(fast_controller_t, destroy, void,
private_control_controller_t *this)
{
free(this);
@@ -183,7 +183,8 @@ METHOD(controller_t, destroy, void,
/*
* see header file
*/
-controller_t *control_controller_create(context_t *context, void *param)
+fast_controller_t *control_controller_create(fast_context_t *context,
+ void *param)
{
private_control_controller_t *this;
@@ -200,4 +201,3 @@ controller_t *control_controller_create(context_t *context, void *param)
return &this->public.controller;
}
-
diff --git a/src/manager/controller/control_controller.h b/src/manager/controller/control_controller.h
index 22e3a7022..0342f8ca2 100644
--- a/src/manager/controller/control_controller.h
+++ b/src/manager/controller/control_controller.h
@@ -21,8 +21,7 @@
#ifndef CONTROL_CONTROLLER_H_
#define CONTROL_CONTROLLER_H_
-
-#include <controller.h>
+#include <fast_controller.h>
typedef struct control_controller_t control_controller_t;
@@ -34,12 +33,13 @@ struct control_controller_t {
/**
* Implements controller_t interface.
*/
- controller_t controller;
+ fast_controller_t controller;
};
/**
* Create a control_controller controller instance.
*/
-controller_t *control_controller_create(context_t *context, void *param);
+fast_controller_t *control_controller_create(fast_context_t *context,
+ void *param);
#endif /** CONTROL_CONTROLLER_H_ @}*/
diff --git a/src/manager/controller/gateway_controller.c b/src/manager/controller/gateway_controller.c
index 39d344502..6c0257980 100644
--- a/src/manager/controller/gateway_controller.c
+++ b/src/manager/controller/gateway_controller.c
@@ -39,7 +39,7 @@ struct private_gateway_controller_t {
};
-static void list(private_gateway_controller_t *this, request_t *request)
+static void list(private_gateway_controller_t *this, fast_request_t *request)
{
enumerator_t *enumerator;
char *name, *address;
@@ -66,7 +66,7 @@ static void list(private_gateway_controller_t *this, request_t *request)
request->render(request, "templates/gateway/list.cs");
}
-static void _select(private_gateway_controller_t *this, request_t *request)
+static void _select(private_gateway_controller_t *this, fast_request_t *request)
{
char *id;
@@ -82,14 +82,14 @@ static void _select(private_gateway_controller_t *this, request_t *request)
request->redirect(request, "gateway/list");
}
-METHOD(controller_t, get_name, char*,
+METHOD(fast_controller_t, get_name, char*,
private_gateway_controller_t *this)
{
return "gateway";
}
-METHOD(controller_t, handle, void,
- private_gateway_controller_t *this, request_t *request, char *action,
+METHOD(fast_controller_t, handle, void,
+ private_gateway_controller_t *this, fast_request_t *request, char *action,
char *p2, char *p3, char *p4, char *p5)
{
if (!this->manager->logged_in(this->manager))
@@ -110,7 +110,7 @@ METHOD(controller_t, handle, void,
request->redirect(request, "gateway/list");
}
-METHOD(controller_t, destroy, void,
+METHOD(fast_controller_t, destroy, void,
private_gateway_controller_t *this)
{
free(this);
@@ -119,7 +119,8 @@ METHOD(controller_t, destroy, void,
/*
* see header file
*/
-controller_t *gateway_controller_create(context_t *context, void *param)
+fast_controller_t *gateway_controller_create(fast_context_t *context,
+ void *param)
{
private_gateway_controller_t *this;
@@ -136,4 +137,3 @@ controller_t *gateway_controller_create(context_t *context, void *param)
return &this->public.controller;
}
-
diff --git a/src/manager/controller/gateway_controller.h b/src/manager/controller/gateway_controller.h
index a0999295e..170bc1bdb 100644
--- a/src/manager/controller/gateway_controller.h
+++ b/src/manager/controller/gateway_controller.h
@@ -21,8 +21,7 @@
#ifndef GATEWAY_CONTROLLER_H_
#define GATEWAY_CONTROLLER_H_
-
-#include <controller.h>
+#include <fast_controller.h>
typedef struct gateway_controller_t gateway_controller_t;
@@ -34,12 +33,13 @@ struct gateway_controller_t {
/**
* Implements controller_t interface.
*/
- controller_t controller;
+ fast_controller_t controller;
};
/**
* Create a gateway_controller controller instance.
*/
-controller_t *gateway_controller_create(context_t *context, void *param);
+fast_controller_t *gateway_controller_create(fast_context_t *context,
+ void *param);
#endif /** GATEWAY_CONTROLLER_H_ @}*/
diff --git a/src/manager/controller/ikesa_controller.c b/src/manager/controller/ikesa_controller.c
index 716d51a7a..df0e5f475 100644
--- a/src/manager/controller/ikesa_controller.c
+++ b/src/manager/controller/ikesa_controller.c
@@ -44,7 +44,7 @@ struct private_ikesa_controller_t {
* read XML of a childsa element and fill template
*/
static void process_childsa(private_ikesa_controller_t *this, char *id,
- enumerator_t *e, request_t *r)
+ enumerator_t *e, fast_request_t *r)
{
xml_t *xml;
enumerator_t *e1, *e2;
@@ -96,7 +96,7 @@ static void process_childsa(private_ikesa_controller_t *this, char *id,
* read XML of a ikesa element and fill template
*/
static void process_ikesa(private_ikesa_controller_t *this,
- enumerator_t *e, request_t *r)
+ enumerator_t *e, fast_request_t *r)
{
xml_t *xml;
enumerator_t *e1, *e2;
@@ -139,7 +139,7 @@ static void process_ikesa(private_ikesa_controller_t *this,
}
}
-static void list(private_ikesa_controller_t *this, request_t *r)
+static void list(private_ikesa_controller_t *this, fast_request_t *r)
{
gateway_t *gateway;
xml_t *xml;
@@ -173,14 +173,14 @@ static void list(private_ikesa_controller_t *this, request_t *r)
}
}
-METHOD(controller_t, get_name, char*,
+METHOD(fast_controller_t, get_name, char*,
private_ikesa_controller_t *this)
{
return "ikesa";
}
-METHOD(controller_t, handle, void,
- private_ikesa_controller_t *this, request_t *request, char *action,
+METHOD(fast_controller_t, handle, void,
+ private_ikesa_controller_t *this, fast_request_t *request, char *action,
char *p2, char *p3, char *p4, char *p5)
{
if (!this->manager->logged_in(this->manager))
@@ -201,7 +201,7 @@ METHOD(controller_t, handle, void,
return request->redirect(request, "ikesa/list");
}
-METHOD(controller_t, destroy, void,
+METHOD(fast_controller_t, destroy, void,
private_ikesa_controller_t *this)
{
free(this);
@@ -210,7 +210,7 @@ METHOD(controller_t, destroy, void,
/*
* see header file
*/
-controller_t *ikesa_controller_create(context_t *context, void *param)
+fast_controller_t *ikesa_controller_create(fast_context_t *context, void *param)
{
private_ikesa_controller_t *this;
@@ -227,4 +227,3 @@ controller_t *ikesa_controller_create(context_t *context, void *param)
return &this->public.controller;
}
-
diff --git a/src/manager/controller/ikesa_controller.h b/src/manager/controller/ikesa_controller.h
index 72f8242f1..592047539 100644
--- a/src/manager/controller/ikesa_controller.h
+++ b/src/manager/controller/ikesa_controller.h
@@ -21,8 +21,7 @@
#ifndef IKESA_CONTROLLER_H_
#define IKESA_CONTROLLER_H_
-
-#include <controller.h>
+#include <fast_controller.h>
typedef struct ikesa_controller_t ikesa_controller_t;
@@ -34,12 +33,12 @@ struct ikesa_controller_t {
/**
* Implements controller_t interface.
*/
- controller_t controller;
+ fast_controller_t controller;
};
/**
* Create a ikesa_controller controller instance.
*/
-controller_t *ikesa_controller_create(context_t *context, void *param);
+fast_controller_t *ikesa_controller_create(fast_context_t *context, void *param);
#endif /** IKESA_CONTROLLER_H_ @}*/