updated Doxyfile
[strongswan.git] / src / charon / config / attributes / attribute_provider.h
1 /*
2 * Copyright (C) 2008 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 attribute_provider attribute_provider
20 * @{ @ingroup attributes
21 */
22
23 #ifndef ATTRIBUTE_PROVIDER_H_
24 #define ATTRIBUTE_PROVIDER_H_
25
26 #include <library.h>
27 #include <utils/host.h>
28 #include <credentials/auth_info.h>
29
30 typedef struct attribute_provider_t attribute_provider_t;
31
32 /**
33 * Interface to provide attributes to peers through attribute manager.
34 */
35 struct attribute_provider_t {
36
37 /**
38 * Acquire a virtual IP address to assign to a peer.
39 *
40 * @param pool name of the pool to acquire address from
41 * @param id peer ID
42 * @param auth authorization infos
43 * @param requested IP in configuration request
44 * @return allocated address, NULL to serve none
45 */
46 host_t* (*acquire_address)(attribute_provider_t *this,
47 char *pool, identification_t *id,
48 auth_info_t *auth, host_t *requested);
49 /**
50 * Release a previously acquired address.
51 *
52 * @param pool name of the pool this address was acquired from
53 * @param address address to release
54 * @param id peer ID
55 * @return TRUE if the address has been released by the provider
56 */
57 bool (*release_address)(attribute_provider_t *this,
58 char *pool, host_t *address, identification_t *id);
59 };
60
61 #endif /** ATTRIBUTE_PROVIDER_H_ @}*/