moved ar_id from imv_agent to imv_state

This commit is contained in:
Andreas Steffen
2013-03-11 08:54:02 +01:00
parent 2b1e2434e4
commit a498c7a9c3
8 changed files with 112 additions and 31 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Andreas Steffen
* Copyright (C) 2012-2013 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -390,7 +390,7 @@ static TNC_Result receive_message(imv_state_t *state, imv_msg_t *in_msg)
device_id = os_state->get_device_id(os_state);
if (os_db && device_id)
{
os_db->set_device_info(os_db, device_id, imv_os->get_ar_id(imv_os),
os_db->set_device_info(os_db, device_id, state->get_ar_id(state),
os_state->get_info(os_state, NULL, NULL, NULL),
count, count_update, count_blacklist, os_settings);
}
+22 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Andreas Steffen
* Copyright (C) 2012-2013 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -61,6 +61,11 @@ struct private_imv_os_state_t {
*/
u_int32_t max_msg_len;
/**
* Access Requestor ID
*/
identification_t *ar_id;
/**
* IMV action recommendation
*/
@@ -319,6 +324,19 @@ METHOD(imv_state_t, get_max_msg_len, u_int32_t,
return this->max_msg_len;
}
METHOD(imv_state_t, set_ar_id, void,
private_imv_os_state_t *this, identification_t *ar_id)
{
/* no cloning, caller must not destroy object */
this->ar_id = ar_id;
}
METHOD(imv_state_t, get_ar_id, identification_t*,
private_imv_os_state_t *this)
{
return this->ar_id;
}
METHOD(imv_state_t, change_state, void,
private_imv_os_state_t *this, TNC_ConnectionState new_state)
{
@@ -435,6 +453,7 @@ METHOD(imv_state_t, get_remediation_instructions, bool,
METHOD(imv_state_t, destroy, void,
private_imv_os_state_t *this)
{
DESTROY_IF(this->ar_id);
DESTROY_IF(this->reason_string);
DESTROY_IF(this->remediation_string);
this->update_packages->destroy_function(this->update_packages, free);
@@ -603,6 +622,8 @@ imv_state_t *imv_os_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_ar_id = _set_ar_id,
.get_ar_id = _get_ar_id,
.change_state = _change_state,
.get_recommendation = _get_recommendation,
.set_recommendation = _set_recommendation,
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2012 Andreas Steffen
* Copyright (C) 2011-2013 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -58,6 +58,11 @@ struct private_imv_scanner_state_t {
*/
u_int32_t max_msg_len;
/**
* Access Requestor ID
*/
identification_t *ar_id;
/**
* IMV action recommendation
*/
@@ -165,6 +170,19 @@ METHOD(imv_state_t, get_max_msg_len, u_int32_t,
return this->max_msg_len;
}
METHOD(imv_state_t, set_ar_id, void,
private_imv_scanner_state_t *this, identification_t *ar_id)
{
/* no cloning, caller must not destroy object */
this->ar_id = ar_id;
}
METHOD(imv_state_t, get_ar_id, identification_t*,
private_imv_scanner_state_t *this)
{
return this->ar_id;
}
METHOD(imv_state_t, change_state, void,
private_imv_scanner_state_t *this, TNC_ConnectionState new_state)
{
@@ -238,6 +256,7 @@ METHOD(imv_state_t, get_remediation_instructions, bool,
METHOD(imv_state_t, destroy, void,
private_imv_scanner_state_t *this)
{
DESTROY_IF(this->ar_id);
DESTROY_IF(this->reason_string);
DESTROY_IF(this->remediation_string);
this->violating_ports->destroy_function(this->violating_ports, free);
@@ -266,6 +285,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_ar_id = _set_ar_id,
.get_ar_id = _get_ar_id,
.change_state = _change_state,
.get_recommendation = _get_recommendation,
.set_recommendation = _set_recommendation,
+22 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2012 Andreas Steffen
* Copyright (C) 2011-2013 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -58,6 +58,11 @@ struct private_imv_test_state_t {
*/
u_int32_t max_msg_len;
/**
* Access Requestor ID
*/
identification_t *ar_id;
/**
* IMV action recommendation
*/
@@ -143,6 +148,19 @@ METHOD(imv_state_t, get_max_msg_len, u_int32_t,
return this->max_msg_len;
}
METHOD(imv_state_t, set_ar_id, void,
private_imv_test_state_t *this, identification_t *ar_id)
{
/* no cloning, caller must not destroy object */
this->ar_id = ar_id;
}
METHOD(imv_state_t, get_ar_id, identification_t*,
private_imv_test_state_t *this)
{
return this->ar_id;
}
METHOD(imv_state_t, change_state, void,
private_imv_test_state_t *this, TNC_ConnectionState new_state)
{
@@ -191,6 +209,7 @@ METHOD(imv_state_t, get_remediation_instructions, bool,
METHOD(imv_state_t, destroy, void,
private_imv_test_state_t *this)
{
DESTROY_IF(this->ar_id);
DESTROY_IF(this->reason_string);
this->imcs->destroy_function(this->imcs, free);
free(this);
@@ -277,6 +296,8 @@ imv_state_t *imv_test_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_ar_id = _set_ar_id,
.get_ar_id = _get_ar_id,
.change_state = _change_state,
.get_recommendation = _get_recommendation,
.set_recommendation = _set_recommendation,