updated Doxyfile
[strongswan.git] / src / manager / gateway.h
1 /*
2 * Copyright (C) 2007 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 gateway gateway
20 * @{ @ingroup manager
21 */
22
23 #ifndef GATEWAY_H_
24 #define GATEWAY_H_
25
26 #include <utils/host.h>
27 #include <utils/enumerator.h>
28
29 typedef struct gateway_t gateway_t;
30
31 /**
32 * A connection to a gateway.
33 */
34 struct gateway_t {
35
36 /**
37 * Send an XML request to the gateway.
38 *
39 * @param xml xml request string
40 * @return allocated xml response string
41 */
42 char* (*request)(gateway_t *this, char *xml);
43
44 /**
45 * Query the list of IKE_SAs and all its children.
46 *
47 * @return enumerator over ikesa XML elements
48 */
49 enumerator_t* (*query_ikesalist)(gateway_t *this);
50
51 /**
52 * Query the list of peer configs and its subconfigs.
53 *
54 * @return enumerator over peerconfig XML elements
55 */
56 enumerator_t* (*query_configlist)(gateway_t *this);
57
58 /**
59 * Terminate an IKE or a CHILD SA.
60 *
61 * @param ike TRUE for IKE-, FALSE for a CHILD-SA
62 * @param id ID of the SA to terminate
63 * @return enumerator over control response XML children
64 */
65 enumerator_t* (*terminate)(gateway_t *this, bool ike, u_int32_t id);
66
67 /**
68 * Initiate an IKE or a CHILD SA.
69 *
70 * @param ike TRUE for IKE-, FALSE for CHILD-SA
71 * @param name name of the peer/child config
72 * @return enumerator over control response XML children
73 */
74 enumerator_t* (*initiate)(gateway_t *this, bool ike, char *name);
75
76 /**
77 * Destroy a gateway instance.
78 */
79 void (*destroy)(gateway_t *this);
80 };
81
82 /**
83 * Create a gateway instance using a TCP connection.
84 *
85 * @param name name of the gateway
86 * @param host gateway connection endpoint
87 * @return gateway connection
88 */
89 gateway_t *gateway_create_tcp(char *name, host_t *host);
90
91 /**
92 * Create a gateway instance using a UNIX socket.
93 *
94 * @param name name of the gateway
95 * @return gateway connection
96 */
97 gateway_t *gateway_create_unix(char *name);
98
99 #endif /** GATEWAY_H_ @}*/