/*
- * Copyright (C) 2013-2015 Andreas Steffen
+ * Copyright (C) 2013-2016 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
if (request_id == swid_state->get_request_id(swid_state))
{
swid_state->set_swid_inventory(swid_state, inventory);
- swid_state->set_count(swid_state, tag_id_count, 0);
+ swid_state->set_count(swid_state, tag_id_count, 0,
+ in_msg->get_src_id(in_msg));
}
else
{
if (request_id == swid_state->get_request_id(swid_state))
{
- swid_state->set_count(swid_state, 0, tag_count);
+ swid_state->set_count(swid_state, 0, tag_count,
+ in_msg->get_src_id(in_msg));
if (this->rest_api)
{
}
/* Create an empty out message - we might need it */
- out_msg = imv_msg_create(this->agent, state, id, imv_id, TNC_IMCID_ANY,
+ out_msg = imv_msg_create(this->agent, state, id, imv_id,
+ swid_state->get_imc_id(swid_state),
msg_types[0]);
if (!imcv_db)
/*
- * Copyright (C) 2013-2014 Andreas Steffen
+ * Copyright (C) 2013-2016 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
*/
uint32_t missing;
+ /**
+ * SWID IMC ID
+ */
+ TNC_UInt32 imc_id;
+
/**
* Top level JSON object
*/
}
METHOD(imv_swid_state_t, set_count, void,
- private_imv_swid_state_t *this, int tag_id_count, int tag_count)
+ private_imv_swid_state_t *this, int tag_id_count, int tag_count,
+ TNC_UInt32 imc_id)
{
this->tag_id_count += tag_id_count;
this->tag_count += tag_count;
+ this->imc_id = imc_id;
}
METHOD(imv_swid_state_t, get_count, void,
}
}
+METHOD(imv_swid_state_t, get_imc_id, TNC_UInt32,
+ private_imv_swid_state_t *this)
+{
+ return this->imc_id;
+}
+
/**
* Described in header.
*/
.get_missing = _get_missing,
.set_count = _set_count,
.get_count = _get_count,
+ .get_imc_id = _get_imc_id,
},
.state = TNC_CONNECTION_STATE_CREATE,
.rec = TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
.eval = TNC_IMV_EVALUATION_RESULT_DONT_KNOW,
.connection_id = connection_id,
.contracts = seg_contract_manager_create(),
+ .imc_id = TNC_IMCID_ANY,
.jobj = json_object_new_object(),
.jarray = json_object_new_array(),
);
/*
- * Copyright (C) 2013-2014 Andreas Steffen
+ * Copyright (C) 2013-2016 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
*/
uint32_t (*get_request_id)(imv_swid_state_t *this);
- /**
- * Set or extend the SWID Tag ID inventory in the state
- *
- * @param inventory SWID Tags ID inventory to be added
- */
- void (*set_swid_inventory)(imv_swid_state_t *this, swid_inventory_t *inventory);
+ /**
+ * Set or extend the SWID Tag ID inventory in the state
+ *
+ * @param inventory SWID Tags ID inventory to be added
+ */
+ void (*set_swid_inventory)(imv_swid_state_t *this, swid_inventory_t *inventory);
- /**
- * Get the encoding of the complete SWID Tag ID inventory
- *
- * @return SWID Tags ID inventory as a JSON array
- */
- json_object* (*get_swid_inventory)(imv_swid_state_t *this);
+ /**
+ * Get the encoding of the complete SWID Tag ID inventory
+ *
+ * @return SWID Tags ID inventory as a JSON array
+ */
+ json_object* (*get_swid_inventory)(imv_swid_state_t *this);
/**
* Set the number of still missing SWID Tags or Tag IDs
*
* @param tag_id_count Number of received SWID Tag IDs
* @param tag_count Number of received SWID Tags
+ * @param imc_id SWID IMC ID
*/
- void (*set_count)(imv_swid_state_t *this, int tag_id_count, int tag_count);
+ void (*set_count)(imv_swid_state_t *this, int tag_id_count, int tag_count,
+ TNC_UInt32 imc_id);
/**
* Set [or with multiple attributes increment] SWID Tag [ID] counters
* @param tag_count Number of received SWID Tags
*/
void (*get_count)(imv_swid_state_t *this, int *tag_id_count, int *tag_count);
+
+ /**
+ * Get SWID IMC ID
+ *
+ * @return SWID IMC ID
+ */
+ TNC_UInt32 (*get_imc_id)(imv_swid_state_t *this);
};
/**