updated Doxyfile
[strongswan.git] / src / manager / storage.h
1 /*
2 * Copyright (C) 2007 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * $Id$
16 */
17
18 /**
19 * @defgroup storage storage
20 * @{ @ingroup manager
21 */
22
23 #ifndef STORAGE_H_
24 #define STORAGE_H_
25
26 #include <utils/enumerator.h>
27
28
29 typedef struct storage_t storage_t;
30
31 /**
32 * Persistent database storage.
33 */
34 struct storage_t {
35
36 /**
37 * Try to log in using specified credentials.
38 *
39 * @param username username
40 * @param password plaintext password
41 * @return user ID if login good, 0 otherwise
42 */
43 int (*login)(storage_t *this, char *username, char *password);
44
45 /**
46 * Create an iterator over the gateways.
47 *
48 * enumerate() arguments: int id, char *name, int port, char *address
49 * If port is 0, address is a Unix socket address.
50 *
51 * @param user user Id
52 * @return enumerator
53 */
54 enumerator_t* (*create_gateway_enumerator)(storage_t *this, int user);
55
56 /**
57 * Destroy a storage instance.
58 */
59 void (*destroy)(storage_t *this);
60 };
61
62 /**
63 * Create a storage instance.
64 *
65 * @param uri database connection URI
66 */
67 storage_t *storage_create(char *uri);
68
69 #endif /** STORAGE_H_ @}*/