define pen_type_t as a vendor-specific type

This commit is contained in:
Andreas Steffen
2012-08-20 22:37:08 +02:00
parent 88a5abf5e2
commit dbb7859f9f
35 changed files with 301 additions and 624 deletions
+5 -20
View File
@@ -33,14 +33,9 @@ struct private_ita_attr_command_t {
ita_attr_command_t public;
/**
* Attribute vendor ID
* Vendor-specific attribute type
*/
pen_t vendor_id;
/**
* Attribute type
*/
u_int32_t type;
pen_type_t type;
/**
* Attribute value
@@ -63,13 +58,7 @@ struct private_ita_attr_command_t {
refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
private_ita_attr_command_t *this)
{
return this->vendor_id;
}
METHOD(pa_tnc_attr_t, get_type, u_int32_t,
METHOD(pa_tnc_attr_t, get_type, pen_type_t,
private_ita_attr_command_t *this)
{
return this->type;
@@ -148,7 +137,6 @@ pa_tnc_attr_t *ita_attr_command_create(char *command)
INIT(this,
.public = {
.pa_tnc_attribute = {
.get_vendor_id = _get_vendor_id,
.get_type = _get_type,
.get_value = _get_value,
.get_noskip_flag = _get_noskip_flag,
@@ -160,8 +148,7 @@ pa_tnc_attr_t *ita_attr_command_create(char *command)
},
.get_command = _get_command,
},
.vendor_id = PEN_ITA,
.type = ITA_ATTR_COMMAND,
.type = { PEN_ITA, ITA_ATTR_COMMAND },
.command = strdup(command),
.ref = 1,
);
@@ -179,7 +166,6 @@ pa_tnc_attr_t *ita_attr_command_create_from_data(chunk_t data)
INIT(this,
.public = {
.pa_tnc_attribute = {
.get_vendor_id = _get_vendor_id,
.get_type = _get_type,
.get_value = _get_value,
.build = _build,
@@ -189,8 +175,7 @@ pa_tnc_attr_t *ita_attr_command_create_from_data(chunk_t data)
},
.get_command = _get_command,
},
.vendor_id = PEN_ITA,
.type = ITA_ATTR_COMMAND,
.type = {PEN_ITA, ITA_ATTR_COMMAND },
.value = chunk_clone(data),
.ref = 1,
);
+5 -20
View File
@@ -33,14 +33,9 @@ struct private_ita_attr_dummy_t {
ita_attr_dummy_t public;
/**
* Attribute vendor ID
* Vendor-specific attribute type
*/
pen_t vendor_id;
/**
* Attribute type
*/
u_int32_t type;
pen_type_t type;
/**
* Attribute value
@@ -63,13 +58,7 @@ struct private_ita_attr_dummy_t {
refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
private_ita_attr_dummy_t *this)
{
return this->vendor_id;
}
METHOD(pa_tnc_attr_t, get_type, u_int32_t,
METHOD(pa_tnc_attr_t, get_type, pen_type_t,
private_ita_attr_dummy_t *this)
{
return this->type;
@@ -145,7 +134,6 @@ pa_tnc_attr_t *ita_attr_dummy_create(int size)
INIT(this,
.public = {
.pa_tnc_attribute = {
.get_vendor_id = _get_vendor_id,
.get_type = _get_type,
.get_value = _get_value,
.get_noskip_flag = _get_noskip_flag,
@@ -157,8 +145,7 @@ pa_tnc_attr_t *ita_attr_dummy_create(int size)
},
.get_size = _get_size,
},
.vendor_id = PEN_ITA,
.type = ITA_ATTR_DUMMY,
.type = { PEN_ITA, ITA_ATTR_DUMMY },
.size = size,
.ref = 1,
);
@@ -176,7 +163,6 @@ pa_tnc_attr_t *ita_attr_dummy_create_from_data(chunk_t data)
INIT(this,
.public = {
.pa_tnc_attribute = {
.get_vendor_id = _get_vendor_id,
.get_type = _get_type,
.get_value = _get_value,
.build = _build,
@@ -186,8 +172,7 @@ pa_tnc_attr_t *ita_attr_dummy_create_from_data(chunk_t data)
},
.get_size = _get_size,
},
.vendor_id = PEN_ITA,
.type = ITA_ATTR_DUMMY,
.type = { PEN_ITA, ITA_ATTR_DUMMY },
.value = chunk_clone(data),
.ref = 1,
);