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
+2 -11
View File
@@ -454,17 +454,8 @@ METHOD(tls_t, get_eap_msk, chunk_t,
METHOD(tls_t, destroy, void,
private_tnccs_11_t *this)
{
if (this->is_server)
{
charon->imvs->notify_connection_change(charon->imvs,
this->connection_id, TNC_CONNECTION_STATE_DELETE);
}
else
{
charon->imcs->notify_connection_change(charon->imcs,
this->connection_id, TNC_CONNECTION_STATE_DELETE);
}
charon->tnccs->remove_connection(charon->tnccs, this->connection_id);
charon->tnccs->remove_connection(charon->tnccs, this->connection_id
this->is_server);
this->mutex->destroy(this->mutex);
DESTROY_IF(this->batch);
free(this);
+2 -11
View File
@@ -625,17 +625,8 @@ METHOD(tls_t, get_eap_msk, chunk_t,
METHOD(tls_t, destroy, void,
private_tnccs_20_t *this)
{
if (this->is_server)
{
charon->imvs->notify_connection_change(charon->imvs,
this->connection_id, TNC_CONNECTION_STATE_DELETE);
}
else
{
charon->imcs->notify_connection_change(charon->imcs,
this->connection_id, TNC_CONNECTION_STATE_DELETE);
}
charon->tnccs->remove_connection(charon->tnccs, this->connection_id);
charon->tnccs->remove_connection(charon->tnccs, this->connection_id,
this->is_server);
this->state_machine->destroy(this->state_machine);
this->mutex->destroy(this->mutex);
DESTROY_IF(this->batch);
+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