2 * Copyright (C) 2010 Andreas Steffen
3 * Copyright (C) 2010 HSR Hochschule fuer Technik Rapperswil
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>.
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
16 #include "tnc_if_tnccs.h"
20 typedef struct private_tnc_if_tnccs_t private_tnc_if_tnccs_t
;
23 * Private data of a tnc_if_tnccs_t object.
25 struct private_tnc_if_tnccs_t
{
28 * Public tls_t interface.
33 * Role this TNC IF-TNCCS stack acts as.
38 * TLS stack purpose, as given to constructor
40 tls_purpose_t purpose
;
43 METHOD(tls_t
, process
, status_t
,
44 private_tnc_if_tnccs_t
*this, void *buf
, size_t buflen
)
50 METHOD(tls_t
, build
, status_t
,
51 private_tnc_if_tnccs_t
*this, void *buf
, size_t *buflen
, size_t *msglen
)
53 char output
[] = "Hello World";
54 size_t len
= strlen(output
);
59 memcpy(buf
, output
, len
);
64 METHOD(tls_t
, is_server
, bool,
65 private_tnc_if_tnccs_t
*this)
67 return this->is_server
;
70 METHOD(tls_t
, get_purpose
, tls_purpose_t
,
71 private_tnc_if_tnccs_t
*this)
76 METHOD(tls_t
, is_complete
, bool,
77 private_tnc_if_tnccs_t
*this)
83 METHOD(tls_t
, get_eap_msk
, chunk_t
,
84 private_tnc_if_tnccs_t
*this)
89 METHOD(tls_t
, destroy
, void,
90 private_tnc_if_tnccs_t
*this)
98 tls_t
*tnc_if_tnccs_create(bool is_server
, tls_purpose_t purpose
)
100 private_tnc_if_tnccs_t
*this;
104 case TLS_PURPOSE_EAP_TNC
:
114 .is_server
= _is_server
,
115 .get_purpose
= _get_purpose
,
116 .is_complete
= _is_complete
,
117 .get_eap_msk
= _get_eap_msk
,
120 .is_server
= is_server
,
124 return &this->public;