refactored tnccs->remove_connection()
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user