fixed compiler warnings on 64bit
[strongswan.git] / src / charon / config / attributes / attribute_manager.h
1 /*
2 * Copyright (C) 2008-2009 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_manager attribute_manager
20 * @{ @ingroup attributes
21 */
22
23 #ifndef ATTRIBUTE_MANAGER_H_
24 #define ATTRIBUTE_MANAGER_H_
25
26 #include <config/attributes/attribute_provider.h>
27
28 typedef struct attribute_manager_t attribute_manager_t;
29
30 /**
31 * Provide configuration attributes to include in CFG Payloads.
32 */
33 struct attribute_manager_t {
34
35 /**
36 * Acquire a virtual IP address to assign to a peer.
37 *
38 * @param pool pool name to acquire address from
39 * @param id peer identity to get address forua
40 * @param requested IP in configuration request
41 * @return allocated address, NULL to serve none
42 */
43 host_t* (*acquire_address)(attribute_manager_t *this,
44 char *pool, identification_t *id,
45 host_t *requested);
46
47 /**
48 * Release a previously acquired address.
49 *
50 * @param pool pool name from which the address was acquired
51 * @param address address to release
52 * @param id peer identity to get address for
53 */
54 void (*release_address)(attribute_manager_t *this,
55 char *pool, host_t *address, identification_t *id);
56
57 /**
58 * Register an attribute provider to the manager.
59 *
60 * @param provider attribute provider to register
61 */
62 void (*add_provider)(attribute_manager_t *this,
63 attribute_provider_t *provider);
64 /**
65 * Unregister an attribute provider from the manager.
66 *
67 * @param provider attribute provider to unregister
68 */
69 void (*remove_provider)(attribute_manager_t *this,
70 attribute_provider_t *provider);
71 /**
72 * Destroy a attribute_manager instance.
73 */
74 void (*destroy)(attribute_manager_t *this);
75 };
76
77 /**
78 * Create a attribute_manager instance.
79 */
80 attribute_manager_t *attribute_manager_create();
81
82 #endif /** ATTRIBUTE_MANAGER_H_ @}*/