refactored tnccs->remove_connection()

This commit is contained in:
Andreas Steffen
2011-05-06 15:13:05 +02:00
parent 51f259a82d
commit 50a43c79a6
4 changed files with 25 additions and 24 deletions
+18 -1
View File
@@ -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))
+3 -1
View File
@@ -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