stroke: Allow specifying the ipsec.secrets location in strongswan.conf
[strongswan.git] / src / libcharon / plugins / stroke / stroke_config.h
1 /*
2 * Copyright (C) 2012 Tobias Brunner
3 * Copyright (C) 2008 Martin Willi
4 * Hochschule fuer Technik Rapperswil
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 /**
18 * @defgroup stroke_config stroke_config
19 * @{ @ingroup stroke
20 */
21
22 #ifndef STROKE_CONFIG_H_
23 #define STROKE_CONFIG_H_
24
25 #include <config/backend.h>
26 #include <stroke_msg.h>
27 #include "stroke_ca.h"
28 #include "stroke_cred.h"
29 #include "stroke_attribute.h"
30
31 typedef struct stroke_config_t stroke_config_t;
32
33 /**
34 * Stroke in-memory configuration backend
35 */
36 struct stroke_config_t {
37
38 /**
39 * Implements the backend_t interface
40 */
41 backend_t backend;
42
43 /**
44 * Add a configuration to the backend.
45 *
46 * @param msg received stroke message containing config
47 */
48 void (*add)(stroke_config_t *this, stroke_msg_t *msg);
49
50 /**
51 * Remove a configuration from the backend.
52 *
53 * @param msg received stroke message containing config name
54 */
55 void (*del)(stroke_config_t *this, stroke_msg_t *msg);
56
57 /**
58 * Set the username and password for a connection in this backend.
59 *
60 * @param msg received stroke message
61 * @param prompt I/O channel to prompt for the password
62 */
63 void (*set_user_credentials)(stroke_config_t *this, stroke_msg_t *msg,
64 FILE *prompt);
65
66 /**
67 * Destroy a stroke_config instance.
68 */
69 void (*destroy)(stroke_config_t *this);
70 };
71
72 /**
73 * Create a stroke_config instance.
74 */
75 stroke_config_t *stroke_config_create(stroke_ca_t *ca, stroke_cred_t *cred,
76 stroke_attribute_t *attributes);
77
78 #endif /** STROKE_CONFIG_H_ @}*/