aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/tnccs_20
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2013-01-17 23:32:34 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-02-11 15:30:44 +0100
commitebb87f08f7cb3b5402cea1d7ad7e3ef559bd3451 (patch)
tree0013fdd9de19f5605558af10797287a9478ea6f9 /src/libcharon/plugins/tnccs_20
parent98063d8187d6894f4698d689e7c5a3affbcd1622 (diff)
downloadstrongswan-ebb87f08f7cb3b5402cea1d7ad7e3ef559bd3451.tar.bz2
strongswan-ebb87f08f7cb3b5402cea1d7ad7e3ef559bd3451.tar.xz
Make IKE/EAP IDs available to TNC server/client
Diffstat (limited to 'src/libcharon/plugins/tnccs_20')
-rw-r--r--src/libcharon/plugins/tnccs_20/tnccs_20.c19
-rw-r--r--src/libcharon/plugins/tnccs_20/tnccs_20.h11
2 files changed, 24 insertions, 6 deletions
diff --git a/src/libcharon/plugins/tnccs_20/tnccs_20.c b/src/libcharon/plugins/tnccs_20/tnccs_20.c
index 6239b152d..1e06c1a47 100644
--- a/src/libcharon/plugins/tnccs_20/tnccs_20.c
+++ b/src/libcharon/plugins/tnccs_20/tnccs_20.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 Sansar Choinyanbuu
- * Copyright (C) 2010-2012 Andreas Steffen
+ * Copyright (C) 2010-2013 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -58,6 +58,16 @@ struct private_tnccs_20_t {
bool is_server;
/**
+ * Server identity
+ */
+ identification_t *server;
+
+ /**
+ * Client identity
+ */
+ identification_t *peer;
+
+ /**
* PB-TNC State Machine
*/
pb_tnc_state_machine_t *state_machine;
@@ -792,6 +802,8 @@ METHOD(tls_t, destroy, void,
{
tnc->tnccs->remove_connection(tnc->tnccs, this->connection_id,
this->is_server);
+ this->server->destroy(this->server);
+ this->peer->destroy(this->peer);
this->state_machine->destroy(this->state_machine);
this->mutex->destroy(this->mutex);
this->messages->destroy_offset(this->messages,
@@ -802,7 +814,8 @@ METHOD(tls_t, destroy, void,
/**
* See header
*/
-tls_t *tnccs_20_create(bool is_server)
+tls_t *tnccs_20_create(bool is_server, identification_t *server,
+ identification_t *peer)
{
private_tnccs_20_t *this;
@@ -817,6 +830,8 @@ tls_t *tnccs_20_create(bool is_server)
.destroy = _destroy,
},
.is_server = is_server,
+ .server = server->clone(server),
+ .peer = peer->clone(peer),
.state_machine = pb_tnc_state_machine_create(is_server),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
.messages = linked_list_create(),
diff --git a/src/libcharon/plugins/tnccs_20/tnccs_20.h b/src/libcharon/plugins/tnccs_20/tnccs_20.h
index 400d1dc12..d42ebf218 100644
--- a/src/libcharon/plugins/tnccs_20/tnccs_20.h
+++ b/src/libcharon/plugins/tnccs_20/tnccs_20.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Andreas Steffen
+ * Copyright (C) 2010-2013 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -28,9 +28,12 @@
/**
* Create an instance of the TNC IF-TNCCS 2.0 protocol handler.
*
- * @param is_server TRUE to act as TNC Server, FALSE for TNC Client
- * @return TNC_IF_TNCCS 2.0 protocol stack
+ * @param is_server TRUE to act as TNC Server, FALSE for TNC Client
+ * @param server Server identity
+ * @param peer Client identity
+ * @return TNC_IF_TNCCS 2.0 protocol stack
*/
-tls_t *tnccs_20_create(bool is_server);
+tls_t *tnccs_20_create(bool is_server, identification_t *server,
+ identification_t *peer);
#endif /** TNCCS_20_H_ @}*/