charon-nm: Set local address to %any so IPv6 may be used as outer address
[strongswan.git] / src / libtls / tls_application.h
1 /*
2 * Copyright (C) 2010 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 tls_handshake tls_handshake
18 * @{ @ingroup libtls
19 */
20
21 #ifndef TLS_APPLICATION_H_
22 #define TLS_APPLICATION_H_
23
24 typedef struct tls_application_t tls_application_t;
25
26 #include <bio/bio_reader.h>
27 #include <bio/bio_writer.h>
28
29 /**
30 * TLS application data interface.
31 */
32 struct tls_application_t {
33
34 /**
35 * Process received TLS application data.
36 *
37 * @param reader TLS data buffer
38 * @return
39 * - SUCCESS if application completed
40 * - FAILED if application data processing failed
41 * - NEED_MORE if another invocation of process/build needed
42 */
43 status_t (*process)(tls_application_t *this, bio_reader_t *reader);
44
45 /**
46 * Build TLS application data to send out.
47 *
48 * @param writer TLS data buffer to write to
49 * @return
50 * - SUCCESS if application completed
51 * - FAILED if application data build failed
52 * - NEED_MORE if more data ready for delivery
53 * - INVALID_STATE if more input to process() required
54 */
55 status_t (*build)(tls_application_t *this, bio_writer_t *writer);
56
57 /**
58 * Destroy a tls_application_t.
59 */
60 void (*destroy)(tls_application_t *this);
61 };
62
63 #endif /** TLS_APPLICATION_H_ @}*/