summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/tnc_ifmap/tnc_ifmap_soap_msg.h
blob: 4f809ba1adfa495ba57d4dbbf93b3f64e7f0c350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * Copyright (C) 2013 Andreas Steffen
 * HSR Hochschule fuer Technik Rapperswil
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

/**
 * @defgroup tnc_ifmap_soap_msg tnc_ifmap_soap_msg
 * @{ @ingroup tnc_ifmap 
 */

#ifndef TNC_IFMAP_SOAP_MSG_H_
#define TNC_IFMAP_SOAP_MSG_H_

#include <library.h>
#include <tls_socket.h>

#include <libxml/parser.h>

typedef struct tnc_ifmap_soap_msg_t tnc_ifmap_soap_msg_t;

/**
 * Interface for sending and receiving SOAP-XML messages
 */
struct tnc_ifmap_soap_msg_t {

	/**
	 * Post an IF-MAP request in a SOAP-XML message and return a result
	 *
	 * @param request		XML-encoded IF-MAP request
	 * @param result_name	name of the IF-MAP result
	 * @param result		XML-encoded IF-MAP result
	 */
	bool (*post)(tnc_ifmap_soap_msg_t *this, xmlNodePtr request,
				 char *result_name, xmlNodePtr* result);

	/**
	 * Destroy a tnc_ifmap_soap_msg_t object.
	 */
	void (*destroy)(tnc_ifmap_soap_msg_t *this);
};

/**
 * Create a tnc_ifmap_soap_msg instance.
 *
 * @param uri			HTTPS URI with https:// prefix removed
 * @param user_pass		Optional username:password for HTTP Basic Authentication
 * @param tls			TLS socket protecting the SOAP message
 */
tnc_ifmap_soap_msg_t *tnc_ifmap_soap_msg_create(char *uri, chunk_t user_pass,
												tls_socket_t *tls);

#endif /** TNC_IFMAP_SOAP_MSG_H_ @}*/