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