diff options
Diffstat (limited to 'src/libcharon/daemon.h')
-rw-r--r-- | src/libcharon/daemon.h | 91 |
1 files changed, 56 insertions, 35 deletions
diff --git a/src/libcharon/daemon.h b/src/libcharon/daemon.h index 2e01c8d9b..b67de77b8 100644 --- a/src/libcharon/daemon.h +++ b/src/libcharon/daemon.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2010 Tobias Brunner + * Copyright (C) 2006-2012 Tobias Brunner * Copyright (C) 2005-2009 Martin Willi * Copyright (C) 2006 Daniel Roethlisberger * Copyright (C) 2005 Jan Hutter @@ -55,15 +55,30 @@ * @defgroup sa sa * @ingroup libcharon * - * @defgroup authenticators authenticators + * @defgroup ikev1 ikev1 * @ingroup sa * + * @defgroup ikev2 ikev2 + * @ingroup sa + * + * @defgroup authenticators_v1 authenticators + * @ingroup ikev1 + * + * @defgroup authenticators_v2 authenticators + * @ingroup ikev2 + * * @defgroup eap eap - * @ingroup authenticators + * @ingroup sa * - * @defgroup tasks tasks + * @defgroup xauth xauth * @ingroup sa * + * @defgroup tasks_v1 tasks + * @ingroup ikev1 + * + * @defgroup tasks_v2 tasks + * @ingroup ikev2 + * * @addtogroup libcharon * @{ * @@ -148,11 +163,13 @@ typedef struct daemon_t daemon_t; #include <sa/trap_manager.h> #include <sa/shunt_manager.h> #include <config/backend_manager.h> -#include <sa/authenticators/eap/eap_manager.h> +#include <sa/eap/eap_manager.h> +#include <sa/xauth/xauth_manager.h> +#include <utils/capabilities.h> #ifdef ME -#include <sa/connect_manager.h> -#include <sa/mediation_manager.h> +#include <sa/ikev2/connect_manager.h> +#include <sa/ikev2/mediation_manager.h> #endif /* ME */ /** @@ -161,16 +178,31 @@ typedef struct daemon_t daemon_t; #define DEFAULT_THREADS 16 /** - * UDP Port on which the daemon will listen for incoming traffic. + * Primary UDP port used by IKE. */ #define IKEV2_UDP_PORT 500 /** - * UDP Port to which the daemon will float to if NAT is detected. + * UDP port defined for use in case a NAT is detected. */ #define IKEV2_NATT_PORT 4500 /** + * UDP port on which the daemon will listen for incoming traffic (also used as + * source port for outgoing traffic). + */ +#ifndef CHARON_UDP_PORT +#define CHARON_UDP_PORT IKEV2_UDP_PORT +#endif + +/** + * UDP port used by the daemon in case a NAT is detected. + */ +#ifndef CHARON_NATT_PORT +#define CHARON_NATT_PORT IKEV2_NATT_PORT +#endif + +/** * Main class of daemon, contains some globals. */ struct daemon_t { @@ -235,6 +267,11 @@ struct daemon_t { */ eap_manager_t *eap; + /** + * XAuth manager to maintain registered XAuth methods + */ + xauth_manager_t *xauth; + #ifdef ME /** * Connect manager @@ -248,39 +285,22 @@ struct daemon_t { #endif /* ME */ /** - * User ID the daemon will user after initialization + * POSIX capability dropping */ - uid_t uid; + capabilities_t *caps; /** - * Group ID the daemon will use after initialization - */ - gid_t gid; - - /** - * Do not drop a given capability after initialization. - * - * Some plugins might need additional capabilites. They tell the daemon - * during plugin initialization which one they need, the daemon won't - * drop these. + * Name of the binary that uses the library (used for settings etc.) */ - void (*keep_cap)(daemon_t *this, u_int cap); - - /** - * Drop all capabilities of the current process. - * - * Drops all capabalities, excect those exlcuded using keep_cap(). - * This should be called after the initialization of the daemon because - * some plugins require the process to keep additional capabilities. - * - * @return TRUE if successful, FALSE otherwise - */ - bool (*drop_capabilities)(daemon_t *this); + const char *name; /** * Initialize the daemon. + * + * @param plugins list of plugins to load + * @return TRUE, if successful */ - bool (*initialize)(daemon_t *this); + bool (*initialize)(daemon_t *this, char *plugins); /** * Starts the daemon, i.e. spawns the threads of the thread pool. @@ -302,9 +322,10 @@ extern daemon_t *charon; * This function initializes the bus, listeners can be registered before * calling initialize(). * + * @param name name of the binary that uses the library * @return FALSE if integrity check failed */ -bool libcharon_init(); +bool libcharon_init(const char *name); /** * Deinitialize libcharon and destroy the "charon" instance of daemon_t. |