added more API documentation to backends/interfaces

This commit is contained in:
Martin Willi
2007-04-30 10:23:01 +00:00
parent 5fc278edf3
commit 0ccb275a93
7 changed files with 40 additions and 20 deletions
+9 -5
View File
@@ -34,12 +34,16 @@ typedef struct backend_manager_t backend_manager_t;
/** /**
* @brief A multiplexer to use multiple backends. * @brief A loader and multiplexer to use multiple backends.
* *
* Charon allows the use of multiple backend_manager backends simultaneously. To * Charon allows the use of multiple configuration backends simultaneously. To
* access all this backends by a single call, this class wraps multiple * access all this backends by a single call, this class wraps multiple
* backends behind a single object. * backends behind a single object. It is also responsible for loading
* Backends may be registered and unregister at runtime dynamically. * the backend modules and cleaning them up.
* A backend may be writeable or not. All backends implement the backend_t
* interface, those who are writeable additionally implement the
* writeable_backend_t interface. Adding configs to the backend_manager will
* be redirected to the first writeable backend.
* @verbatim * @verbatim
+---------+ +-----------+ +--------------+ | +---------+ +-----------+ +--------------+ |
@@ -106,7 +110,7 @@ struct backend_manager_t {
}; };
/** /**
* @brief Create a new instance of the manager and loads all backends. * @brief Creates a new instance of the manager and loads all backends.
* *
* @return backend_manager instance * @return backend_manager instance
* *
+3 -3
View File
@@ -33,12 +33,12 @@ typedef struct backend_t backend_t;
/** /**
* @brief The interface for a configuration backend. * @brief The interface for a configuration backend.
* *
* A configuration backend is registered in the cfg_store. It does the actual * A configuration backend is loaded by the backend_manager. It does the actual
* configuration lookup for the method it implements. See cfg_store_t for * configuration lookup for the method it implements. See backend_manager_t for
* more information. * more information.
* *
* @b Constructors: * @b Constructors:
* - none, use implementations of backend_t. * - implementations constructors
* *
* @ingroup backends * @ingroup backends
*/ */
+2 -2
View File
@@ -29,7 +29,7 @@ typedef struct local_backend_t local_backend_t;
#include <config/backends/writeable_backend.h> #include <config/backends/writeable_backend.h>
/** /**
* @brief An in-memory backend to store configuration information. * @brief An in-memory backend to store configurations.
* *
* The local_backend_t stores the configuration in a simple list. It * The local_backend_t stores the configuration in a simple list. It
* implements both, backend_t and writeable_backend_t. * implements both, backend_t and writeable_backend_t.
@@ -50,7 +50,7 @@ struct local_backend_t {
/** /**
* @brief Create a backend_t instance implemented as local backend. * @brief Create a backend_t instance implemented as local backend.
* *
* @return backend instance. * @return backend instance
* *
* @ingroup backends * @ingroup backends
*/ */
@@ -29,7 +29,7 @@ typedef struct writeable_backend_t writeable_backend_t;
#include <config/backends/backend.h> #include <config/backends/backend.h>
/** /**
* @brief A writeable backend extends the backend by modification functions. * @brief A writeable backend extends backend_t by modification functions.
* *
* @b Constructors: * @b Constructors:
* - writeable_backend_create() * - writeable_backend_create()
+18 -3
View File
@@ -26,7 +26,7 @@
#include <bus/bus.h> #include <bus/bus.h>
/** /**
* callback to log things triggered by interface_manager * callback to log things triggered by interface_manager.
* *
* @param param echoed parameter supplied when function invoked * @param param echoed parameter supplied when function invoked
* @param signal type of signal * @param signal type of signal
@@ -43,8 +43,23 @@ typedef bool(*interface_manager_cb_t)(void* param, signal_t signal, level_t leve
typedef struct interface_manager_t interface_manager_t; typedef struct interface_manager_t interface_manager_t;
/** /**
* @brief The interface_manager controls the daemon. * @brief The interface_manager loads control interfaces and has helper methods.
* *
* One job of the interface manager is to load pluggable control interface
* modules, implemented as interface_t.
* @verbatim
+---------+ +------------+ +--------------+ |
| | | |<----- +--------------+ | |
| daemon |<-----| interface- | +--------------+ |-+ <==|==> IPC
| core | | manager |<----| interfaces |-+ |
| |<-----| | +--------------+ |
| | | | |
+---------+ +------------+ |
@endverbatim
* The manager does not really use the interfaces, instead, the interface
* use the manager to fullfill their tasks (initiating, terminating, ...).
* The interface_manager starts actions by creating jobs. It then tries to * The interface_manager starts actions by creating jobs. It then tries to
* evaluate the result of the operation by listening on the bus. * evaluate the result of the operation by listening on the bus.
* *
@@ -82,7 +97,7 @@ struct interface_manager_t {
/** /**
* @brief Create a interface_manager instance and loads all interface modules. * @brief Creates a interface_manager instance and loads all interface modules.
* *
* @return interface_manager_t object * @return interface_manager_t object
* *
@@ -27,6 +27,10 @@ typedef struct interface_t interface_t;
/** /**
* @brief Interface for a controller. * @brief Interface for a controller.
*
* An interface controls the daemon by calling functions on the
* interface_manager. All interfaces are manager by the interface_manager
* in a generic way, so they need their own class.
* *
* @b Constructors: * @b Constructors:
* - interface_create() of one of the modules * - interface_create() of one of the modules
@@ -28,13 +28,10 @@ typedef struct stroke_interface_t stroke_interface_t;
#include <control/interfaces/interface.h> #include <control/interfaces/interface.h>
/** /**
* @brief Stroke is a configuration and control interface which * @brief Simple configuration interface using unix-sockets.
* allows other processes to modify charons behavior.
* *
* stroke_t allows config manipulation (as whack in pluto). Configurations * Stroke is a home-brewed communication interface inspired by whack. It
* are stored in a special backend, the in-memory local_backend_t. * uses a unix socket (/var/run/charon.ctl).
* Messages of type stroke_msg_t's are sent over a unix socket
* (/var/run/charon.ctl).
* *
* @b Constructors: * @b Constructors:
* - stroke_create() * - stroke_create()