summaryrefslogtreecommitdiff
path: root/src/libpts/tcg
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2014-07-11 07:23:31 +0200
committerYves-Alexis Perez <corsac@debian.org>2014-07-11 07:23:31 +0200
commit81c63b0eed39432878f78727f60a1e7499645199 (patch)
tree82387d8fecd1c20788fd8bd784a9b0bde091fb6b /src/libpts/tcg
parentc5ebfc7b9c16551fe825dc1d79c3f7e2f096f6c9 (diff)
downloadvyos-strongswan-81c63b0eed39432878f78727f60a1e7499645199.tar.gz
vyos-strongswan-81c63b0eed39432878f78727f60a1e7499645199.zip
Imported Upstream version 5.2.0
Diffstat (limited to 'src/libpts/tcg')
-rw-r--r--src/libpts/tcg/swid/tcg_swid_attr_req.c7
-rw-r--r--src/libpts/tcg/swid/tcg_swid_attr_req.h4
-rw-r--r--src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.c66
-rw-r--r--src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.h25
-rw-r--r--src/libpts/tcg/swid/tcg_swid_attr_tag_inv.c60
-rw-r--r--src/libpts/tcg/swid/tcg_swid_attr_tag_inv.h24
6 files changed, 106 insertions, 80 deletions
diff --git a/src/libpts/tcg/swid/tcg_swid_attr_req.c b/src/libpts/tcg/swid/tcg_swid_attr_req.c
index b8e7962c1..c403d06f9 100644
--- a/src/libpts/tcg/swid/tcg_swid_attr_req.c
+++ b/src/libpts/tcg/swid/tcg_swid_attr_req.c
@@ -44,7 +44,6 @@ typedef struct private_tcg_swid_attr_req_t private_tcg_swid_attr_req_t;
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
-#define SWID_REQ_SIZE 12
#define SWID_REQ_RESERVED_MASK 0x03
/**
@@ -135,7 +134,7 @@ METHOD(pa_tnc_attr_t, build, void,
return;
}
- writer = bio_writer_create(SWID_REQ_SIZE);
+ writer = bio_writer_create(TCG_SWID_REQ_MIN_SIZE);
writer->write_uint8 (writer, this->flags);
writer->write_uint24(writer, this->targets->get_count(this->targets));
writer->write_uint32(writer, this->request_id);
@@ -163,7 +162,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
chunk_t tag_creator, unique_sw_id;
swid_tag_id_t *tag_id;
- if (this->value.len < SWID_REQ_SIZE)
+ if (this->value.len < TCG_SWID_REQ_MIN_SIZE)
{
DBG1(DBG_TNC, "insufficient data for SWID Request");
*offset = 0;
@@ -181,7 +180,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
*offset = 4;
return FAILED;
}
- *offset = SWID_REQ_SIZE;
+ *offset = TCG_SWID_REQ_MIN_SIZE;
this->flags &= SWID_REQ_RESERVED_MASK;
diff --git a/src/libpts/tcg/swid/tcg_swid_attr_req.h b/src/libpts/tcg/swid/tcg_swid_attr_req.h
index 851b68d3b..59b597d84 100644
--- a/src/libpts/tcg/swid/tcg_swid_attr_req.h
+++ b/src/libpts/tcg/swid/tcg_swid_attr_req.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Andreas Steffen
+ * Copyright (C) 2013-2014 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -21,6 +21,8 @@
#ifndef TCG_SWID_ATTR_REQ_H_
#define TCG_SWID_ATTR_REQ_H_
+#define TCG_SWID_REQ_MIN_SIZE 12
+
typedef struct tcg_swid_attr_req_t tcg_swid_attr_req_t;
typedef enum tcg_swid_attr_req_flag_t tcg_swid_attr_req_flag_t;
diff --git a/src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.c b/src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.c
index 429919edd..33aa16d53 100644
--- a/src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.c
+++ b/src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Andreas Steffen
+ * Copyright (C) 2013-2014 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -42,12 +42,11 @@ typedef struct private_tcg_swid_attr_tag_id_inv_t private_tcg_swid_attr_tag_id_i
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Unique Software ID Length |Unique Software ID (var length)|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Unique Sequence ID Length |Unique Sequence ID (var length)|
+ * | Tag File Path Length | Tag File Path (var. length) |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
-#define SWID_TAG_ID_INV_SIZE 16
-#define SWID_TAG_ID_INV_RESERVED 0x00
+#define TCG_SWID_TAG_ID_INV_RESERVED 0x00
/**
* Private data of an tcg_swid_attr_tag_id_inv_t object.
@@ -77,17 +76,17 @@ struct private_tcg_swid_attr_tag_id_inv_t {
/**
* Request ID
*/
- u_int32_t request_id;
+ uint32_t request_id;
/**
* Event ID Epoch
*/
- u_int32_t eid_epoch;
+ uint32_t eid_epoch;
/**
* Last Event ID
*/
- u_int32_t last_eid;
+ uint32_t last_eid;
/**
* SWID Tag ID Inventory
@@ -129,7 +128,7 @@ METHOD(pa_tnc_attr_t, build, void,
{
bio_writer_t *writer;
swid_tag_id_t *tag_id;
- chunk_t tag_creator, unique_sw_id, unique_seq_id;
+ chunk_t tag_creator, unique_sw_id, tag_file_path;
enumerator_t *enumerator;
if (this->value.ptr)
@@ -137,8 +136,8 @@ METHOD(pa_tnc_attr_t, build, void,
return;
}
- writer = bio_writer_create(SWID_TAG_ID_INV_SIZE);
- writer->write_uint8 (writer, SWID_TAG_ID_INV_RESERVED);
+ writer = bio_writer_create(TCG_SWID_TAG_ID_INV_MIN_SIZE);
+ writer->write_uint8 (writer, TCG_SWID_TAG_ID_INV_RESERVED);
writer->write_uint24(writer, this->inventory->get_count(this->inventory));
writer->write_uint32(writer, this->request_id);
writer->write_uint32(writer, this->eid_epoch);
@@ -148,10 +147,10 @@ METHOD(pa_tnc_attr_t, build, void,
while (enumerator->enumerate(enumerator, &tag_id))
{
tag_creator = tag_id->get_tag_creator(tag_id);
- unique_sw_id = tag_id->get_unique_sw_id(tag_id, &unique_seq_id);
+ unique_sw_id = tag_id->get_unique_sw_id(tag_id, &tag_file_path);
writer->write_data16(writer, tag_creator);
writer->write_data16(writer, unique_sw_id);
- writer->write_data16(writer, unique_seq_id);
+ writer->write_data16(writer, tag_file_path);
}
enumerator->destroy(enumerator);
@@ -160,15 +159,15 @@ METHOD(pa_tnc_attr_t, build, void,
}
METHOD(pa_tnc_attr_t, process, status_t,
- private_tcg_swid_attr_tag_id_inv_t *this, u_int32_t *offset)
+ private_tcg_swid_attr_tag_id_inv_t *this, uint32_t *offset)
{
bio_reader_t *reader;
- u_int32_t tag_id_count;
- u_int8_t reserved;
- chunk_t tag_creator, unique_sw_id, unique_seq_id;
+ uint32_t tag_id_count;
+ uint8_t reserved;
+ chunk_t tag_creator, unique_sw_id, tag_file_path;
swid_tag_id_t *tag_id;
- if (this->value.len < SWID_TAG_ID_INV_SIZE)
+ if (this->value.len < TCG_SWID_TAG_ID_INV_MIN_SIZE)
{
DBG1(DBG_TNC, "insufficient data for SWID Tag Identifier Inventory");
*offset = 0;
@@ -181,7 +180,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader->read_uint32(reader, &this->request_id);
reader->read_uint32(reader, &this->eid_epoch);
reader->read_uint32(reader, &this->last_eid);
- *offset = SWID_TAG_ID_INV_SIZE;
+ *offset = TCG_SWID_TAG_ID_INV_MIN_SIZE;
while (tag_id_count--)
{
@@ -199,14 +198,14 @@ METHOD(pa_tnc_attr_t, process, status_t,
}
*offset += 2 + unique_sw_id.len;
- if (!reader->read_data16(reader, &unique_seq_id))
+ if (!reader->read_data16(reader, &tag_file_path))
{
- DBG1(DBG_TNC, "insufficient data for Unique Sequence ID");
+ DBG1(DBG_TNC, "insufficient data for Tag File Path");
return FAILED;
}
- *offset += 2 + unique_seq_id.len;
+ *offset += 2 + tag_file_path.len;
- tag_id = swid_tag_id_create(tag_creator, unique_sw_id, unique_seq_id);
+ tag_id = swid_tag_id_create(tag_creator, unique_sw_id, tag_file_path);
this->inventory->add(this->inventory, tag_id);
}
reader->destroy(reader);
@@ -232,14 +231,20 @@ METHOD(pa_tnc_attr_t, destroy, void,
}
}
-METHOD(tcg_swid_attr_tag_id_inv_t, get_request_id, u_int32_t,
+METHOD(tcg_swid_attr_tag_id_inv_t, add, void,
+ private_tcg_swid_attr_tag_id_inv_t *this, swid_tag_id_t *tag_id)
+{
+ this->inventory->add(this->inventory, tag_id);
+}
+
+METHOD(tcg_swid_attr_tag_id_inv_t, get_request_id, uint32_t,
private_tcg_swid_attr_tag_id_inv_t *this)
{
return this->request_id;
}
-METHOD(tcg_swid_attr_tag_id_inv_t, get_last_eid, u_int32_t,
- private_tcg_swid_attr_tag_id_inv_t *this, u_int32_t *eid_epoch)
+METHOD(tcg_swid_attr_tag_id_inv_t, get_last_eid, uint32_t,
+ private_tcg_swid_attr_tag_id_inv_t *this, uint32_t *eid_epoch)
{
if (eid_epoch)
{
@@ -257,10 +262,9 @@ METHOD(tcg_swid_attr_tag_id_inv_t, get_inventory, swid_inventory_t*,
/**
* Described in header.
*/
-pa_tnc_attr_t *tcg_swid_attr_tag_id_inv_create(u_int32_t request_id,
- u_int32_t eid_epoch,
- u_int32_t eid,
- swid_inventory_t *inventory)
+pa_tnc_attr_t *tcg_swid_attr_tag_id_inv_create(uint32_t request_id,
+ uint32_t eid_epoch,
+ uint32_t eid)
{
private_tcg_swid_attr_tag_id_inv_t *this;
@@ -276,6 +280,7 @@ pa_tnc_attr_t *tcg_swid_attr_tag_id_inv_create(u_int32_t request_id,
.get_ref = _get_ref,
.destroy = _destroy,
},
+ .add = _add,
.get_request_id = _get_request_id,
.get_last_eid = _get_last_eid,
.get_inventory = _get_inventory,
@@ -284,7 +289,7 @@ pa_tnc_attr_t *tcg_swid_attr_tag_id_inv_create(u_int32_t request_id,
.request_id = request_id,
.eid_epoch = eid_epoch,
.last_eid = eid,
- .inventory = inventory,
+ .inventory = swid_inventory_create(FALSE),
.ref = 1,
);
@@ -311,6 +316,7 @@ pa_tnc_attr_t *tcg_swid_attr_tag_id_inv_create_from_data(chunk_t data)
.get_ref = _get_ref,
.destroy = _destroy,
},
+ .add = _add,
.get_request_id = _get_request_id,
.get_last_eid = _get_last_eid,
.get_inventory = _get_inventory,
diff --git a/src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.h b/src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.h
index 1a0cbe7d2..c4ade904e 100644
--- a/src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.h
+++ b/src/libpts/tcg/swid/tcg_swid_attr_tag_id_inv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Andreas Steffen
+ * Copyright (C) 2013-2014 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@ typedef struct tcg_swid_attr_tag_id_inv_t tcg_swid_attr_tag_id_inv_t;
#include <pa_tnc/pa_tnc_attr.h>
+#define TCG_SWID_TAG_ID_INV_MIN_SIZE 16
+
/**
* Class implementing the TCG SWID Tag Identifier Inventory attribute
*
@@ -41,11 +43,18 @@ struct tcg_swid_attr_tag_id_inv_t {
pa_tnc_attr_t pa_tnc_attribute;
/**
+ * Add a Tag ID to the attribute
+ *
+ * @param tag_id SWID Tag ID to be added
+ */
+ void (*add)(tcg_swid_attr_tag_id_inv_t *this, swid_tag_id_t *tag_id);
+
+ /**
* Get Request ID
*
* @return Request ID
*/
- u_int32_t (*get_request_id)(tcg_swid_attr_tag_id_inv_t *this);
+ uint32_t (*get_request_id)(tcg_swid_attr_tag_id_inv_t *this);
/**
* Get Last Event ID
@@ -53,8 +62,8 @@ struct tcg_swid_attr_tag_id_inv_t {
* @param eid_epoch Event ID Epoch
* @return Last Event ID
*/
- u_int32_t (*get_last_eid)(tcg_swid_attr_tag_id_inv_t *this,
- u_int32_t *eid_epoch);
+ uint32_t (*get_last_eid)(tcg_swid_attr_tag_id_inv_t *this,
+ uint32_t *eid_epoch);
/**
* Get Inventory of SWID tag IDs
@@ -71,12 +80,10 @@ struct tcg_swid_attr_tag_id_inv_t {
* @param request_id Copy of the Request ID
* @param eid_epoch Event ID Epoch
* @param eid Last Event ID
- * @param inventory SWID Tag Inventory
*/
-pa_tnc_attr_t* tcg_swid_attr_tag_id_inv_create(u_int32_t request_id,
- u_int32_t eid_epoch,
- u_int32_t eid,
- swid_inventory_t *inventory);
+pa_tnc_attr_t* tcg_swid_attr_tag_id_inv_create(uint32_t request_id,
+ uint32_t eid_epoch,
+ uint32_t eid);
/**
* Creates an tcg_swid_attr_tag_id_inv_t object from received data
diff --git a/src/libpts/tcg/swid/tcg_swid_attr_tag_inv.c b/src/libpts/tcg/swid/tcg_swid_attr_tag_inv.c
index 82b9ef958..fbb94c6c2 100644
--- a/src/libpts/tcg/swid/tcg_swid_attr_tag_inv.c
+++ b/src/libpts/tcg/swid/tcg_swid_attr_tag_inv.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Andreas Steffen
+ * Copyright (C) 2013-2014 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@ typedef struct private_tcg_swid_attr_tag_inv_t private_tcg_swid_attr_tag_inv_t;
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Last EID |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Unique Sequence ID Length |Unique Sequence ID (var length)|
+ * | Tag File Path Length | Tag File Path (var length) |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Tag Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -46,8 +46,7 @@ typedef struct private_tcg_swid_attr_tag_inv_t private_tcg_swid_attr_tag_inv_t;
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
-#define SWID_TAG_INV_SIZE 16
-#define SWID_TAG_INV_RESERVED 0x00
+#define TCG_SWID_TAG_INV_RESERVED 0x00
/**
* Private data of an tcg_swid_attr_tag_inv_t object.
@@ -77,17 +76,17 @@ struct private_tcg_swid_attr_tag_inv_t {
/**
* Request ID
*/
- u_int32_t request_id;
+ uint32_t request_id;
/**
* Event ID Epoch
*/
- u_int32_t eid_epoch;
+ uint32_t eid_epoch;
/**
* Last Event ID
*/
- u_int32_t last_eid;
+ uint32_t last_eid;
/**
* SWID Tag Inventory
@@ -136,8 +135,8 @@ METHOD(pa_tnc_attr_t, build, void,
return;
}
- writer = bio_writer_create(SWID_TAG_INV_SIZE);
- writer->write_uint8 (writer, SWID_TAG_INV_RESERVED);
+ writer = bio_writer_create(TCG_SWID_TAG_INV_MIN_SIZE);
+ writer->write_uint8 (writer, TCG_SWID_TAG_INV_RESERVED);
writer->write_uint24(writer, this->inventory->get_count(this->inventory));
writer->write_uint32(writer, this->request_id);
writer->write_uint32(writer, this->eid_epoch);
@@ -146,7 +145,7 @@ METHOD(pa_tnc_attr_t, build, void,
enumerator = this->inventory->create_enumerator(this->inventory);
while (enumerator->enumerate(enumerator, &tag))
{
- writer->write_data16(writer, tag->get_unique_seq_id(tag));
+ writer->write_data16(writer, tag->get_tag_file_path(tag));
writer->write_data32(writer, tag->get_encoding(tag));
}
enumerator->destroy(enumerator);
@@ -156,15 +155,15 @@ METHOD(pa_tnc_attr_t, build, void,
}
METHOD(pa_tnc_attr_t, process, status_t,
- private_tcg_swid_attr_tag_inv_t *this, u_int32_t *offset)
+ private_tcg_swid_attr_tag_inv_t *this, uint32_t *offset)
{
bio_reader_t *reader;
- u_int32_t tag_count;
- u_int8_t reserved;
- chunk_t tag_encoding, unique_seq_id;
+ uint32_t tag_count;
+ uint8_t reserved;
+ chunk_t tag_encoding, tag_file_path;
swid_tag_t *tag;
- if (this->value.len < SWID_TAG_INV_SIZE)
+ if (this->value.len < TCG_SWID_TAG_INV_MIN_SIZE)
{
DBG1(DBG_TNC, "insufficient data for SWID Tag Inventory");
*offset = 0;
@@ -177,16 +176,16 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader->read_uint32(reader, &this->request_id);
reader->read_uint32(reader, &this->eid_epoch);
reader->read_uint32(reader, &this->last_eid);
- *offset = SWID_TAG_INV_SIZE;
+ *offset = TCG_SWID_TAG_INV_MIN_SIZE;
while (tag_count--)
{
- if (!reader->read_data16(reader, &unique_seq_id))
+ if (!reader->read_data16(reader, &tag_file_path))
{
- DBG1(DBG_TNC, "insufficient data for Unique Sequence ID");
+ DBG1(DBG_TNC, "insufficient data for Tag File Path");
return FAILED;
}
- *offset += 2 + unique_seq_id.len;
+ *offset += 2 + tag_file_path.len;
if (!reader->read_data32(reader, &tag_encoding))
{
@@ -195,7 +194,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
}
*offset += 4 + tag_encoding.len;
- tag = swid_tag_create(tag_encoding, unique_seq_id);
+ tag = swid_tag_create(tag_encoding, tag_file_path);
this->inventory->add(this->inventory, tag);
}
reader->destroy(reader);
@@ -221,14 +220,20 @@ METHOD(pa_tnc_attr_t, destroy, void,
}
}
-METHOD(tcg_swid_attr_tag_inv_t, get_request_id, u_int32_t,
+METHOD(tcg_swid_attr_tag_inv_t, add, void,
+ private_tcg_swid_attr_tag_inv_t *this, swid_tag_t *tag)
+{
+ this->inventory->add(this->inventory, tag);
+}
+
+METHOD(tcg_swid_attr_tag_inv_t, get_request_id, uint32_t,
private_tcg_swid_attr_tag_inv_t *this)
{
return this->request_id;
}
-METHOD(tcg_swid_attr_tag_inv_t, get_last_eid, u_int32_t,
- private_tcg_swid_attr_tag_inv_t *this, u_int32_t *eid_epoch)
+METHOD(tcg_swid_attr_tag_inv_t, get_last_eid, uint32_t,
+ private_tcg_swid_attr_tag_inv_t *this, uint32_t *eid_epoch)
{
if (eid_epoch)
{
@@ -246,9 +251,8 @@ METHOD(tcg_swid_attr_tag_inv_t, get_inventory, swid_inventory_t*,
/**
* Described in header.
*/
-pa_tnc_attr_t *tcg_swid_attr_tag_inv_create(u_int32_t request_id,
- u_int32_t eid_epoch, u_int32_t eid,
- swid_inventory_t *inventory)
+pa_tnc_attr_t *tcg_swid_attr_tag_inv_create(uint32_t request_id,
+ uint32_t eid_epoch, uint32_t eid)
{
private_tcg_swid_attr_tag_inv_t *this;
@@ -264,6 +268,7 @@ pa_tnc_attr_t *tcg_swid_attr_tag_inv_create(u_int32_t request_id,
.get_ref = _get_ref,
.destroy = _destroy,
},
+ .add = _add,
.get_request_id = _get_request_id,
.get_last_eid = _get_last_eid,
.get_inventory = _get_inventory,
@@ -272,7 +277,7 @@ pa_tnc_attr_t *tcg_swid_attr_tag_inv_create(u_int32_t request_id,
.request_id = request_id,
.eid_epoch = eid_epoch,
.last_eid = eid,
- .inventory = inventory,
+ .inventory = swid_inventory_create(TRUE),
.ref = 1,
);
@@ -299,6 +304,7 @@ pa_tnc_attr_t *tcg_swid_attr_tag_inv_create_from_data(chunk_t data)
.get_ref = _get_ref,
.destroy = _destroy,
},
+ .add = _add,
.get_request_id = _get_request_id,
.get_last_eid = _get_last_eid,
.get_inventory = _get_inventory,
diff --git a/src/libpts/tcg/swid/tcg_swid_attr_tag_inv.h b/src/libpts/tcg/swid/tcg_swid_attr_tag_inv.h
index 433f55ee0..69966c7d6 100644
--- a/src/libpts/tcg/swid/tcg_swid_attr_tag_inv.h
+++ b/src/libpts/tcg/swid/tcg_swid_attr_tag_inv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Andreas Steffen
+ * Copyright (C) 2013-2014 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@ typedef struct tcg_swid_attr_tag_inv_t tcg_swid_attr_tag_inv_t;
#include <pa_tnc/pa_tnc_attr.h>
+#define TCG_SWID_TAG_INV_MIN_SIZE 16
+
/**
* Class implementing the TCG SWID Tag Inventory attribute
*
@@ -41,11 +43,17 @@ struct tcg_swid_attr_tag_inv_t {
pa_tnc_attr_t pa_tnc_attribute;
/**
+ * Add a Tag ID to the attribute
+ *
+ * @param tag SWID Tag to be added
+ */
+ void (*add)(tcg_swid_attr_tag_inv_t *this, swid_tag_t *tag);
+ /**
* Get Request ID
*
* @return Request ID
*/
- u_int32_t (*get_request_id)(tcg_swid_attr_tag_inv_t *this);
+ uint32_t (*get_request_id)(tcg_swid_attr_tag_inv_t *this);
/**
* Get Last Event ID
@@ -53,8 +61,8 @@ struct tcg_swid_attr_tag_inv_t {
* @param eid_epoch Event ID Epoch
* @return Last Event ID
*/
- u_int32_t (*get_last_eid)(tcg_swid_attr_tag_inv_t *this,
- u_int32_t *eid_epoch);
+ uint32_t (*get_last_eid)(tcg_swid_attr_tag_inv_t *this,
+ uint32_t *eid_epoch);
/**
* Get Inventory of SWID tags
@@ -71,12 +79,10 @@ struct tcg_swid_attr_tag_inv_t {
* @param request_id Copy of the Request ID
* @param eid_epoch Event ID Epoch
* @param eid Last Event ID
- * @param inventory SWID Tag Inventory
*/
-pa_tnc_attr_t* tcg_swid_attr_tag_inv_create(u_int32_t request_id,
- u_int32_t eid_epoch,
- u_int32_t eid,
- swid_inventory_t *inventory);
+pa_tnc_attr_t* tcg_swid_attr_tag_inv_create(uint32_t request_id,
+ uint32_t eid_epoch,
+ uint32_t eid);
/**
* Creates an tcg_swid_attr_tag_inv_t object from received data