implemented http basic authentication
[strongswan.git] / src / libcharon / plugins / tnc_ifmap2 / tnc_ifmap2_soap_msg.h
1 /*
2 * Copyright (C) 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_ifmap2_soap_msg tnc_ifmap2_soap_msg
18 * @{ @ingroup tnc_ifmap2
19 */
20
21 #ifndef TNC_IFMAP2_SOAP_MSG_H_
22 #define TNC_IFMAP2_SOAP_MSG_H_
23
24 #include <library.h>
25 #include <tls_socket.h>
26
27 #include <libxml/parser.h>
28
29 typedef struct tnc_ifmap2_soap_msg_t tnc_ifmap2_soap_msg_t;
30
31 /**
32 * Interface for sending and receiving SOAP-XML messages
33 */
34 struct tnc_ifmap2_soap_msg_t {
35
36 /**
37 * Post an IF-MAP request in a SOAP-XML message and return a result
38 *
39 * @param request XML-encoded IF-MAP request
40 * @param result_name name of the IF-MAP result
41 * @param result XML-encoded IF-MAP result
42 */
43 bool (*post)(tnc_ifmap2_soap_msg_t *this, xmlNodePtr request,
44 char *result_name, xmlNodePtr* result);
45
46 /**
47 * Destroy a tnc_ifmap2_soap_msg_t object.
48 */
49 void (*destroy)(tnc_ifmap2_soap_msg_t *this);
50 };
51
52 /**
53 * Create a tnc_ifmap2_soap_msg instance.
54 *
55 * @param uri HTTPS URI with https:// prefix removed
56 * @param user_pass Optional username:password for HTTP Basic Authentication
57 * @param tls TLS socket protecting the SOAP message
58 */
59 tnc_ifmap2_soap_msg_t *tnc_ifmap2_soap_msg_create(char *uri, chunk_t user_pass,
60 tls_socket_t *tls);
61
62 #endif /** TNC_IFMAP2_SOAP_MSG_H_ @}*/