Moved data structures to new collections subfolder

This commit is contained in:
Tobias Brunner
2012-10-24 16:00:49 +02:00
parent fdee6b5f5a
commit 12642a6831
229 changed files with 338 additions and 332 deletions
@@ -37,7 +37,7 @@
#include <pen/pen.h>
#include <debug.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
/* IMC definitions */
@@ -85,7 +85,7 @@ TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id,
}
libpts_init();
if (min_version > TNC_IFIMC_VERSION_1 || max_version < TNC_IFIMC_VERSION_1)
{
DBG1(DBG_IMC, "no common IF-IMC version");
@@ -19,7 +19,7 @@
#include <tncif_names.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <debug.h>
typedef struct private_imc_attestation_state_t private_imc_attestation_state_t;
@@ -237,7 +237,7 @@ imc_state_t *imc_attestation_state_create(TNC_ConnectionID connection_id)
.components = linked_list_create(),
.list = linked_list_create(),
);
return &this->public.interface;
}
@@ -38,7 +38,7 @@
#include <pen/pen.h>
#include <debug.h>
#include <credentials/credential_manager.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
/* IMV definitions */
@@ -104,7 +104,7 @@ TNC_Result TNC_IMV_Initialize(TNC_IMVID imv_id,
}
libpts_init();
if (min_version > TNC_IFIMV_VERSION_1 || max_version < TNC_IFIMV_VERSION_1)
{
DBG1(DBG_IMV, "no common IF-IMV version");
@@ -25,7 +25,7 @@
#include "imv_attestation_state.h"
#include <library.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <credentials/credential_manager.h>
#include <crypto/hashers/hasher.h>
@@ -18,7 +18,7 @@
#include <libpts.h>
#include <utils/lexparser.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <debug.h>
typedef struct private_imv_attestation_state_t private_imv_attestation_state_t;
@@ -44,7 +44,7 @@ struct private_imv_attestation_state_t {
* TNCCS connection state
*/
TNC_ConnectionState state;
/**
* Does the TNCCS connection support long message types?
*/
@@ -139,7 +139,7 @@ struct entry_t {
};
/**
* Table of multi-lingual reason string entries
* Table of multi-lingual reason string entries
*/
static entry_t reasons[] = {
{ "en", "IMV Attestation: Incorrect/pending file measurement/component"
@@ -302,7 +302,7 @@ METHOD(imv_attestation_state_t, check_off_file_meas_request, bool,
enumerator_t *enumerator;
file_meas_request_t *request;
bool found = FALSE;
enumerator = this->file_meas_requests->create_enumerator(this->file_meas_requests);
while (enumerator->enumerate(enumerator, &request))
{
@@ -15,7 +15,7 @@
#include "pts/components/pts_component_manager.h"
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <debug.h>
typedef struct private_pts_component_manager_t private_pts_component_manager_t;
@@ -56,7 +56,7 @@ struct vendor_entry_t {
/**
* List of vendor-specific registered Functional Components
*/
*/
linked_list_t *components;
};
@@ -103,7 +103,7 @@ struct private_pts_component_manager_t {
};
METHOD(pts_component_manager_t, add_vendor, void,
private_pts_component_manager_t *this, pen_t vendor_id,
private_pts_component_manager_t *this, pen_t vendor_id,
enum_name_t *comp_func_names, int qualifier_type_size,
char *qualifier_flag_names, enum_name_t *qualifier_type_names)
{
@@ -285,7 +285,7 @@ METHOD(pts_component_manager_t, create, pts_component_t*,
METHOD(pts_component_manager_t, destroy, void,
private_pts_component_manager_t *this)
{
this->list->destroy_function(this->list, (void *)vendor_entry_destroy);
this->list->destroy_function(this->list, (void *)vendor_entry_destroy);
free(this);
}
+1 -1
View File
@@ -35,7 +35,7 @@ typedef struct pts_t pts_t;
#include "components/pts_comp_func_name.h"
#include <library.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
/**
* UTF-8 encoding of the character used to delimiter the filename
+3 -3
View File
@@ -15,7 +15,7 @@
#include "pts_file_meas.h"
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <sys/stat.h>
@@ -179,7 +179,7 @@ METHOD(pts_file_meas_t, verify, bool,
}
}
enumerator->destroy(enumerator);
if (!found)
{
DBG1(DBG_PTS, " no measurement found for '%s'", filename);
@@ -200,7 +200,7 @@ METHOD(pts_file_meas_t, verify, bool,
break;
}
}
return success;
return success;
}
METHOD(pts_file_meas_t, destroy, void,
+1 -1
View File
@@ -15,7 +15,7 @@
#include "pts_file_meta.h"
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <debug.h>
typedef struct private_pts_file_meta_t private_pts_file_meta_t;
+8 -8
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <debug.h>
typedef struct private_tcg_pts_attr_file_meas_t private_tcg_pts_attr_file_meas_t;
@@ -26,7 +26,7 @@ typedef struct private_tcg_pts_attr_file_meas_t private_tcg_pts_attr_file_meas_t
/**
* File Measurement
* see section 3.19.2 of PTS Protocol: Binding to TNC IF-M Specification
*
*
* 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -72,12 +72,12 @@ struct private_tcg_pts_attr_file_meas_t {
* Attribute value
*/
chunk_t value;
/**
* Noskip flag
*/
bool noskip_flag;
/**
* PTS File Measurements
*/
@@ -123,7 +123,7 @@ METHOD(pa_tnc_attr_t, build, void,
char *filename;
chunk_t measurement;
bool first = TRUE;
if (this->value.ptr)
{
return;
@@ -169,7 +169,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
chunk_t measurement, filename;
char buf[BUF_LEN];
status_t status = FAILED;
if (this->value.len < PTS_FILE_MEAS_SIZE)
{
DBG1(DBG_TNC, "insufficient data for PTS file measurement header");
@@ -181,9 +181,9 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader->read_uint64(reader, &number_of_files);
reader->read_uint16(reader, &request_id);
reader->read_uint16(reader, &meas_len);
this->measurements = pts_file_meas_create(request_id);
while (number_of_files--)
{
if (!reader->read_data(reader, meas_len, &measurement))
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <debug.h>
typedef struct private_tcg_pts_attr_req_func_comp_evid_t private_tcg_pts_attr_req_func_comp_evid_t;
@@ -47,7 +47,7 @@ typedef struct private_tcg_pts_attr_req_func_comp_evid_t private_tcg_pts_attr_re
*/
/**
* Component Functional Name Structure
* Component Functional Name Structure
* (see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification)
*
* 1 2 3
@@ -58,7 +58,7 @@ typedef struct private_tcg_pts_attr_req_func_comp_evid_t private_tcg_pts_attr_re
* | Component Functional Name |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
#define PTS_REQ_FUNC_COMP_EVID_SIZE 12
#define PTS_REQ_FUNC_COMP_FAMILY_MASK 0xC0
@@ -81,7 +81,7 @@ struct private_tcg_pts_attr_req_func_comp_evid_t {
* Attribute value
*/
chunk_t value;
/**
* Noskip flag
*/
@@ -249,7 +249,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
entry->flags = flags;
entry->depth = depth;
entry->name = pts_comp_func_name_create(vendor_id, name, qualifier);
this->list->insert_last(this->list, entry);
}
status = SUCCESS;
+9 -9
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <utils/linked_list.h>
#include <collections/linked_list.h>
#include <debug.h>
typedef struct private_tcg_pts_attr_file_meta_t private_tcg_pts_attr_file_meta_t;
@@ -26,7 +26,7 @@ typedef struct private_tcg_pts_attr_file_meta_t private_tcg_pts_attr_file_meta_t
/**
* Unix-Style File Metadata
* see section 3.17.3 of PTS Protocol: Binding to TNC IF-M Specification
*
*
* 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -88,12 +88,12 @@ struct private_tcg_pts_attr_file_meta_t {
* Attribute value
*/
chunk_t value;
/**
* Noskip flag
*/
bool noskip_flag;
/**
* PTS File Metadata
*/
@@ -136,7 +136,7 @@ METHOD(pa_tnc_attr_t, build, void,
enumerator_t *enumerator;
pts_file_metadata_t *entry;
u_int64_t number_of_files;
if (this->value.ptr)
{
return;
@@ -163,7 +163,7 @@ METHOD(pa_tnc_attr_t, build, void,
strlen(entry->filename)));
}
enumerator->destroy(enumerator);
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
}
@@ -179,7 +179,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
u_int64_t owner, group;
chunk_t filename;
status_t status = FAILED;
if (this->value.len < PTS_FILE_META_SIZE)
{
DBG1(DBG_TNC, "insufficient data for PTS Unix-Style file metadata header");
@@ -190,7 +190,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader->read_uint64(reader, &number_of_files);
this->metadata = pts_file_meta_create();
while (number_of_files--)
{
if (!reader->read_uint16(reader, &len))
@@ -243,7 +243,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
DBG1(DBG_TNC, "insufficient data for filename");
goto end;
}
entry = malloc_thing(pts_file_metadata_t);
entry->type = type;
entry->filesize = filesize;