aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/tnc
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2011-05-06 15:13:05 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2011-05-06 15:13:05 +0200
commit50a43c79a64948d503c9ac0cc6c08bb1aa1dd61d (patch)
treea4c6b2def1f4f8d1fdf40508578b48f7cd9654ba /src/libcharon/tnc
parent51f259a82d7934dd0029a934616264009c986e5c (diff)
downloadstrongswan-50a43c79a64948d503c9ac0cc6c08bb1aa1dd61d.tar.bz2
strongswan-50a43c79a64948d503c9ac0cc6c08bb1aa1dd61d.tar.xz
refactored tnccs->remove_connection()
Diffstat (limited to 'src/libcharon/tnc')
-rw-r--r--src/libcharon/tnc/tnccs/tnccs_manager.c19
-rw-r--r--src/libcharon/tnc/tnccs/tnccs_manager.h4
2 files changed, 21 insertions, 2 deletions
diff --git a/src/libcharon/tnc/tnccs/tnccs_manager.c b/src/libcharon/tnc/tnccs/tnccs_manager.c
index abe4c65e5..244485513 100644
--- a/src/libcharon/tnc/tnccs/tnccs_manager.c
+++ b/src/libcharon/tnc/tnccs/tnccs_manager.c
@@ -215,11 +215,28 @@ METHOD(tnccs_manager_t, create_connection, TNC_ConnectionID,
}
METHOD(tnccs_manager_t, remove_connection, void,
- private_tnccs_manager_t *this, TNC_ConnectionID id)
+ private_tnccs_manager_t *this, TNC_ConnectionID id, bool is_server)
{
enumerator_t *enumerator;
tnccs_connection_entry_t *entry;
+ if (is_server)
+ {
+ if (charon->imvs)
+ {
+ charon->imvs->notify_connection_change(charon->imvs, id,
+ TNC_CONNECTION_STATE_DELETE);
+ }
+ }
+ else
+ {
+ if (charon->imcs)
+ {
+ charon->imcs->notify_connection_change(charon->imcs, id,
+ TNC_CONNECTION_STATE_DELETE);
+ }
+ }
+
this->connection_lock->write_lock(this->connection_lock);
enumerator = this->connections->create_enumerator(this->connections);
while (enumerator->enumerate(enumerator, &entry))
diff --git a/src/libcharon/tnc/tnccs/tnccs_manager.h b/src/libcharon/tnc/tnccs/tnccs_manager.h
index c02eac03c..34f60029d 100644
--- a/src/libcharon/tnc/tnccs/tnccs_manager.h
+++ b/src/libcharon/tnc/tnccs/tnccs_manager.h
@@ -82,8 +82,10 @@ struct tnccs_manager_t {
* Remove a TNCCS connection using its connection ID.
*
* @param id ID of the connection to be removed
+ * @param is_server TNC Server if TRUE, TNC Client if FALSE
*/
- void (*remove_connection)(tnccs_manager_t *this, TNC_ConnectionID id);
+ void (*remove_connection)(tnccs_manager_t *this, TNC_ConnectionID id,
+ bool is_server);
/**
* Request a handshake retry