stroke: Allow specifying the ipsec.secrets location in strongswan.conf
[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 #include <attributes/mem_pool.h>
27
28 typedef struct stroke_attribute_t stroke_attribute_t;
29
30 /**
31 * Stroke IKEv2 cfg attribute provider
32 */
33 struct stroke_attribute_t {
34
35 /**
36 * Implements attribute provider interface
37 */
38 attribute_provider_t provider;
39
40 /**
41 * Add a memory pool to this virtual IP backend.
42 *
43 * The pool gets owned by the provider, or destroyed if such a pool
44 * is already registered.
45 *
46 * @param pool virtual IP pool to add
47 */
48 void (*add_pool)(stroke_attribute_t *this, mem_pool_t *pool);
49
50 /**
51 * Add connection specific DNS servers.
52 *
53 * @param msg stroke add message
54 */
55 void (*add_dns)(stroke_attribute_t *this, stroke_msg_t *msg);
56
57 /**
58 * Remove connection specific DNS servers.
59 *
60 * @param msg stroke del message
61 */
62 void (*del_dns)(stroke_attribute_t *this, stroke_msg_t *msg);
63
64 /**
65 * Create an enumerator over installed pools.
66 *
67 * Enumerator enumerates over
68 * char *pool, u_int size, u_int offline, u_int online.
69 *
70 * @return enumerator
71 */
72 enumerator_t* (*create_pool_enumerator)(stroke_attribute_t *this);
73
74 /**
75 * Create an enumerator over the leases of a pool.
76 *
77 * Enumerator enumerates over
78 * identification_t *id, host_t *address, bool online
79 *
80 * @param pool name of the pool to enumerate
81 * @return enumerator, NULL if pool not found
82 */
83 enumerator_t* (*create_lease_enumerator)(stroke_attribute_t *this,
84 char *pool);
85
86 /**
87 * Destroy a stroke_attribute instance.
88 */
89 void (*destroy)(stroke_attribute_t *this);
90 };
91
92 /**
93 * Create a stroke_attribute instance.
94 */
95 stroke_attribute_t *stroke_attribute_create();
96
97 #endif /** STROKE_ATTRIBUTE_H_ @}*/