ifmap plugin subscribes to assing_vip bus signal
[strongswan.git] / src / libcharon / plugins / tnc_ifmap / tnc_ifmap_soap.h
1 /*
2 * Copyright (C) 2011-2013 Andreas Steffen
3 * HSR 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 tnc_ifmap_soap tnc_ifmap_soap
18 * @{ @ingroup tnc_ifmap
19 */
20
21 #ifndef TNC_IFMAP_SOAP_H_
22 #define TNC_IFMAP_SOAP_H_
23
24 #include <library.h>
25 #include <networking/host.h>
26 #include <sa/ike_sa.h>
27
28 typedef struct tnc_ifmap_soap_t tnc_ifmap_soap_t;
29
30 /**
31 * Implements the TNC IF-MAP 2.0 SOAP Binding
32 */
33 struct tnc_ifmap_soap_t {
34
35 /**
36 * Creates a new IF-MAP session
37 *
38 * @return TRUE if command was successful
39 */
40 bool (*newSession)(tnc_ifmap_soap_t *this);
41
42 /**
43 * Check if the IF-MAP session is still active
44 *
45 * @return TRUE if command was successful
46 */
47 bool (*renewSession)(tnc_ifmap_soap_t *this);
48
49 /**
50 * Purges all metadata published by this publisher
51 *
52 * @return TRUE if command was successful
53 */
54 bool (*purgePublisher)(tnc_ifmap_soap_t *this);
55
56 /**
57 * Publish metadata about established/deleted IKE_SAs
58 *
59 * @param ike_sa IKE_SA for which metadata is published
60 * @param up TRUE if IKE_SEA is up, FALSE if down
61 * @return TRUE if command was successful
62 */
63 bool (*publish_ike_sa)(tnc_ifmap_soap_t *this, ike_sa_t *ike_sa, bool up);
64
65 /**
66 * Publish PEP device-ip metadata
67 *
68 * @param host IP address of local endpoint
69 * @return TRUE if command was successful
70 */
71 bool (*publish_device_ip)(tnc_ifmap_soap_t *this, host_t *host);
72
73 /**
74 * Publish Virtual IP access-request-ip metadata
75 *
76 * @param ike_sa IKE_SA for which metadata is published
77 * @param vip Virtual IP address of peer
78 * @param assign TRUE if assigned, FALSE if removed
79 * @return TRUE if command was successful
80 */
81 bool (*publish_virtual_ip)(tnc_ifmap_soap_t *this, ike_sa_t *ike_sa,
82 host_t *vip, bool assign);
83
84 /**
85 * Publish enforcement-report metadata
86 *
87 * @param host Host to be enforced
88 * @param action Enforcement action ("block" or "quarantine")
89 * @param reason Enforcement reason
90 * @return TRUE if command was successful
91 */
92 bool (*publish_enforcement_report)(tnc_ifmap_soap_t *this, host_t *host,
93 char *action, char *reason);
94
95 /**
96 * Ends an IF-MAP session
97 *
98 * @return TRUE if command was successful
99 */
100 bool (*endSession)(tnc_ifmap_soap_t *this);
101
102 /**
103 * Get ID of IF-MAP session
104 *
105 * @return IF-MAP session ID
106 */
107 char* (*get_session_id)(tnc_ifmap_soap_t *this);
108
109 /**
110 * Check for an orphaned IF-MAP session
111 *
112 * @return TRUE if IF-MAP session is orphaned
113 */
114 bool (*orphaned)(tnc_ifmap_soap_t *this);
115
116 /**
117 * Get a reference to an IF-MAP session
118 *
119 * @return referenced IF-MAP session
120 */
121 tnc_ifmap_soap_t* (*get_ref)(tnc_ifmap_soap_t *this);
122
123 /**
124 * Destroy a tnc_ifmap_soap_t.
125 */
126 void (*destroy)(tnc_ifmap_soap_t *this);
127 };
128
129 /**
130 * Create a tnc_ifmap_soap instance.
131 */
132 tnc_ifmap_soap_t *tnc_ifmap_soap_create();
133
134 #endif /** TNC_IFMAP_SOAP_H_ @}*/