Changed the type of name field to corresponding enum type

This commit is contained in:
Sansar Choinyambuu
2011-09-08 12:08:09 +02:00
committed by Andreas Steffen
parent f2b89288d0
commit d975e4a755
2 changed files with 21 additions and 17 deletions
@@ -22,16 +22,6 @@
typedef struct private_tcg_pts_attr_req_funct_comp_evid_t private_tcg_pts_attr_req_funct_comp_evid_t;
/**
* Qualifier for Functional Component (see section 5.2 of PTS Protocol: Binding to TNC IF-M Specification)
*
*
* 0 1 2 3 4 5
* +-+-+-+-+-+-+
* |K|S| Type |
* +-+-+-+-+-+-+
*/
/**
* Request Functional Component Evidence (see section 3.14.1 of PTS Protocol: Binding to TNC IF-M Specification)
*
@@ -60,6 +50,16 @@ typedef struct private_tcg_pts_attr_req_funct_comp_evid_t private_tcg_pts_attr_r
*
*/
/**
* Qualifier for Functional Component (see section 5.2 of PTS Protocol: Binding to TNC IF-M Specification)
*
*
* 0 1 2 3 4 5
* +-+-+-+-+-+-+
* |K|S| Type |
* +-+-+-+-+-+-+
*/
#define PTS_REQ_FUNCT_COMP_EVID_SIZE 12
#define PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM 0x00
@@ -121,7 +121,7 @@ struct private_tcg_pts_attr_req_funct_comp_evid_t {
/**
* Component Functional Name
*/
u_int32_t name;
pts_attr_req_funct_comp_name_bin_enum_t name;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
@@ -229,6 +229,10 @@ METHOD(pa_tnc_attr_t, process, status_t,
this->qualifier.type = ( fam_and_qualifier & 0xF );
/* TODO: Check the type is defined in pts_attr_req_funct_comp_type_t */
reader->read_uint32(reader, &this->name);
/* TODO: Check the name is defined in pts_attr_req_funct_comp_name_bin_enum_t */
reader->destroy(reader);
return SUCCESS;
@@ -284,14 +288,14 @@ METHOD(tcg_pts_attr_req_funct_comp_evid_t, set_qualifier, void,
this->qualifier = qualifier;
}
METHOD(tcg_pts_attr_req_funct_comp_evid_t, get_comp_funct_name, u_int32_t,
METHOD(tcg_pts_attr_req_funct_comp_evid_t, get_comp_funct_name, pts_attr_req_funct_comp_name_bin_enum_t,
private_tcg_pts_attr_req_funct_comp_evid_t *this)
{
return this->name;
}
METHOD(tcg_pts_attr_req_funct_comp_evid_t, set_comp_funct_name, void,
private_tcg_pts_attr_req_funct_comp_evid_t *this, u_int32_t name)
private_tcg_pts_attr_req_funct_comp_evid_t *this, pts_attr_req_funct_comp_name_bin_enum_t name)
{
this->name = name;
}
@@ -304,7 +308,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_funct_comp_evid_create(
u_int32_t depth,
u_int32_t vendor_id,
tcg_pts_qualifier_t qualifier,
u_int32_t name)
name)
{
private_tcg_pts_attr_req_funct_comp_evid_t *this;
@@ -164,7 +164,7 @@ struct tcg_pts_attr_req_funct_comp_evid_t {
*
* @return Component Functional Name
*/
u_int32_t (*get_comp_funct_name)(tcg_pts_attr_req_funct_comp_evid_t *this);
pts_attr_req_funct_comp_name_bin_enum_t (*get_comp_funct_name)(tcg_pts_attr_req_funct_comp_evid_t *this);
/**
@@ -173,7 +173,7 @@ struct tcg_pts_attr_req_funct_comp_evid_t {
* @param name Component Functional Name
*/
void (*set_comp_funct_name)(tcg_pts_attr_req_funct_comp_evid_t *this,
u_int32_t name);
pts_attr_req_funct_comp_name_bin_enum_t name);
};
@@ -191,7 +191,7 @@ pa_tnc_attr_t* tcg_pts_attr_req_funct_comp_evid_create(pts_attr_req_funct_comp_e
u_int32_t depth,
u_int32_t vendor_id,
tcg_pts_qualifier_t qualifier,
u_int32_t name);
pts_attr_req_funct_comp_name_bin_enum_t name);
/**
* Creates an tcg_pts_attr_req_funct_comp_evid_t object from received data