Moving charon to libcharon.
[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.
41 *
42 * @param msg stroke message
43 * @param end end of stroke message that contains virtual IP.
44 */
45 void (*add_pool)(stroke_attribute_t *this, stroke_msg_t *msg);
46
47 /**
48 * Remove a virtual IP address.
49 *
50 * @param msg stroke message
51 */
52 void (*del_pool)(stroke_attribute_t *this, stroke_msg_t *msg);
53
54 /**
55 * Create an enumerator over installed pools.
56 *
57 * Enumerator enumerates over
58 * char *pool, u_int size, u_int offline, u_int online.
59 *
60 * @return enumerator
61 */
62 enumerator_t* (*create_pool_enumerator)(stroke_attribute_t *this);
63
64 /**
65 * Create an enumerator over the leases of a pool.
66 *
67 * Enumerator enumerates over
68 * identification_t *id, host_t *address, bool online
69 *
70 * @param pool name of the pool to enumerate
71 * @return enumerator, NULL if pool not found
72 */
73 enumerator_t* (*create_lease_enumerator)(stroke_attribute_t *this,
74 char *pool);
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_ @}*/