The introduced SHA1_NOFINAL hasher was not sufficient for EAP-AKA,
[strongswan.git] / src / libstrongswan / library.h
index 00472bd..9d151c4 100644 (file)
@@ -1,14 +1,7 @@
-/**
- * @file library.h
- * 
- * @brief Global library header.
- * 
- */
-
 /*
- * Copyright (C) 2006 Martin Willi
+ * Copyright (C) 2008 Martin Willi
  * Hochschule fuer Technik Rapperswil
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * Free Software Foundation; either version 2 of the License, or (at your
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  * for more details.
+ *
+ * $Id$
  */
 
-#ifndef LIBRARY_H_
-#define LIBRARY_H_
-
 /**
  * @defgroup libstrongswan libstrongswan
  *
- * libstrongswan: library with various crypto related things.
- */
-
-/**
  * @defgroup asn1 asn1
+ * @ingroup libstrongswan
  *
- * ASN1 definitions, parser and generator functions.
- *
+ * @defgroup credentials credentials
  * @ingroup libstrongswan
- */
-
-/**
- * @defgroup crypto crypto
  *
- * Crypto algorithms of different kind.
+ * @defgroup keys keys
+ * @ingroup credentials
+ *
+ * @defgroup certificates certificates
+ * @ingroup credentials
  *
+ * @defgroup crypto crypto
+ * @ingroup libstrongswan
+ * @defgroup database database
+ * @ingroup libstrongswan
+ * @defgroup fetcher fetcher
+ * @ingroup libstrongswan
+ * @defgroup fips fips
+ * @ingroup libstrongswan
+ * @defgroup plugins plugins
+ * @ingroup libstrongswan
+ * @defgroup utils utils
  * @ingroup libstrongswan
  */
 
 /**
- * @defgroup crypters crypters
- *
- * Symmetric encryption algorithms, used for
- * encryption and decryption.
- *
- * @ingroup crypto
+ * @defgroup library library
+ * @{ @ingroup libstrongswan
  */
 
-/**
- * @defgroup hashers hashers
- *
- * Hashing algorithms, such as MD5 or SHA1
- *
- * @ingroup crypto
- */
+#ifndef LIBRARY_H_
+#define LIBRARY_H_
+
+#include <utils.h>
+#include <chunk.h>
+#include <settings.h>
+#include <printf_hook.h>
+#include <plugins/plugin_loader.h>
+#include <crypto/crypto_factory.h>
+#include <credentials/credential_factory.h>
+#include <fetcher/fetcher_manager.h>
+#include <database/database_factory.h>
+
+typedef struct library_t library_t;
 
 /**
- * @defgroup prfs prfs
- *
- * Pseudo random functions, used to generate 
- * pseude random byte sequences.
- *
- * @ingroup crypto
+ * Libstrongswan library context, contains library relevant globals.
  */
+struct library_t {
+
+       /**
+        * Printf hook registering facility
+        */
+       printf_hook_t *printf_hook;
+       
+       /**
+        * crypto algorithm registry and factory
+        */
+       crypto_factory_t *crypto;
+       
+       /**
+        * credential constructor registry and factory
+        */
+       credential_factory_t *creds;
+       
+       /**
+        * URL fetching facility
+        */
+       fetcher_manager_t *fetcher;
+       
+       /**
+        * database construction factory
+        */
+       database_factory_t *db;
+       
+       /**
+        * plugin loading facility
+        */
+       plugin_loader_t *plugins;
+       
+       /**
+        * various settings loaded from settings file
+        */
+       settings_t *settings;
+};
 
 /**
- * @defgroup rsa rsa
- *
- * RSA private/public key algorithm.
+ * Initialize library, creates "lib" instance.
  *
- * @ingroup crypto
+ * @param settings             file to read settings from, may be NULL for none
  */
+void library_init(char *settings);
 
 /**
- * @defgroup signers signers
- *
- * Symmetric signing algorithms, 
- * used to ensure message integrity.
- * 
- * @ingroup crypto
+ * Deinitialize library, destroys "lib" instance.
  */
+void library_deinit();
+
 /**
- * @defgroup utils utils
- * 
- * Generic helper classes.
- * 
- * @ingroup libstrongswan
+ * Library instance, set after between library_init() and library_deinit() calls.
  */
+extern library_t *lib;
 
-
-#endif /* LIBRARY_H_ */
+#endif /* LIBRARY_H_ @}*/