Implemented get|set_action_flag() methods

This commit is contained in:
Andreas Steffen
2013-06-21 23:25:24 +02:00
parent a45a2c9291
commit 01afff71cb
3 changed files with 20 additions and 37 deletions
@@ -193,10 +193,8 @@ static TNC_Result receive_msg(private_imv_scanner_agent_t *this,
u_int16_t port;
bool blocked, compliant = TRUE;
state->set_action_flags(state, IMV_SCANNER_ATTR_PORT_FILTER);
scanner_state = (imv_scanner_state_t*)state;
scanner_state->set_received(scanner_state,
IMV_SCANNER_ATTR_PORT_FILTER);
attr_port_filter = (ietf_attr_port_filter_t*)attr;
enumerator = attr_port_filter->create_port_enumerator(attr_port_filter);
@@ -60,6 +60,11 @@ struct private_imv_scanner_state_t {
*/
u_int32_t max_msg_len;
/**
* Flags set for completed actions
*/
u_int32_t action_flags;
/**
* Access Requestor ID Type
*/
@@ -90,11 +95,6 @@ struct private_imv_scanner_state_t {
*/
imv_scanner_handshake_state_t handshake_state;
/**
* Flags set for received attributes
*/
u_int received_flags;
/**
* List with ports that should be closed
*/
@@ -192,6 +192,18 @@ METHOD(imv_state_t, get_max_msg_len, u_int32_t,
return this->max_msg_len;
}
METHOD(imv_state_t, set_action_flags, void,
private_imv_scanner_state_t *this, u_int32_t flags)
{
this->action_flags |= flags;
}
METHOD(imv_state_t, get_action_flags, u_int32_t,
private_imv_scanner_state_t *this)
{
return this->action_flags;
}
METHOD(imv_state_t, set_ar_id, void,
private_imv_scanner_state_t *this, u_int32_t id_type, chunk_t id_value)
{
@@ -322,19 +334,6 @@ METHOD(imv_scanner_state_t, get_handshake_state, imv_scanner_handshake_state_t,
return this->handshake_state;
}
METHOD(imv_scanner_state_t, set_received, void,
private_imv_scanner_state_t *this, u_int flags)
{
this->received_flags |= flags;
}
METHOD(imv_scanner_state_t, get_received, u_int,
private_imv_scanner_state_t *this)
{
return this->received_flags;
}
METHOD(imv_scanner_state_t, add_violating_port, void,
private_imv_scanner_state_t *this, char *port)
{
@@ -357,6 +356,8 @@ imv_state_t *imv_scanner_state_create(TNC_ConnectionID connection_id)
.set_flags = _set_flags,
.set_max_msg_len = _set_max_msg_len,
.get_max_msg_len = _get_max_msg_len,
.set_action_flags = _set_action_flags,
.get_action_flags = _get_action_flags,
.set_ar_id = _set_ar_id,
.get_ar_id = _get_ar_id,
.set_session = _set_session,
@@ -371,8 +372,6 @@ imv_state_t *imv_scanner_state_create(TNC_ConnectionID connection_id)
},
.set_handshake_state = _set_handshake_state,
.get_handshake_state = _get_handshake_state,
.set_received = _set_received,
.get_received = _get_received,
.add_violating_port = _add_violating_port,
},
.state = TNC_CONNECTION_STATE_CREATE,
@@ -64,20 +64,6 @@ struct imv_scanner_state_t {
*/
imv_scanner_handshake_state_t (*get_handshake_state)(imv_scanner_state_t *this);
/**
* Set flags for received attributes
*
* @param flags Flags to be set
*/
void (*set_received)(imv_scanner_state_t *this, u_int flags);
/**
* Get flags set for received attributes
*
* @return Flags set for received attributes
*/
u_int (*get_received)(imv_scanner_state_t *this);
/**
* add a violating TCP or UDP port
*/