Extracted in-memory IP address pool from stroke plugin to libhydra.
[strongswan.git] / src / libcharon / plugins / stroke / stroke_attribute.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
16 /**
17 * @defgroup stroke_attribute stroke_attribute
18 * @{ @ingroup stroke
19 */
20
21 #ifndef STROKE_ATTRIBUTE_H_
22 #define STROKE_ATTRIBUTE_H_
23
24 #include <stroke_msg.h>
25 #include <attributes/attribute_provider.h>
26
27 typedef struct stroke_attribute_t stroke_attribute_t;
28
29 /**
30 * Stroke IKEv2 cfg attribute provider
31 */
32 struct stroke_attribute_t {
33
34 /**
35 * Implements attribute provider interface
36 */
37 attribute_provider_t provider;
38
39 /**
40 * Add a virtual IP address pool.
41 *
42 * @param msg stroke message
43 */
44 void (*add_pool)(stroke_attribute_t *this, stroke_msg_t *msg);
45
46 /**
47 * Remove a virtual IP address pool.
48 *
49 * @param msg stroke message
50 */
51 void (*del_pool)(stroke_attribute_t *this, stroke_msg_t *msg);
52
53 /**
54 * Create an enumerator over installed pools.
55 *
56 * Enumerator enumerates over
57 * char *pool, u_int size, u_int offline, u_int online.
58 *
59 * @return enumerator
60 */
61 enumerator_t* (*create_pool_enumerator)(stroke_attribute_t *this);
62
63 /**
64 * Create an enumerator over the leases of a pool.
65 *
66 * Enumerator enumerates over
67 * identification_t *id, host_t *address, bool online
68 *
69 * @param pool name of the pool to enumerate
70 * @return enumerator, NULL if pool not found
71 */
72 enumerator_t* (*create_lease_enumerator)(stroke_attribute_t *this,
73 char *pool);
74
75 /**
76 * Destroy a stroke_attribute instance.
77 */
78 void (*destroy)(stroke_attribute_t *this);
79 };
80
81 /**
82 * Create a stroke_attribute instance.
83 */
84 stroke_attribute_t *stroke_attribute_create();
85
86 #endif /** STROKE_ATTRIBUTE_H_ @}*/