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 manager manager
19 * @defgroup controller controller
22 * @defgroup manager_i manager
34 #include <utils/iterator.h>
36 typedef struct manager_t manager_t
;
39 * The manager, manages multiple gateways.
44 * implements context_t interface
49 * Create an iterator over all configured gateways.
51 * enumerate() arguments: int id, char *name, int port, char *address
52 * If port is 0, address is a Unix socket address.
56 enumerator_t
* (*create_gateway_enumerator
)(manager_t
*this);
61 * If id is 0, the previously selected gateway is returned. If none has
62 * been selected yet, NULL is returned.
64 * @param id id of the gateway (from enumerate), or 0
65 * @return selected gateway, or NULL
67 gateway_t
* (*select_gateway
)(manager_t
*this, int id
);
72 * @param username username
73 * @param password cleartext password
74 * @return TRUE if login successful
76 bool (*login
)(manager_t
*this, char *username
, char *password
);
79 * Check if user logged in.
81 * @return TRUE if logged in
83 bool (*logged_in
)(manager_t
*this);
88 void (*logout
)(manager_t
*this);
92 * Create a manager instance.
94 manager_t
*manager_create(storage_t
*storage
);
96 #endif /** MANAGER_H_ @}*/