]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
libfast: add a fast_ prefix to all classes, avoiding namespace clashes
authorMartin Willi <martin@revosec.ch>
Wed, 17 Jul 2013 09:50:45 +0000 (11:50 +0200)
committerMartin Willi <martin@revosec.ch>
Thu, 18 Jul 2013 10:24:38 +0000 (12:24 +0200)
34 files changed:
src/libfast/Makefile.am
src/libfast/fast_context.h [moved from src/libfast/context.h with 70% similarity]
src/libfast/fast_controller.h [moved from src/libfast/controller.h with 76% similarity]
src/libfast/fast_dispatcher.c [moved from src/libfast/dispatcher.c with 84% similarity]
src/libfast/fast_dispatcher.h [moved from src/libfast/dispatcher.h with 77% similarity]
src/libfast/fast_filter.h [moved from src/libfast/filter.h with 73% similarity]
src/libfast/fast_request.c [moved from src/libfast/request.c with 75% similarity]
src/libfast/fast_request.h [moved from src/libfast/request.h with 74% similarity]
src/libfast/fast_session.c [moved from src/libfast/session.c with 76% similarity]
src/libfast/fast_session.h [moved from src/libfast/session.h with 67% similarity]
src/libfast/fast_smtp.c [moved from src/libfast/smtp.c with 84% similarity]
src/libfast/fast_smtp.h [moved from src/libfast/smtp.h with 77% similarity]
src/manager/controller/auth_controller.c
src/manager/controller/auth_controller.h
src/manager/controller/config_controller.c
src/manager/controller/config_controller.h
src/manager/controller/control_controller.c
src/manager/controller/control_controller.h
src/manager/controller/gateway_controller.c
src/manager/controller/gateway_controller.h
src/manager/controller/ikesa_controller.c
src/manager/controller/ikesa_controller.h
src/manager/main.c
src/manager/manager.c
src/manager/manager.h
src/medsrv/controller/peer_controller.c
src/medsrv/controller/peer_controller.h
src/medsrv/controller/user_controller.c
src/medsrv/controller/user_controller.h
src/medsrv/filter/auth_filter.c
src/medsrv/filter/auth_filter.h
src/medsrv/main.c
src/medsrv/user.c
src/medsrv/user.h

index df5b650cef4847360ec018729b5673b2ee9437bb..db910487d5d5bd4a5fbc9497e61093e46ef46ccc 100644 (file)
@@ -1,12 +1,13 @@
 ipseclib_LTLIBRARIES = libfast.la
 
 libfast_la_SOURCES = \
-       dispatcher.c request.c session.c smtp.c
+       fast_dispatcher.c fast_request.c fast_session.c fast_smtp.c
 
 if USE_DEV_HEADERS
 fast_includedir = ${dev_headers}/fast
 nobase_fast_include_HEADERS = \
-       context.h controller.h dispatcher.h filter.h request.h session.h smtp.h
+       fast_context.h fast_controller.h fast_dispatcher.h fast_filter.h \
+       fast_request.h fast_session.h fast_smtp.h
 endif
 
 libfast_la_LIBADD = $(top_builddir)/src/libstrongswan/libstrongswan.la \
similarity index 70%
rename from src/libfast/context.h
rename to src/libfast/fast_context.h
index 4f8d11d2c3ac15a75f5c47f55101f3aeae8688e3..4922703ca0639ae6ad0cb8a31f82eed9efcc0296 100644 (file)
  */
 
 /**
- * @defgroup context context
+ * @defgroup fast_context fast_context
  * @{ @ingroup libfast
  */
 
-#ifndef CONTEXT_H_
-#define CONTEXT_H_
+#ifndef FAST_CONTEXT_H_
+#define FAST_CONTEXT_H_
 
-typedef struct context_t context_t;
+typedef struct fast_context_t fast_context_t;
 
 /**
  * Constructor function for a user specific context.
  */
-typedef context_t *(*context_constructor_t)(void *param);
+typedef fast_context_t *(*fast_context_constructor_t)(void *param);
 
 /**
  * User specific session context, to extend.
  */
-struct context_t {
+struct fast_context_t {
 
        /**
-        * Destroy the context_t.
+        * Destroy the fast_context_t.
         */
-       void (*destroy) (context_t *this);
+       void (*destroy) (fast_context_t *this);
 };
 
-#endif /** CONTEXT_H_ @}*/
+#endif /** FAST_CONTEXT_H_ @}*/
similarity index 76%
rename from src/libfast/controller.h
rename to src/libfast/fast_controller.h
index 7a7efc706f2cd553e6a6d3ed6d4bb3f6185159a1..bbd0214fcaa2b6587ad3dc602c35086938ce5339 100644 (file)
  */
 
 /**
- * @defgroup controller controller
+ * @defgroup fast_controller fast_controller
  * @{ @ingroup libfast
  */
 
-#ifndef CONTROLLER_H_
-#define CONTROLLER_H_
+#ifndef FAST_CONTROLLER_H_
+#define FAST_CONTROLLER_H_
 
-#include "request.h"
-#include "context.h"
+#include "fast_request.h"
+#include "fast_context.h"
 
-typedef struct controller_t controller_t;
+typedef struct fast_controller_t fast_controller_t;
 
 /**
  * Constructor function for a controller.
@@ -32,7 +32,8 @@ typedef struct controller_t controller_t;
  * @param context              session specific context, implements context_t
  * @param param                        user supplied param, as registered to the dispatcher
  */
-typedef controller_t *(*controller_constructor_t)(context_t* context, void *param);
+typedef fast_controller_t *(*fast_controller_constructor_t)(
+                                                                               fast_context_t* context, void *param);
 
 /**
  * Controller interface, to be implemented by users controllers.
@@ -41,14 +42,14 @@ typedef controller_t *(*controller_constructor_t)(context_t* context, void *para
  * associated set of private controller instances.
  * The controller handle function is called for each incoming request.
  */
-struct controller_t {
+struct fast_controller_t {
 
        /**
         * Get the name of the controller.
         *
         * @return                              name of the controller
         */
-       char* (*get_name)(controller_t *this);
+       char* (*get_name)(fast_controller_t *this);
 
        /**
         * Handle a HTTP request for that controller.
@@ -65,13 +66,13 @@ struct controller_t {
         * @param p5                    fifth parameter
         * @return
         */
-       void (*handle)(controller_t *this, request_t *request,
+       void (*handle)(fast_controller_t *this, fast_request_t *request,
                                   char *p1, char *p2, char *p3, char *p4, char *p5);
 
        /**
         * Destroy the controller instance.
         */
-       void (*destroy) (controller_t *this);
+       void (*destroy) (fast_controller_t *this);
 };
 
-#endif /** CONTROLLER_H_ @}*/
+#endif /** FAST_CONTROLLER_H_ @}*/
similarity index 84%
rename from src/libfast/dispatcher.c
rename to src/libfast/fast_dispatcher.c
index e5a02c63b9e0ee6423f90d02e5421aa9e324a2e7..e0c57b47dd1a05e3760b1f482a2e15dd18ca3a12 100644 (file)
  * for more details.
  */
 
-#include "dispatcher.h"
+#include "fast_dispatcher.h"
 
-#include "request.h"
-#include "session.h"
+#include "fast_request.h"
+#include "fast_session.h"
 
 #include <fcgiapp.h>
 #include <signal.h>
 /** Intervall to check for expired sessions, in seconds */
 #define CLEANUP_INTERVAL 30
 
-typedef struct private_dispatcher_t private_dispatcher_t;
+typedef struct private_fast_dispatcher_t private_fast_dispatcher_t;
 
 /**
  * private data of the task manager
  */
-struct private_dispatcher_t {
+struct private_fast_dispatcher_t {
 
        /**
         * public functions
         */
-       dispatcher_t public;
+       fast_dispatcher_t public;
 
        /**
         * fcgi socket fd
@@ -97,7 +97,7 @@ struct private_dispatcher_t {
        /**
         * constructor function to create session context (in controller_entry_t)
         */
-       context_constructor_t context_constructor;
+       fast_context_constructor_t context_constructor;
 
        /**
         * user param to context constructor
@@ -107,21 +107,21 @@ struct private_dispatcher_t {
 
 typedef struct {
        /** constructor function */
-       controller_constructor_t constructor;
+       fast_controller_constructor_t constructor;
        /** parameter to constructor */
        void *param;
 } controller_entry_t;
 
 typedef struct {
        /** constructor function */
-       filter_constructor_t constructor;
+       fast_filter_constructor_t constructor;
        /** parameter to constructor */
        void *param;
 } filter_entry_t;
 
 typedef struct {
        /** session instance */
-       session_t *session;
+       fast_session_t *session;
        /** condvar to wait for session */
        condvar_t *cond;
        /** client host address, to prevent session hijacking */
@@ -137,21 +137,21 @@ typedef struct {
 /**
  * create a session and instanciate controllers
  */
-static session_t* load_session(private_dispatcher_t *this)
+static fast_session_t* load_session(private_fast_dispatcher_t *this)
 {
        enumerator_t *enumerator;
        controller_entry_t *centry;
        filter_entry_t *fentry;
-       session_t *session;
-       context_t *context = NULL;
-       controller_t *controller;
-       filter_t *filter;
+       fast_session_t *session;
+       fast_context_t *context = NULL;
+       fast_controller_t *controller;
+       fast_filter_t *filter;
 
        if (this->context_constructor)
        {
                context = this->context_constructor(this->param);
        }
-       session = session_create(context);
+       session = fast_session_create(context);
 
        enumerator = this->controllers->create_enumerator(this->controllers);
        while (enumerator->enumerate(enumerator, &centry))
@@ -175,11 +175,11 @@ static session_t* load_session(private_dispatcher_t *this)
 /**
  * create a new session entry
  */
-static session_entry_t *session_entry_create(private_dispatcher_t *this,
+static session_entry_t *session_entry_create(private_fast_dispatcher_t *this,
                                                                                         char *host)
 {
        session_entry_t *entry;
-       session_t *session;
+       fast_session_t *session;
 
        session = load_session(this);
        if (!session)
@@ -206,8 +206,8 @@ static void session_entry_destroy(session_entry_t *entry)
        free(entry);
 }
 
-METHOD(dispatcher_t, add_controller, void,
-       private_dispatcher_t *this, controller_constructor_t constructor,
+METHOD(fast_dispatcher_t, add_controller, void,
+       private_fast_dispatcher_t *this, fast_controller_constructor_t constructor,
        void *param)
 {
        controller_entry_t *entry;
@@ -219,8 +219,9 @@ METHOD(dispatcher_t, add_controller, void,
        this->controllers->insert_last(this->controllers, entry);
 }
 
-METHOD(dispatcher_t, add_filter, void,
-       private_dispatcher_t *this, filter_constructor_t constructor, void *param)
+METHOD(fast_dispatcher_t, add_filter, void,
+       private_fast_dispatcher_t *this, fast_filter_constructor_t constructor,
+       void *param)
 {
        filter_entry_t *entry;
 
@@ -250,7 +251,7 @@ static bool session_equals(char *sid1, char *sid2)
 /**
  * Cleanup unused sessions
  */
-static void cleanup_sessions(private_dispatcher_t *this, time_t now)
+static void cleanup_sessions(private_fast_dispatcher_t *this, time_t now)
 {
        if (this->last_cleanup < now - CLEANUP_INTERVAL)
        {
@@ -288,19 +289,19 @@ static void cleanup_sessions(private_dispatcher_t *this, time_t now)
 /**
  * Actual dispatching code
  */
-static void dispatch(private_dispatcher_t *this)
+static void dispatch(private_fast_dispatcher_t *this)
 {
        thread_cancelability(FALSE);
 
        while (TRUE)
        {
-               request_t *request;
+               fast_request_t *request;
                session_entry_t *found = NULL;
                time_t now;
                char *sid;
 
                thread_cancelability(TRUE);
-               request = request_create(this->fd, this->debug);
+               request = fast_request_create(this->fd, this->debug);
                thread_cancelability(FALSE);
 
                if (request == NULL)
@@ -358,8 +359,8 @@ static void dispatch(private_dispatcher_t *this)
        }
 }
 
-METHOD(dispatcher_t, run, void,
-       private_dispatcher_t *this, int threads)
+METHOD(fast_dispatcher_t, run, void,
+       private_fast_dispatcher_t *this, int threads)
 {
        this->thread_count = threads;
        this->threads = malloc(sizeof(thread_t*) * threads);
@@ -374,8 +375,8 @@ METHOD(dispatcher_t, run, void,
        }
 }
 
-METHOD(dispatcher_t, waitsignal, void,
-       private_dispatcher_t *this)
+METHOD(fast_dispatcher_t, waitsignal, void,
+       private_fast_dispatcher_t *this)
 {
        sigset_t set;
        int sig;
@@ -388,8 +389,8 @@ METHOD(dispatcher_t, waitsignal, void,
        sigwait(&set, &sig);
 }
 
-METHOD(dispatcher_t, destroy, void,
-       private_dispatcher_t *this)
+METHOD(fast_dispatcher_t, destroy, void,
+       private_fast_dispatcher_t *this)
 {
        char *sid;
        session_entry_t *entry;
@@ -419,10 +420,10 @@ METHOD(dispatcher_t, destroy, void,
 /*
  * see header file
  */
-dispatcher_t *dispatcher_create(char *socket, bool debug, int timeout,
-                                                               context_constructor_t constructor, void *param)
+fast_dispatcher_t *fast_dispatcher_create(char *socket, bool debug, int timeout,
+                                                       fast_context_constructor_t constructor, void *param)
 {
-       private_dispatcher_t *this;
+       private_fast_dispatcher_t *this;
 
        INIT(this,
                .public = {
@@ -453,4 +454,3 @@ dispatcher_t *dispatcher_create(char *socket, bool debug, int timeout,
        }
        return &this->public;
 }
-
similarity index 77%
rename from src/libfast/dispatcher.h
rename to src/libfast/fast_dispatcher.h
index 16223fe76894ac850005b54b6e93adb2a52c4693..6546385c64fad76726246870cb7d263d1796a5b5 100644 (file)
  * The session context is instanciated per session. Sessions are managed
  * automatically through session cookies. The session context is kept alive
  * until the session times out. It must implement the context_t interface and
- * a #context_constructor_t is needed to create instances. To each session,
+ * a #fast_context_constructor_t is needed to create instances. To each session,
  * a set of controllers gets instanciated. The controller instances are per
  * session, so you can hold private data for each user.
  * Controllers need to implement the controller_t interface and need a
- * #controller_constructor_t function to create instances.
+ * #fast_controller_constructor_t function to create instances.
  *
  * A small example shows how to set up libfast:
  * @code
-       dispatcher_t *dispatcher;
+       fast_fast_dispatcher_t *dispatcher;
        your_global_context_implementation_t *global;
 
        global = initialize_your_global_context();
 
-       dispatcher = dispatcher_create(NULL, FALSE, 180,
+       dispatcher = fast_dispatcher_create(NULL, FALSE, 180,
                        (context_constructor_t)your_session_context_create, global);
        dispatcher->add_controller(dispatcher, your_controller1_create, param1);
        dispatcher->add_controller(dispatcher, your_controller2_create, param2);
    @endcode
  * @}
  *
- * @defgroup dispatcher dispatcher
+ * @defgroup fast_dispatcher fast_dispatcher
  * @{ @ingroup libfast
  */
 
-#ifndef DISPATCHER_H_
-#define DISPATCHER_H_
+#ifndef FAST_DISPATCHER_H_
+#define FAST_DISPATCHER_H_
 
-#include "controller.h"
-#include "filter.h"
+#include "fast_controller.h"
+#include "fast_filter.h"
 
-typedef struct dispatcher_t dispatcher_t;
+typedef struct fast_dispatcher_t fast_dispatcher_t;
 
 /**
  * Dispatcher, accepts connections using multiple threads.
@@ -75,7 +75,7 @@ typedef struct dispatcher_t dispatcher_t;
  * Each controller is instanciated in the session using the controller
  * constructor added with add_controller.
  */
-struct dispatcher_t {
+struct fast_dispatcher_t {
 
        /**
         * Register a controller to the dispatcher.
@@ -86,8 +86,9 @@ struct dispatcher_t {
         * @param constructor   constructor function to the conntroller
         * @param param                 param to pass to constructor
         */
-       void (*add_controller)(dispatcher_t *this,
-                                                  controller_constructor_t constructor, void *param);
+       void (*add_controller)(fast_dispatcher_t *this,
+                                                  fast_controller_constructor_t constructor,
+                                                  void *param);
 
        /**
         * Add a filter to the dispatcher.
@@ -95,8 +96,8 @@ struct dispatcher_t {
         * @param constructor   constructor to create filter in session
         * @param param                 param to pass to constructor
         */
-       void (*add_filter)(dispatcher_t *this,
-                                          filter_constructor_t constructor, void *param);
+       void (*add_filter)(fast_dispatcher_t *this,
+                                          fast_filter_constructor_t constructor, void *param);
 
        /**
         * Start with dispatching.
@@ -105,18 +106,17 @@ struct dispatcher_t {
         *
         * @param threads               number of dispatching threads
         */
-       void (*run)(dispatcher_t *this, int threads);
+       void (*run)(fast_dispatcher_t *this, int threads);
 
        /**
         * Wait for a relevant signal action.
-        *
         */
-       void (*waitsignal)(dispatcher_t *this);
+       void (*waitsignal)(fast_dispatcher_t *this);
 
        /**
-        * Destroy the dispatcher_t.
+        * Destroy the fast_dispatcher_t.
         */
-       void (*destroy) (dispatcher_t *this);
+       void (*destroy) (fast_dispatcher_t *this);
 };
 
 /**
@@ -131,7 +131,7 @@ struct dispatcher_t {
  * @param constructor  construction function for session context
  * @param param                        parameter to supply to context constructor
  */
-dispatcher_t *dispatcher_create(char *socket, bool debug, int timeout,
-                                                               context_constructor_t constructor, void *param);
+fast_dispatcher_t *fast_dispatcher_create(char *socket, bool debug, int timeout,
+                                                       fast_context_constructor_t constructor, void *param);
 
-#endif /** DISPATCHER_H_ @}*/
+#endif /** FAST_DISPATCHER_H_ @}*/
similarity index 73%
rename from src/libfast/filter.h
rename to src/libfast/fast_filter.h
index 305a8bb6e038b9621c9688fd24499537ce242866..57367bd5a3904226d0c44496bf05fc131510e321 100644 (file)
  */
 
 /*
- * @defgroup filter filter
+ * @defgroup fast_filter fast_filter
  * @{ @ingroup libfast
  */
 
-#ifndef FILTER_H_
-#define FILTER_H_
+#ifndef FAST_FILTER_H_
+#define FAST_FILTER_H_
 
-#include "request.h"
-#include "context.h"
-#include "controller.h"
+#include "fast_request.h"
+#include "fast_context.h"
+#include "fast_controller.h"
 
-typedef struct filter_t filter_t;
+typedef struct fast_filter_t fast_filter_t;
 
 /**
  * Constructor function for a filter
@@ -33,12 +33,13 @@ typedef struct filter_t filter_t;
  * @param context              session specific context
  * @param param                        user supplied param
  */
-typedef filter_t *(*filter_constructor_t)(context_t* context, void *param);
+typedef fast_filter_t *(*fast_filter_constructor_t)(fast_context_t* context,
+                                                                                                       void *param);
 
 /**
  * Filter interface, to be implemented by users filters.
  */
-struct filter_t {
+struct fast_filter_t {
 
        /**
         * Called before the controller handles the request.
@@ -51,13 +52,13 @@ struct filter_t {
         * @param p5                    fifth parameter
         * @return                              TRUE to continue request handling
         */
-       bool (*run)(filter_t *this, request_t *request,
+       bool (*run)(fast_filter_t *this, fast_request_t *request,
                                char *p0, char *p1, char *p2, char *p3, char *p4, char *p5);
 
        /**
         * Destroy the filter instance.
         */
-       void (*destroy) (filter_t *this);
+       void (*destroy) (fast_filter_t *this);
 };
 
-#endif /* FILTER_H_ @} */
+#endif /* FAST_FILTER_H_ @} */
similarity index 75%
rename from src/libfast/request.c
rename to src/libfast/fast_request.c
index 5d03227af604ba75ed0751281fa70d3680287dc3..0673750b7279903b03ea03c06e635f15852affcd 100644 (file)
@@ -15,7 +15,7 @@
 
 #define _GNU_SOURCE
 
-#include "request.h"
+#include "fast_request.h"
 
 #include <library.h>
 #include <utils/debug.h>
 #include <threading/thread.h>
 #include <threading/thread_value.h>
 
-typedef struct private_request_t private_request_t;
+typedef struct private_fast_request_t private_fast_request_t;
 
 /**
  * private data of the task manager
  */
-struct private_request_t {
+struct private_fast_request_t {
 
        /**
         * public functions
         */
-       request_t public;
+       fast_request_t public;
 
        /**
         * FastCGI request object
@@ -91,7 +91,9 @@ pthread_once_t once = PTHREAD_ONCE_INIT;
  */
 static int read_cb(void *null, char *buf, int size)
 {
-       private_request_t *this = (private_request_t*)thread_this->get(thread_this);
+       private_fast_request_t *this;
+
+       this = (private_fast_request_t*)thread_this->get(thread_this);
 
        return FCGX_GetStr(buf, size, this->req.in);
 }
@@ -101,7 +103,9 @@ static int read_cb(void *null, char *buf, int size)
  */
 static int writef_cb(void *null, const char *format, va_list args)
 {
-       private_request_t *this = (private_request_t*)thread_this->get(thread_this);
+       private_fast_request_t *this;
+
+       this = (private_fast_request_t*)thread_this->get(thread_this);
 
        FCGX_VFPrintF(this->req.out, format, args);
        return 0;
@@ -111,7 +115,9 @@ static int writef_cb(void *null, const char *format, va_list args)
  */
 static int write_cb(void *null, const char *buf, int size)
 {
-       private_request_t *this = (private_request_t*)thread_this->get(thread_this);
+       private_fast_request_t *this;
+
+       this = (private_fast_request_t*)thread_this->get(thread_this);
 
        return FCGX_PutStr(buf, size, this->req.out);
 }
@@ -122,7 +128,9 @@ static int write_cb(void *null, const char *buf, int size)
 static char *getenv_cb(void *null, const char *key)
 {
        char *value;
-       private_request_t *this = (private_request_t*)thread_this->get(thread_this);
+       private_fast_request_t *this;
+
+       this = (private_fast_request_t*)thread_this->get(thread_this);
 
        value = FCGX_GetParam(key, this->req.envp);
        return strdupnull(value);
@@ -142,9 +150,12 @@ static int putenv_cb(void *null, const char *key, const char *value)
  */
 static int iterenv_cb(void *null, int num, char **key, char **value)
 {
+       private_fast_request_t *this;
+
        *key = NULL;
        *value = NULL;
-       private_request_t *this = (private_request_t*)thread_this->get(thread_this);
+       this = (private_fast_request_t*)thread_this->get(thread_this);
+
        if (num < this->req_env_len)
        {
                char *eq;
@@ -165,66 +176,66 @@ static int iterenv_cb(void *null, int num, char **key, char **value)
        return 0;
 }
 
-METHOD(request_t, get_cookie, char*,
-       private_request_t *this, char *name)
+METHOD(fast_request_t, get_cookie, char*,
+       private_fast_request_t *this, char *name)
 {
        return hdf_get_valuef(this->hdf, "Cookie.%s", name);
 }
 
-METHOD(request_t, get_path, char*,
-       private_request_t *this)
+METHOD(fast_request_t, get_path, char*,
+       private_fast_request_t *this)
 {
-       char * path = FCGX_GetParam("PATH_INFO", this->req.envp);
+       char *path = FCGX_GetParam("PATH_INFO", this->req.envp);
        return path ? path : "";
 }
 
-METHOD(request_t, get_host, char*,
-       private_request_t *this)
+METHOD(fast_request_t, get_host, char*,
+       private_fast_request_t *this)
 {
        char *addr = FCGX_GetParam("REMOTE_ADDR", this->req.envp);
        return addr ? addr : "";
 }
 
-METHOD(request_t, get_user_agent, char*,
-       private_request_t *this)
+METHOD(fast_request_t, get_user_agent, char*,
+       private_fast_request_t *this)
 {
        char *agent = FCGX_GetParam("HTTP_USER_AGENT", this->req.envp);
        return agent ? agent : "";
 }
 
-METHOD(request_t, get_query_data, char*,
-       private_request_t *this, char *name)
+METHOD(fast_request_t, get_query_data, char*,
+       private_fast_request_t *this, char *name)
 {
        return hdf_get_valuef(this->hdf, "Query.%s", name);
 }
 
-METHOD(request_t, get_env_var, char*,
-       private_request_t *this, char *name)
+METHOD(fast_request_t, get_env_var, char*,
+       private_fast_request_t *this, char *name)
 {
        return FCGX_GetParam(name, this->req.envp);
 }
 
-METHOD(request_t, read_data, int,
-       private_request_t *this, char *buf, int len)
+METHOD(fast_request_t, read_data, int,
+       private_fast_request_t *this, char *buf, int len)
 {
        return FCGX_GetStr(buf, len, this->req.in);
 }
 
-METHOD(request_t, get_base, char*,
-       private_request_t *this)
+METHOD(fast_request_t, get_base, char*,
+       private_fast_request_t *this)
 {
        return FCGX_GetParam("SCRIPT_NAME", this->req.envp);
 }
 
-METHOD(request_t, add_cookie, void,
-       private_request_t *this, char *name, char *value)
+METHOD(fast_request_t, add_cookie, void,
+       private_fast_request_t *this, char *name, char *value)
 {
        thread_this->set(thread_this, this);
        cgi_cookie_set(this->cgi, name, value, NULL, NULL, NULL, 0, 0);
 }
 
-METHOD(request_t, redirect, void,
-       private_request_t *this, char *fmt, ...)
+METHOD(fast_request_t, redirect, void,
+       private_fast_request_t *this, char *fmt, ...)
 {
        va_list args;
 
@@ -237,14 +248,14 @@ METHOD(request_t, redirect, void,
        FCGX_FPrintF(this->req.out, "\n\n");
 }
 
-METHOD(request_t, get_referer, char*,
-       private_request_t *this)
+METHOD(fast_request_t, get_referer, char*,
+       private_fast_request_t *this)
 {
        return FCGX_GetParam("HTTP_REFERER", this->req.envp);
 }
 
-METHOD(request_t, to_referer, void,
-       private_request_t *this)
+METHOD(fast_request_t, to_referer, void,
+       private_fast_request_t *this)
 {
        char *referer;
 
@@ -260,28 +271,28 @@ METHOD(request_t, to_referer, void,
        }
 }
 
-METHOD(request_t, session_closed, bool,
-       private_request_t *this)
+METHOD(fast_request_t, session_closed, bool,
+       private_fast_request_t *this)
 {
        return this->closed;
 }
 
-METHOD(request_t, close_session, void,
-       private_request_t *this)
+METHOD(fast_request_t, close_session, void,
+       private_fast_request_t *this)
 {
        this->closed = TRUE;
 }
 
-METHOD(request_t, serve, void,
-       private_request_t *this, char *headers, chunk_t chunk)
+METHOD(fast_request_t, serve, void,
+       private_fast_request_t *this, char *headers, chunk_t chunk)
 {
        FCGX_FPrintF(this->req.out, "%s\n\n", headers);
 
        FCGX_PutStr(chunk.ptr, chunk.len, this->req.out);
 }
 
-METHOD(request_t, sendfile, bool,
-       private_request_t *this, char *path, char *mime)
+METHOD(fast_request_t, sendfile, bool,
+       private_fast_request_t *this, char *path, char *mime)
 {
        struct stat sb;
        chunk_t data;
@@ -334,8 +345,8 @@ METHOD(request_t, sendfile, bool,
        return TRUE;
 }
 
-METHOD(request_t, render, void,
-       private_request_t *this, char *template)
+METHOD(fast_request_t, render, void,
+       private_fast_request_t *this, char *template)
 {
        NEOERR* err;
 
@@ -348,8 +359,8 @@ METHOD(request_t, render, void,
        }
 }
 
-METHOD(request_t, streamf, int,
-       private_request_t *this, char *format, ...)
+METHOD(fast_request_t, streamf, int,
+       private_fast_request_t *this, char *format, ...)
 {
        va_list args;
        int written;
@@ -365,14 +376,14 @@ METHOD(request_t, streamf, int,
        return written;
 }
 
-METHOD(request_t, set, void,
-       private_request_t *this, char *key, char *value)
+METHOD(fast_request_t, set, void,
+       private_fast_request_t *this, char *key, char *value)
 {
        hdf_set_value(this->hdf, key, value);
 }
 
-METHOD(request_t, setf, void,
-       private_request_t *this, char *format, ...)
+METHOD(fast_request_t, setf, void,
+       private_fast_request_t *this, char *format, ...)
 {
        va_list args;
 
@@ -381,15 +392,15 @@ METHOD(request_t, setf, void,
        va_end(args);
 }
 
-METHOD(request_t, get_ref, request_t*,
-       private_request_t *this)
+METHOD(fast_request_t, get_ref, fast_request_t*,
+       private_fast_request_t *this)
 {
        ref_get(&this->ref);
        return &this->public;
 }
 
-METHOD(request_t, destroy, void,
-       private_request_t *this)
+METHOD(fast_request_t, destroy, void,
+       private_fast_request_t *this)
 {
        if (ref_put(&this->ref))
        {
@@ -414,10 +425,10 @@ static void init(void)
 /*
  * see header file
  */
-request_t *request_create(int fd, bool debug)
+fast_request_t *fast_request_create(int fd, bool debug)
 {
        NEOERR* err;
-       private_request_t *this;
+       private_fast_request_t *this;
        bool failed = FALSE;
 
        INIT(this,
@@ -496,4 +507,3 @@ request_t *request_create(int fd, bool debug)
        free(this);
        return NULL;
 }
-
similarity index 74%
rename from src/libfast/request.h
rename to src/libfast/fast_request.h
index 63a465bb872c4ca5b7f5815e562e5eeed127e566..678cf54d5e21396b78baecf1ea13b005bb62cdb4 100644 (file)
  */
 
 /**
- * @defgroup request request
+ * @defgroup fast_request fast_request
  * @{ @ingroup libfast
  */
 
-#ifndef REQUEST_H_
-#define REQUEST_H_
+#ifndef FAST_REQUEST_H_
+#define FAST_REQUEST_H_
 
 #include <fcgiapp.h>
 #include <library.h>
 
-typedef struct request_t request_t;
+typedef struct fast_request_t fast_request_t;
 
 /**
  * A HTTP request, encapsulates FCGX_Request.
  *
  * The response is also handled through the request object.
  */
-struct request_t {
+struct fast_request_t {
 
        /**
         * Add a cookie to the reply (Set-Cookie header).
@@ -39,7 +39,7 @@ struct request_t {
         * @param name          name of the cookie to set
         * @param value         value of the cookie
         */
-       void (*add_cookie)(request_t *this, char *name, char *value);
+       void (*add_cookie)(fast_request_t *this, char *name, char *value);
 
        /**
         * Get a cookie the client sent in the request.
@@ -47,35 +47,35 @@ struct request_t {
         * @param name          name of the cookie
         * @return                      cookie value, NULL if no such cookie found
         */
-       char* (*get_cookie)(request_t *this, char *name);
+       char* (*get_cookie)(fast_request_t *this, char *name);
 
        /**
         * Get the request path relative to the application.
         *
         * @return                      path
         */
-       char* (*get_path)(request_t *this);
+       char* (*get_path)(fast_request_t *this);
 
        /**
         * Get the base path of the application.
         *
         * @return                      base path
         */
-       char* (*get_base)(request_t *this);
+       char* (*get_base)(fast_request_t *this);
 
        /**
         * Get the remote host address of this request.
         *
         * @return                      host address as string
         */
-       char* (*get_host)(request_t *this);
+       char* (*get_host)(fast_request_t *this);
 
        /**
         * Get the user agent string.
         *
         * @return                      user agent string
         */
-       char* (*get_user_agent)(request_t *this);
+       char* (*get_user_agent)(fast_request_t *this);
 
        /**
         * Get a post/get variable included in the request.
@@ -83,7 +83,7 @@ struct request_t {
         * @param name          name of the POST/GET variable
         * @return                      value, NULL if not found
         */
-       char* (*get_query_data)(request_t *this, char *name);
+       char* (*get_query_data)(fast_request_t *this, char *name);
 
        /**
         * Get an arbitrary environment variable.
@@ -91,7 +91,7 @@ struct request_t {
         * @param name          name of the environment variable
         * @return                      value, NULL if not found
         */
-       char* (*get_env_var)(request_t *this, char *name);
+       char* (*get_env_var)(fast_request_t *this, char *name);
 
        /**
         * Read raw POST/PUT data from HTTP request.
@@ -100,19 +100,19 @@ struct request_t {
         * @param len           size of the supplied buffer
         * @return                      number of bytes read, < 0 on error
         */
-       int (*read_data)(request_t *this, char *buf, int len);
+       int (*read_data)(fast_request_t *this, char *buf, int len);
 
        /**
         * Close the session and it's context after handling.
         */
-       void (*close_session)(request_t *this);
+       void (*close_session)(fast_request_t *this);
 
        /**
         * Has the session been closed by close_session()?
         *
         * @return                      TRUE if session has been closed
         */
-       bool (*session_closed)(request_t *this);
+       bool (*session_closed)(fast_request_t *this);
 
        /**
         * Redirect the client to another location.
@@ -120,19 +120,19 @@ struct request_t {
         * @param fmt           location format string
         * @param ...           variable argument for fmt
         */
-       void (*redirect)(request_t *this, char *fmt, ...);
+       void (*redirect)(fast_request_t *this, char *fmt, ...);
 
        /**
         * Get the HTTP referer.
         *
         * @return                      HTTP referer
         */
-       char* (*get_referer)(request_t *this);
+       char* (*get_referer)(fast_request_t *this);
 
        /**
         * Redirect back to the referer.
         */
-       void (*to_referer)(request_t *this);
+       void (*to_referer)(fast_request_t *this);
 
        /**
         * Set a template value.
@@ -140,7 +140,7 @@ struct request_t {
         * @param key           key to set
         * @param value         value to set key to
         */
-       void (*set)(request_t *this, char *key, char *value);
+       void (*set)(fast_request_t *this, char *key, char *value);
 
        /**
         * Set a template value using format strings.
@@ -151,7 +151,7 @@ struct request_t {
         * @param format        printf like format string
         * @param ...           variable argument list
         */
-       void (*setf)(request_t *this, char *format, ...);
+       void (*setf)(fast_request_t *this, char *format, ...);
 
        /**
         * Render a template.
@@ -162,7 +162,7 @@ struct request_t {
         *
         * @param template      clearsilver template file location
         */
-       void (*render)(request_t *this, char *template);
+       void (*render)(fast_request_t *this, char *template);
 
        /**
         * Stream a format string to the client.
@@ -174,7 +174,7 @@ struct request_t {
         * @param ...           argmuent list to format string
         * @return                      number of streamed bytes, < 0 if stream closed
         */
-       int (*streamf)(request_t *this, char *format, ...);
+       int (*streamf)(fast_request_t *this, char *format, ...);
 
        /**
         * Serve a request with headers and a body.
@@ -182,7 +182,7 @@ struct request_t {
         * @param headers       HTTP headers, \n separated
         * @param chunk         body to write to output
         */
-       void (*serve)(request_t *this, char *headers, chunk_t chunk);
+       void (*serve)(fast_request_t *this, char *headers, chunk_t chunk);
 
        /**
         * Send a file from the file system.
@@ -191,19 +191,19 @@ struct request_t {
         * @param mime          mime type of file to send, or NULL
         * @return                      TRUE if file served successfully
         */
-       bool (*sendfile)(request_t *this, char *path, char *mime);
+       bool (*sendfile)(fast_request_t *this, char *path, char *mime);
 
        /**
         * Increase the reference count to the stream.
         *
         * @return                      this with increased refcount
         */
-       request_t* (*get_ref)(request_t *this);
+       fast_request_t* (*get_ref)(fast_request_t *this);
 
        /**
-        * Destroy the request_t.
+        * Destroy the fast_request_t.
         */
-       void (*destroy) (request_t *this);
+       void (*destroy) (fast_request_t *this);
 };
 
 /**
@@ -212,6 +212,6 @@ struct request_t {
  * @param fd                   file descripter opened with FCGX_OpenSocket
  * @param debug                        no stripping, no compression, timing information
  */
-request_t *request_create(int fd, bool debug);
+fast_request_t *fast_request_create(int fd, bool debug);
 
 #endif /** REQUEST_H_ @}*/
similarity index 76%
rename from src/libfast/session.c
rename to src/libfast/fast_session.c
index 87a157b619e70bda23cfde52bbf98fbb2e34752b..56d4a0443089d16fbb1c3c7cc169e93a10bc1326 100644 (file)
@@ -15,7 +15,7 @@
 
 #define _GNU_SOURCE
 
-#include "session.h"
+#include "fast_session.h"
 
 #include <string.h>
 #include <fcgiapp.h>
 
 #define COOKIE_LEN 16
 
-typedef struct private_session_t private_session_t;
+typedef struct private_fast_session_t private_fast_session_t;
 
 /**
  * private data of the task manager
  */
-struct private_session_t {
+struct private_fast_session_t {
 
        /**
         * public functions
         */
-       session_t public;
+       fast_session_t public;
 
        /**
         * session ID
@@ -60,17 +60,17 @@ struct private_session_t {
        /**
         * user defined session context
         */
-       context_t *context;
+       fast_context_t *context;
 };
 
-METHOD(session_t, add_controller, void,
-       private_session_t *this, controller_t *controller)
+METHOD(fast_session_t, add_controller, void,
+       private_fast_session_t *this, fast_controller_t *controller)
 {
        this->controllers->insert_last(this->controllers, controller);
 }
 
-METHOD(session_t, add_filter, void,
-       private_session_t *this, filter_t *filter)
+METHOD(fast_session_t, add_filter, void,
+       private_fast_session_t *this, fast_filter_t *filter)
 {
        this->filters->insert_last(this->filters, filter);
 }
@@ -78,7 +78,7 @@ METHOD(session_t, add_filter, void,
 /**
  * Create a session ID and a cookie
  */
-static bool create_sid(private_session_t *this)
+static bool create_sid(private_fast_session_t *this)
 {
        char buf[COOKIE_LEN];
        rng_t *rng;
@@ -101,11 +101,11 @@ static bool create_sid(private_session_t *this)
 /**
  * run all registered filters
  */
-static bool run_filter(private_session_t *this, request_t *request, char *p0,
-                                          char *p1, char *p2, char *p3, char *p4, char *p5)
+static bool run_filter(private_fast_session_t *this, fast_request_t *request,
+                                       char *p0, char *p1, char *p2, char *p3, char *p4, char *p5)
 {
        enumerator_t *enumerator;
-       filter_t *filter;
+       fast_filter_t *filter;
 
        enumerator = this->filters->create_enumerator(this->filters);
        while (enumerator->enumerate(enumerator, &filter))
@@ -120,13 +120,13 @@ static bool run_filter(private_session_t *this, request_t *request, char *p0,
        return TRUE;
 }
 
-METHOD(session_t, process, void,
-       private_session_t *this, request_t *request)
+METHOD(fast_session_t, process, void,
+       private_fast_session_t *this, fast_request_t *request)
 {
        char *pos, *start, *param[6] = {NULL, NULL, NULL, NULL, NULL, NULL};
        enumerator_t *enumerator;
        bool handled = FALSE;
-       controller_t *current;
+       fast_controller_t *current;
        int i = 0;
 
        if (!this->cookie_sent)
@@ -182,17 +182,19 @@ METHOD(session_t, process, void,
        }
 }
 
-METHOD(session_t, get_sid, char*,
-       private_session_t *this)
+METHOD(fast_session_t, get_sid, char*,
+       private_fast_session_t *this)
 {
        return this->sid;
 }
 
-METHOD(session_t, destroy, void,
-       private_session_t *this)
+METHOD(fast_session_t, destroy, void,
+       private_fast_session_t *this)
 {
-       this->controllers->destroy_offset(this->controllers, offsetof(controller_t, destroy));
-       this->filters->destroy_offset(this->filters, offsetof(filter_t, destroy));
+       this->controllers->destroy_offset(this->controllers,
+                                                                         offsetof(fast_controller_t, destroy));
+       this->filters->destroy_offset(this->filters,
+                                                                         offsetof(fast_filter_t, destroy));
        DESTROY_IF(this->context);
        free(this);
 }
@@ -200,9 +202,9 @@ METHOD(session_t, destroy, void,
 /*
  * see header file
  */
-session_t *session_create(context_t *context)
+fast_session_t *fast_session_create(fast_context_t *context)
 {
-       private_session_t *this;
+       private_fast_session_t *this;
 
        INIT(this,
                .public = {
@@ -224,4 +226,3 @@ session_t *session_create(context_t *context)
 
        return &this->public;
 }
-
similarity index 67%
rename from src/libfast/session.h
rename to src/libfast/fast_session.h
index acbab896430d2599af55c2e782fb81bc4da3b9c1..2ff450b9332694b40d8f063edc229902e26395ed 100644 (file)
  */
 
 /**
- * @defgroup session session
+ * @defgroup fast_session fast_session
  * @{ @ingroup libfast
  */
 
-#ifndef SESSION_H_
-#define SESSION_H_
+#ifndef FAST_SESSION_H_
+#define FAST_SESSION_H_
 
-#include "request.h"
-#include "controller.h"
-#include "filter.h"
+#include "fast_request.h"
+#include "fast_controller.h"
+#include "fast_filter.h"
 
-typedef struct session_t session_t;
+typedef struct fast_session_t fast_session_t;
 
 /**
  * Session handling class, instanciated for each user session.
  */
-struct session_t {
+struct fast_session_t {
 
        /**
         * Get the session ID of the session.
         *
         * @return                              session ID
         */
-       char* (*get_sid)(session_t *this);
+       char* (*get_sid)(fast_session_t *this);
 
        /**
         * Add a controller instance to the session.
         *
         * @param controller    controller to add
         */
-       void (*add_controller)(session_t *this, controller_t *controller);
+       void (*add_controller)(fast_session_t *this, fast_controller_t *controller);
 
        /**
         * Add a filter instance to the session.
         *
         * @param filter                filter to add
         */
-       void (*add_filter)(session_t *this, filter_t *filter);
+       void (*add_filter)(fast_session_t *this, fast_filter_t *filter);
 
        /**
         * Process a request in this session.
         *
         * @param request               request to process
         */
-       void (*process)(session_t *this, request_t *request);
+       void (*process)(fast_session_t *this, fast_request_t *request);
 
        /**
-        * Destroy the session_t.
+        * Destroy the fast_session_t.
         */
-       void (*destroy) (session_t *this);
+       void (*destroy) (fast_session_t *this);
 };
 
 /**
@@ -72,6 +72,6 @@ struct session_t {
  * @param context              user defined session context instance
  * @return                             client session, NULL on error
  */
-session_t *session_create(context_t *context);
+fast_session_t *fast_session_create(fast_context_t *context);
 
 #endif /** SESSION_H_ @}*/
similarity index 84%
rename from src/libfast/smtp.c
rename to src/libfast/fast_smtp.c
index a6ca67ddcbcb72d96c76c45e636eff4299cb3f4f..89e74d79b0d3d1cba4eba1ba8aee46190910c582 100644 (file)
  * for more details.
  */
 
-#include "smtp.h"
+#include "fast_smtp.h"
 
 #include <unistd.h>
 #include <errno.h>
 
 #include <utils/debug.h>
 
-typedef struct private_smtp_t private_smtp_t;
+typedef struct private_fast_smtp_t private_fast_smtp_t;
 
 /**
- * Private data of an smtp_t object.
+ * Private data of an fast_smtp_t object.
  */
-struct private_smtp_t {
+struct private_fast_smtp_t {
 
        /**
-        * Public smtp_t interface.
+        * Public fast_smtp_t interface.
         */
-       smtp_t public;
+       fast_smtp_t public;
 
        /**
         * file stream to SMTP server
@@ -41,7 +41,7 @@ struct private_smtp_t {
 /**
  * Read the response code from an SMTP server
  */
-static int read_response(private_smtp_t *this)
+static int read_response(private_fast_smtp_t *this)
 {
        char buf[256], *end;
        int res = 0;
@@ -72,7 +72,7 @@ static int read_response(private_smtp_t *this)
 /**
  * write a SMTP command to the server, read response code
  */
-static int write_cmd(private_smtp_t *this, char *fmt, ...)
+static int write_cmd(private_fast_smtp_t *this, char *fmt, ...)
 {
        char buf[256];
        va_list args;
@@ -89,8 +89,8 @@ static int write_cmd(private_smtp_t *this, char *fmt, ...)
        return read_response(this);
 }
 
-METHOD(smtp_t, send_mail, bool,
-       private_smtp_t *this, char *from, char *to, char *subject, char *fmt, ...)
+METHOD(fast_smtp_t, send_mail, bool,
+       private_fast_smtp_t *this, char *from, char *to, char *subject, char *fmt, ...)
 {
        va_list args;
 
@@ -122,8 +122,8 @@ METHOD(smtp_t, send_mail, bool,
 }
 
 
-METHOD(smtp_t, destroy, void,
-       private_smtp_t *this)
+METHOD(fast_smtp_t, destroy, void,
+       private_fast_smtp_t *this)
 {
        write_cmd(this, "QUIT");
        fclose(this->f);
@@ -133,9 +133,9 @@ METHOD(smtp_t, destroy, void,
 /**
  * See header
  */
-smtp_t *smtp_create()
+fast_smtp_t *fast_smtp_create()
 {
-       private_smtp_t *this;
+       private_fast_smtp_t *this;
        struct sockaddr_in addr = {
                .sin_family = AF_INET,
                .sin_port = htons(25),
@@ -185,4 +185,3 @@ smtp_t *smtp_create()
        }
        return &this->public;
 }
-
similarity index 77%
rename from src/libfast/smtp.h
rename to src/libfast/fast_smtp.h
index 9589ea2a69ab89fbdd9f5765fe6432cf47abe53f..962ba2cc7c1a3e03e71706afd15ef9870956d267 100644 (file)
  */
 
 /**
- * @defgroup smtp smtp
+ * @defgroup fast_smtp fast_smtp
  * @{ @ingroup libfast
  */
 
-#ifndef SMTP_H_
-#define SMTP_H_
+#ifndef FAST_SMTP_H_
+#define FAST_SMTP_H_
 
-typedef struct smtp_t smtp_t;
+typedef struct fast_smtp_t fast_smtp_t;
 
 #include <library.h>
 
 /**
  * Ultra-minimalistic SMTP client. Works at most with Exim on localhost.
  */
-struct smtp_t {
+struct fast_smtp_t {
 
        /**
         * Send an e-mail message.
@@ -39,18 +39,18 @@ struct smtp_t {
         * @param fmt           mail body format string
         * @param ...           arguments for body format string
         */
-       bool (*send_mail)(smtp_t *this, char *from, char *to,
+       bool (*send_mail)(fast_smtp_t *this, char *from, char *to,
                                          char *subject, char *fmt, ...);
 
        /**
-        * Destroy a smtp_t.
+        * Destroy a fast_smtp_t.
         */
-       void (*destroy)(smtp_t *this);
+       void (*destroy)(fast_smtp_t *this);
 };
 
 /**
  * Create a smtp instance.
  */
-smtp_t *smtp_create();
+fast_smtp_t *fast_smtp_create();
 
-#endif /** SMTP_H_ @}*/
+#endif /** FAST_SMTP_H_ @}*/
index c9a9b546164122c44f8b8a81f0f448b72d33dd39..5f2de5154145534605591c1d7e40d7df16c2d568 100644 (file)
@@ -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;
 }
-
index 8489d9dd36866275e1b704daa0fe52619204167d..07292273deb93d1b3fc99755815698db5046b355 100644 (file)
@@ -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_ @}*/
index 154ab615e09b7a5611fa222032089fac67977886..bc93c542dd4f9173b432508e7b7fc74570677c76 100644 (file)
@@ -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;
 }
-
index a84678c9aa76cfd4dbc07d6c7e9d0f48cb99e878..504ec8c3b53e66546706e8329dbd2f55a537a062 100644 (file)
@@ -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_ @}*/
index 68238d02f784a3449c8bfc44c328ff608c77a9c4..f275986d2166a700e700d28971d61a0e7f399f81 100644 (file)
@@ -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;
 }
-
index 22e3a70220c47a4848ac9a0d45dc065b454b38e9..0342f8ca2921514405cdab5ec794862ed6b5d012 100644 (file)
@@ -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_ @}*/
index 39d3445024286a0b6193348f76c9bfa882dc7e11..6c02579809ecbd167eb419af030284d507862284 100644 (file)
@@ -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;
 }
-
index a0999295e9e56a5c2c242467245c19ea7d3b37ad..170bc1bdb7cd59988120727f3ff4071daea5af68 100644 (file)
@@ -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_ @}*/
index 716d51a7aaa7e677f6cf411e0717d18954e79efc..df0e5f47576d56b69a4bda42ee3dfc0e92e9cc82 100644 (file)
@@ -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;
 }
-
index 72f8242f11301801cc71a13498e5bf952dca8509..5920475392065489331f2325746a90a00494facb 100644 (file)
@@ -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_ @}*/
index 66a4384ccf85ea7ea4e877704634a43cdf7200e6..5c845b157e1bcf254283d9c07c94a3de4139cfdc 100644 (file)
@@ -13,7 +13,7 @@
  * for more details.
  */
 
-#include <dispatcher.h>
+#include <fast_dispatcher.h>
 #include <utils/debug.h>
 #include <stdio.h>
 
@@ -27,7 +27,7 @@
 
 int main (int arc, char *argv[])
 {
-       dispatcher_t *dispatcher;
+       fast_dispatcher_t *dispatcher;
        storage_t *storage;
        char *socket;
        char *database;
@@ -50,7 +50,7 @@ int main (int arc, char *argv[])
        {
                DBG1(DBG_LIB, "database URI undefined, set manager.database "
                         "in strongswan.conf");
-               return 1;
+               //return 1;
        }
 
        storage = storage_create(database);
@@ -59,8 +59,8 @@ int main (int arc, char *argv[])
                return 1;
        }
 
-       dispatcher = dispatcher_create(socket, debug, timeout,
-                                               (context_constructor_t)manager_create, storage);
+       dispatcher = fast_dispatcher_create(socket, debug, timeout,
+                                               (fast_context_constructor_t)manager_create, storage);
        dispatcher->add_controller(dispatcher, ikesa_controller_create, NULL);
        dispatcher->add_controller(dispatcher, gateway_controller_create, NULL);
        dispatcher->add_controller(dispatcher, auth_controller_create, NULL);
@@ -78,4 +78,3 @@ int main (int arc, char *argv[])
 
        return 0;
 }
-
index 207800bd239ab23c854518bf9ba683aca6fd1c30..22a4191d94ffb4feebbc0a2fb670a9bb3477512d 100644 (file)
@@ -118,7 +118,7 @@ METHOD(manager_t, logout, void,
        this->user = 0;
 }
 
-METHOD(context_t, destroy, void,
+METHOD(fast_context_t, destroy, void,
        private_manager_t *this)
 {
        if (this->gateway) this->gateway->destroy(this->gateway);
@@ -148,4 +148,3 @@ manager_t *manager_create(storage_t *storage)
 
        return &this->public;
 }
-
index a72801f1b316dcf70133e8236ff76ebaf903f868..e0ed7fcafdd54f53be8aabc8e892bb64a8c7dbfc 100644 (file)
@@ -29,7 +29,7 @@
 #include "storage.h"
 #include "gateway.h"
 
-#include <context.h>
+#include <fast_context.h>
 
 typedef struct manager_t manager_t;
 
@@ -41,7 +41,7 @@ struct manager_t {
        /**
         * implements context_t interface
         */
-       context_t context;
+       fast_context_t context;
 
        /**
         * Create an enumerator over all configured gateways.
index 7b0b9e6ac9a68b0717b7910cbe2bc1ccf86007cc..4943647b5595c2c5fb4c45fa6fd4e632b95ca8f7 100644 (file)
@@ -52,7 +52,7 @@ struct private_peer_controller_t {
 /**
  * list the configured peer configs
  */
-static void list(private_peer_controller_t *this, request_t *request)
+static void list(private_peer_controller_t *this, fast_request_t *request)
 {
        enumerator_t *query;
 
@@ -83,7 +83,7 @@ static void list(private_peer_controller_t *this, request_t *request)
 /**
  * verify a peer alias
  */
-static bool verify_alias(private_peer_controller_t *this, request_t *request,
+static bool verify_alias(private_peer_controller_t *this, fast_request_t *request,
                                                 char *alias)
 {
        if (!alias || *alias == '\0')
@@ -117,7 +117,7 @@ static bool verify_alias(private_peer_controller_t *this, request_t *request,
  * parse and verify a public key
  */
 static bool parse_public_key(private_peer_controller_t *this,
-                                                        request_t *request, char *public_key,
+                                                        fast_request_t *request, char *public_key,
                                                         chunk_t *encoding, chunk_t *keyid)
 {
        public_key_t *public;
@@ -153,7 +153,7 @@ static bool parse_public_key(private_peer_controller_t *this,
 /**
  * register a new peer
  */
-static void add(private_peer_controller_t *this, request_t *request)
+static void add(private_peer_controller_t *this, fast_request_t *request)
 {
        char *alias = "", *public_key = "";
 
@@ -231,7 +231,7 @@ char* pem_encode(chunk_t der)
 /**
  * edit a peer
  */
-static void edit(private_peer_controller_t *this, request_t *request, int id)
+static void edit(private_peer_controller_t *this, fast_request_t *request, int id)
 {
        char *alias = "", *public_key = "", *pem;
        chunk_t encoding, keyid;
@@ -305,21 +305,21 @@ static void edit(private_peer_controller_t *this, request_t *request, int id)
 /**
  * delete a peer from the database
  */
-static void delete(private_peer_controller_t *this, request_t *request, int id)
+static void delete(private_peer_controller_t *this, fast_request_t *request, int id)
 {
        this->db->execute(this->db, NULL,
                                          "DELETE FROM peer WHERE id = ? AND user = ?",
                                          DB_INT, id, DB_UINT, this->user->get_user(this->user));
 }
 
-METHOD(controller_t, get_name, char*,
+METHOD(fast_controller_t, get_name, char*,
        private_peer_controller_t *this)
 {
        return "peer";
 }
 
-METHOD(controller_t, handle, void,
-       private_peer_controller_t *this, request_t *request, char *action,
+METHOD(fast_controller_t, handle, void,
+       private_peer_controller_t *this, fast_request_t *request, char *action,
        char *idstr, char *p3, char *p4, char *p5)
 {
        if (action)
@@ -350,7 +350,7 @@ METHOD(controller_t, handle, void,
        request->redirect(request, "peer/list");
 }
 
-METHOD(controller_t, destroy, void,
+METHOD(fast_controller_t, destroy, void,
        private_peer_controller_t *this)
 {
        free(this);
@@ -359,7 +359,7 @@ METHOD(controller_t, destroy, void,
 /*
  * see header file
  */
-controller_t *peer_controller_create(user_t *user, database_t *db)
+fast_controller_t *peer_controller_create(user_t *user, database_t *db)
 {
        private_peer_controller_t *this;
 
@@ -377,4 +377,3 @@ controller_t *peer_controller_create(user_t *user, database_t *db)
 
        return &this->public.controller;
 }
-
index b5a5e0bb800fab88119dc4317d56031b66aedda6..1282156b7075d5999a30a94a9f82334c620157c5 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <user.h>
 
-#include <controller.h>
+#include <fast_controller.h>
 #include <database/database.h>
 
 typedef struct peer_controller_t peer_controller_t;
@@ -37,12 +37,12 @@ struct peer_controller_t {
        /**
         * Implements controller_t interface.
         */
-       controller_t controller;
+       fast_controller_t controller;
 };
 
 /**
  * Create a peer_controller controller instance.
  */
-controller_t *peer_controller_create(user_t *user, database_t *db);
+fast_controller_t *peer_controller_create(user_t *user, database_t *db);
 
 #endif /** PEER_CONTROLLER_H_ @}*/
index 35c9d90c8aa63a2d49c7784bf5d7d382c7329c67..36d04e12c2561315450f76cd899692bc97526c33 100644 (file)
@@ -76,7 +76,7 @@ static chunk_t hash_password(char *login, char *password)
 /**
  * Login a user.
  */
-static void login(private_user_controller_t *this, request_t *request)
+static void login(private_user_controller_t *this, fast_request_t *request)
 {
        if (request->get_query_data(request, "submit"))
        {
@@ -115,7 +115,7 @@ static void login(private_user_controller_t *this, request_t *request)
 /**
  * Logout a user.
  */
-static void logout(private_user_controller_t *this, request_t *request)
+static void logout(private_user_controller_t *this, fast_request_t *request)
 {
        request->redirect(request, "user/login");
        request->close_session(request);
@@ -124,8 +124,8 @@ static void logout(private_user_controller_t *this, request_t *request)
 /**
  * verify a user entered username for validity
  */
-static bool verify_login(private_user_controller_t *this, request_t *request,
-                                                char *login)
+static bool verify_login(private_user_controller_t *this,
+                                                fast_request_t *request, char *login)
 {
        if (!login || *login == '\0')
        {
@@ -156,7 +156,8 @@ static bool verify_login(private_user_controller_t *this, request_t *request,
 /**
  * verify a user entered password for validity
  */
-static bool verify_password(private_user_controller_t *this, request_t *request,
+static bool verify_password(private_user_controller_t *this,
+                                                       fast_request_t *request,
                                                        char *password, char *confirm)
 {
        if (!password || *password == '\0')
@@ -181,7 +182,7 @@ static bool verify_password(private_user_controller_t *this, request_t *request,
 /**
  * Register a user.
  */
-static void add(private_user_controller_t *this, request_t *request)
+static void add(private_user_controller_t *this, fast_request_t *request)
 {
        char *login = "";
 
@@ -222,7 +223,7 @@ static void add(private_user_controller_t *this, request_t *request)
 /**
  * Edit the logged in user
  */
-static void edit(private_user_controller_t *this, request_t *request)
+static void edit(private_user_controller_t *this, fast_request_t *request)
 {
        enumerator_t *query;
        char *old_login;
@@ -297,14 +298,14 @@ static void edit(private_user_controller_t *this, request_t *request)
        request->render(request, "templates/user/edit.cs");
 }
 
-METHOD(controller_t, get_name, char*,
+METHOD(fast_controller_t, get_name, char*,
        private_user_controller_t *this)
 {
        return "user";
 }
 
-METHOD(controller_t, handle, void,
-       private_user_controller_t *this, request_t *request, char *action,
+METHOD(fast_controller_t, handle, void,
+       private_user_controller_t *this, fast_request_t *request, char *action,
        char *p2, char *p3, char *p4, char *p5)
 {
        if (action)
@@ -333,7 +334,7 @@ METHOD(controller_t, handle, void,
        request->redirect(request, "user/login");
 }
 
-METHOD(controller_t, destroy, void,
+METHOD(fast_controller_t, destroy, void,
        private_user_controller_t *this)
 {
        free(this);
@@ -342,7 +343,7 @@ METHOD(controller_t, destroy, void,
 /*
  * see header file
  */
-controller_t *user_controller_create(user_t *user, database_t *db)
+fast_controller_t *user_controller_create(user_t *user, database_t *db)
 {
        private_user_controller_t *this;
 
@@ -362,4 +363,3 @@ controller_t *user_controller_create(user_t *user, database_t *db)
 
        return &this->public.controller;
 }
-
index 540dc74a25bc25a00f34af829ff20a0a746f5e0d..8443a8d2b1d0d3f12c6054a8bb3990255f617f09 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <user.h>
 
-#include <controller.h>
+#include <fast_controller.h>
 #include <database/database.h>
 
 typedef struct user_controller_t user_controller_t;
@@ -37,12 +37,12 @@ struct user_controller_t {
        /**
         * Implements controller_t interface.
         */
-       controller_t controller;
+       fast_controller_t controller;
 };
 
 /**
  * Create a user_controller controller instance.
  */
-controller_t *user_controller_create(user_t *user, database_t *db);
+fast_controller_t *user_controller_create(user_t *user, database_t *db);
 
 #endif /** USER_CONTROLLER_H_ @}*/
index 436a72f2b99f95c4a7abc414b5d69319e443f2a3..fb39bdb0ef7f2b70ff3533db4d153c7511b0c596 100644 (file)
@@ -40,8 +40,8 @@ struct private_auth_filter_t {
        database_t *db;
 };
 
-METHOD(filter_t, run, bool,
-       private_auth_filter_t *this, request_t *request, char *controller,
+METHOD(fast_filter_t, run, bool,
+       private_auth_filter_t *this, fast_request_t *request, char *controller,
        char *action, char *p2, char *p3, char *p4, char *p5)
 {
        if (this->user->get_user(this->user))
@@ -70,7 +70,7 @@ METHOD(filter_t, run, bool,
        return FALSE;
 }
 
-METHOD(filter_t, destroy, void,
+METHOD(fast_filter_t, destroy, void,
        private_auth_filter_t *this)
 {
        free(this);
@@ -79,7 +79,7 @@ METHOD(filter_t, destroy, void,
 /*
  * see header file
  */
-filter_t *auth_filter_create(user_t *user, database_t *db)
+fast_filter_t *auth_filter_create(user_t *user, database_t *db)
 {
        private_auth_filter_t *this;
 
@@ -96,4 +96,3 @@ filter_t *auth_filter_create(user_t *user, database_t *db)
 
        return &this->public.filter;
 }
-
index beae27965d8450a3e23b565e4caf5959c1826c57..022254dded95b5c4fe16f8856a82d6f87e429ed9 100644 (file)
@@ -23,7 +23,7 @@
 #define AUTH_FILTER_H_
 
 #include <library.h>
-#include <filter.h>
+#include <fast_filter.h>
 
 #include "user.h"
 
@@ -37,12 +37,12 @@ struct auth_filter_t {
        /**
         * Implements filter_t interface.
         */
-       filter_t filter;
+       fast_filter_t filter;
 };
 
 /**
  * Create a auth_filter instance.
  */
-filter_t *auth_filter_create(user_t *user, database_t *db);
+fast_filter_t *auth_filter_create(user_t *user, database_t *db);
 
 #endif /** AUTH_FILTER_H_  @}*/
index cbba728722f313f3670880f2b564ed475151fe80..6f08b97e562200438d2b101b40de83708c0f3ce0 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <stdio.h>
 
-#include <dispatcher.h>
+#include <fast_dispatcher.h>
 #include <utils/debug.h>
 #include <database/database.h>
 
@@ -26,7 +26,7 @@
 
 int main(int arc, char *argv[])
 {
-       dispatcher_t *dispatcher;
+       fast_dispatcher_t *dispatcher;
        database_t *db;
        char *socket;
        bool debug;
@@ -58,14 +58,14 @@ int main(int arc, char *argv[])
                return 1;
        }
 
-       dispatcher = dispatcher_create(socket, debug, timeout,
-                                                                  (context_constructor_t)user_create, db);
+       dispatcher = fast_dispatcher_create(socket, debug, timeout,
+                                       (fast_context_constructor_t)user_create, db);
        dispatcher->add_filter(dispatcher,
-                                               (filter_constructor_t)auth_filter_create, db);
+                                       (fast_filter_constructor_t)auth_filter_create, db);
        dispatcher->add_controller(dispatcher,
-                                               (controller_constructor_t)user_controller_create, db);
+                                       (fast_controller_constructor_t)user_controller_create, db);
        dispatcher->add_controller(dispatcher,
-                                               (controller_constructor_t)peer_controller_create, db);
+                                       (fast_controller_constructor_t)peer_controller_create, db);
 
        dispatcher->run(dispatcher, threads);
 
@@ -76,4 +76,3 @@ int main(int arc, char *argv[])
        library_deinit();
        return 0;
 }
-
index b4859080b4d18e8a3127426886158982ebad1b12..023dafbedcfe70f14a16765ab0dcc063b4e4b07c 100644 (file)
@@ -45,7 +45,7 @@ METHOD(user_t, get_user, u_int,
        return this->user;
 }
 
-METHOD(context_t, destroy, void,
+METHOD(fast_context_t, destroy, void,
        private_user_t *this)
 {
        free(this);
@@ -70,4 +70,3 @@ user_t *user_create(void *param)
 
        return &this->public;
 }
-
index beeed6ec1e6df8cca142e0228d7fdf3239676774..475972a5bacd27e126ef5dbeab89451bc1a724d7 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef USER_H_
 #define USER_H_
 
-#include <context.h>
+#include <fast_context.h>
 #include <library.h>
 
 typedef struct user_t user_t;
@@ -36,7 +36,7 @@ struct user_t {
        /**
         * implements context_t interface
         */
-       context_t context;
+       fast_context_t context;
 
        /**
         * Set the user ID of the logged in user.