implemented server side support for EAP-TTLS
[strongswan.git] / src / libcharon / plugins / eap_ttls / eap_ttls_avp.h
1 /*
2 * Copyright (C) 2010 Andreas Steffen
3 * Copyright (C) 2010 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 eap_ttls_avp eap_ttls_avp
18 * @{ @ingroup eap_ttls
19 */
20
21 #ifndef EAP_TTLS_AVP_H_
22 #define EAP_TTLS_AVP_H_
23
24 typedef struct eap_ttls_avp_t eap_ttls_avp_t;
25
26 #include <library.h>
27
28 #include <tls_reader.h>
29 #include <tls_writer.h>
30
31 /**
32 * EAP-TTLS Attribute-Value Pair (AVP) handler.
33 */
34 struct eap_ttls_avp_t {
35
36 /**
37 * Process received EAP-TTLS EAP Message AVP.
38 *
39 * @param reader TLS data buffer
40 * @param data received EAP Message
41 * @return
42 * - SUCCESS if AVP processing succeeded
43 * - FAILED if AVP processing failed
44 * - NEED_MORE if another invocation of process/build needed
45 */
46 status_t (*process)(eap_ttls_avp_t *this, tls_reader_t *reader,
47 chunk_t *data);
48
49 /**
50 * Build EAP-TTLS EAP Message AVP to send out.
51 *
52 * @param writer TLS data buffer to write to
53 * @param data EAP Message to send
54 */
55 void (*build)(eap_ttls_avp_t *this, tls_writer_t *writer, chunk_t data);
56
57 /**
58 * Destroy a eap_ttls_application_t.
59 */
60 void (*destroy)(eap_ttls_avp_t *this);
61 };
62
63 /**
64 * Create an eap_ttls_avp instance.
65 */
66 eap_ttls_avp_t *eap_ttls_avp_create(void);
67
68 #endif /** EAP_TTLS_AVP_H_ @}*/