2 * Copyright (C) 2007 Martin Willi
3 * Hochschule fuer Technik Rapperswil
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>.
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
17 * @defgroup storage storage
24 #include <utils/enumerator.h>
27 typedef struct storage_t storage_t
;
30 * Persistent database storage.
35 * Try to log in using specified credentials.
37 * @param username username
38 * @param password plaintext password
39 * @return user ID if login good, 0 otherwise
41 int (*login
)(storage_t
*this, char *username
, char *password
);
44 * Create an iterator over the gateways.
46 * enumerate() arguments: int id, char *name, int port, char *address
47 * If port is 0, address is a Unix socket address.
52 enumerator_t
* (*create_gateway_enumerator
)(storage_t
*this, int user
);
55 * Destroy a storage instance.
57 void (*destroy
)(storage_t
*this);
61 * Create a storage instance.
63 * @param uri database connection URI
65 storage_t
*storage_create(char *uri
);
67 #endif /** STORAGE_H_ @}*/