refactored tnccs->remove_connection()
This commit is contained in:
@@ -454,17 +454,8 @@ METHOD(tls_t, get_eap_msk, chunk_t,
|
|||||||
METHOD(tls_t, destroy, void,
|
METHOD(tls_t, destroy, void,
|
||||||
private_tnccs_11_t *this)
|
private_tnccs_11_t *this)
|
||||||
{
|
{
|
||||||
if (this->is_server)
|
charon->tnccs->remove_connection(charon->tnccs, this->connection_id
|
||||||
{
|
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);
|
|
||||||
this->mutex->destroy(this->mutex);
|
this->mutex->destroy(this->mutex);
|
||||||
DESTROY_IF(this->batch);
|
DESTROY_IF(this->batch);
|
||||||
free(this);
|
free(this);
|
||||||
|
|||||||
@@ -625,17 +625,8 @@ METHOD(tls_t, get_eap_msk, chunk_t,
|
|||||||
METHOD(tls_t, destroy, void,
|
METHOD(tls_t, destroy, void,
|
||||||
private_tnccs_20_t *this)
|
private_tnccs_20_t *this)
|
||||||
{
|
{
|
||||||
if (this->is_server)
|
charon->tnccs->remove_connection(charon->tnccs, this->connection_id,
|
||||||
{
|
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);
|
|
||||||
this->state_machine->destroy(this->state_machine);
|
this->state_machine->destroy(this->state_machine);
|
||||||
this->mutex->destroy(this->mutex);
|
this->mutex->destroy(this->mutex);
|
||||||
DESTROY_IF(this->batch);
|
DESTROY_IF(this->batch);
|
||||||
|
|||||||
@@ -215,11 +215,28 @@ METHOD(tnccs_manager_t, create_connection, TNC_ConnectionID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
METHOD(tnccs_manager_t, remove_connection, void,
|
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;
|
enumerator_t *enumerator;
|
||||||
tnccs_connection_entry_t *entry;
|
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);
|
this->connection_lock->write_lock(this->connection_lock);
|
||||||
enumerator = this->connections->create_enumerator(this->connections);
|
enumerator = this->connections->create_enumerator(this->connections);
|
||||||
while (enumerator->enumerate(enumerator, &entry))
|
while (enumerator->enumerate(enumerator, &entry))
|
||||||
|
|||||||
@@ -82,8 +82,10 @@ struct tnccs_manager_t {
|
|||||||
* Remove a TNCCS connection using its connection ID.
|
* Remove a TNCCS connection using its connection ID.
|
||||||
*
|
*
|
||||||
* @param id ID of the connection to be removed
|
* @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
|
* Request a handshake retry
|
||||||
|
|||||||
Reference in New Issue
Block a user