created hull for TNCCS 2.0 plugin
[strongswan.git] / src / libcharon / plugins / tnccs_20 / tnccs_20.c
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 #include "tnccs_20.h"
17
18 #include <debug.h>
19
20 static chunk_t tncc_output;
21
22 typedef struct private_tnccs_20_t private_tnccs_20_t;
23
24 /**
25 * Private data of a tnccs_20_t object.
26 */
27 struct private_tnccs_20_t {
28
29 /**
30 * Public tls_t interface.
31 */
32 tls_t public;
33
34 /**
35 * TNCC if TRUE, TNCS if FALSE
36 */
37 bool is_server;
38 };
39
40 METHOD(tls_t, process, status_t,
41 private_tnccs_20_t *this, void *buf, size_t buflen)
42 {
43 return NEED_MORE;
44 }
45
46 METHOD(tls_t, build, status_t,
47 private_tnccs_20_t *this, void *buf, size_t *buflen, size_t *msglen)
48 {
49 return ALREADY_DONE;
50 }
51
52 METHOD(tls_t, is_server, bool,
53 private_tnccs_20_t *this)
54 {
55 return this->is_server;
56 }
57
58 METHOD(tls_t, get_purpose, tls_purpose_t,
59 private_tnccs_20_t *this)
60 {
61 return TLS_PURPOSE_EAP_TNC;
62 }
63
64 METHOD(tls_t, is_complete, bool,
65 private_tnccs_20_t *this)
66 {
67 return FALSE;
68 }
69
70 METHOD(tls_t, get_eap_msk, chunk_t,
71 private_tnccs_20_t *this)
72 {
73 return chunk_empty;
74 }
75
76 METHOD(tls_t, destroy, void,
77 private_tnccs_20_t *this)
78 {
79 free(this);
80 }
81
82 /**
83 * See header
84 */
85 tls_t *tnccs_20_create(bool is_server)
86 {
87 private_tnccs_20_t *this;
88
89 INIT(this,
90 .public = {
91 .process = _process,
92 .build = _build,
93 .is_server = _is_server,
94 .get_purpose = _get_purpose,
95 .is_complete = _is_complete,
96 .get_eap_msk = _get_eap_msk,
97 .destroy = _destroy,
98 },
99 .is_server = is_server,
100 );
101
102 return &this->public;
103 }