SWIMA attribute name changes
draft-ietf-sacm-nea-swima-patnc-01 changes some SWIMA attribute names.
This commit is contained in:
@@ -47,7 +47,7 @@ ENUM_BEGIN(ietf_attr_names, IETF_ATTR_TESTING,
|
||||
"Forwarding Enabled",
|
||||
"Factory Default Password Enabled",
|
||||
);
|
||||
ENUM_NEXT(ietf_attr_names, IETF_ATTR_SW_REQUEST,
|
||||
ENUM_NEXT(ietf_attr_names, IETF_ATTR_SWIMA_REQUEST,
|
||||
IETF_ATTR_SRC_METADATA_RESP,
|
||||
IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
|
||||
"SW Request",
|
||||
@@ -97,7 +97,7 @@ pa_tnc_attr_t* ietf_attr_create_from_data(uint32_t type, size_t length,
|
||||
case IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED:
|
||||
return generic_attr_bool_create_from_data(length, value,
|
||||
pen_type_create(PEN_IETF, type));
|
||||
case IETF_ATTR_SW_REQUEST:
|
||||
case IETF_ATTR_SWIMA_REQUEST:
|
||||
return ietf_swima_attr_req_create_from_data(length, value);
|
||||
case IETF_ATTR_SW_ID_INVENTORY:
|
||||
return ietf_swima_attr_sw_inv_create_from_data(length, value, TRUE);
|
||||
|
||||
@@ -48,7 +48,7 @@ enum ietf_attr_t {
|
||||
IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED = 12,
|
||||
|
||||
/* draft-ietf-sacm-nea-swid-patnc */
|
||||
IETF_ATTR_SW_REQUEST = 17,
|
||||
IETF_ATTR_SWIMA_REQUEST = 17,
|
||||
IETF_ATTR_SW_ID_INVENTORY = 18,
|
||||
IETF_ATTR_SW_ID_EVENTS = 19,
|
||||
IETF_ATTR_SW_INVENTORY = 20,
|
||||
|
||||
@@ -27,16 +27,16 @@ ENUM_BEGIN(pa_tnc_error_code_names, PA_ERROR_RESERVED,
|
||||
"Version Not Supported",
|
||||
"Attribute Type Not Supported"
|
||||
);
|
||||
ENUM_NEXT(pa_tnc_error_code_names, PA_ERROR_SW,
|
||||
PA_ERROR_SW_SUBSCRIPTION_ID_REUSE,
|
||||
ENUM_NEXT(pa_tnc_error_code_names, PA_ERROR_SWIMA,
|
||||
PA_ERROR_SWIMA_SUBSCRIPTION_ID_REUSE,
|
||||
PA_ERROR_ATTR_TYPE_NOT_SUPPORTED,
|
||||
"SW Error",
|
||||
"SW Subscription Denied",
|
||||
"SW Response Too Large",
|
||||
"SW Subscription Fulfillment Error",
|
||||
"SW Subscription ID Reuse"
|
||||
"SWIMA Error",
|
||||
"SWIMA Subscription Denied",
|
||||
"SWIMA Response Too Large",
|
||||
"SWIMA Subscription Fulfillment Error",
|
||||
"SWIMA Subscription ID Reuse"
|
||||
);
|
||||
ENUM_END(pa_tnc_error_code_names, PA_ERROR_SW_SUBSCRIPTION_ID_REUSE);
|
||||
ENUM_END(pa_tnc_error_code_names, PA_ERROR_SWIMA_SUBSCRIPTION_ID_REUSE);
|
||||
|
||||
typedef struct private_ietf_attr_pa_tnc_error_t private_ietf_attr_pa_tnc_error_t;
|
||||
|
||||
|
||||
@@ -33,18 +33,18 @@ typedef enum pa_tnc_error_code_t pa_tnc_error_code_t;
|
||||
enum pa_tnc_error_code_t {
|
||||
|
||||
/* RFC 5792 PA-TNC */
|
||||
PA_ERROR_RESERVED = 0,
|
||||
PA_ERROR_INVALID_PARAMETER = 1,
|
||||
PA_ERROR_VERSION_NOT_SUPPORTED = 2,
|
||||
PA_ERROR_ATTR_TYPE_NOT_SUPPORTED = 3,
|
||||
PA_ERROR_PA_TNC_MSG_ROOF = 3,
|
||||
PA_ERROR_RESERVED = 0,
|
||||
PA_ERROR_INVALID_PARAMETER = 1,
|
||||
PA_ERROR_VERSION_NOT_SUPPORTED = 2,
|
||||
PA_ERROR_ATTR_TYPE_NOT_SUPPORTED = 3,
|
||||
PA_ERROR_PA_TNC_MSG_ROOF = 3,
|
||||
|
||||
/* draft-ietf-sacm-nea-swid-patnc (SWIMA) */
|
||||
PA_ERROR_SW = 32,
|
||||
PA_ERROR_SW_SUBSCRIPTION_DENIED = 33,
|
||||
PA_ERROR_SW_RESPONSE_TOO_LARGE = 34,
|
||||
PA_ERROR_SW_SUBSCRIPTION_FULFILLMENT = 35,
|
||||
PA_ERROR_SW_SUBSCRIPTION_ID_REUSE = 36
|
||||
PA_ERROR_SWIMA = 32,
|
||||
PA_ERROR_SWIMA_SUBSCRIPTION_DENIED = 33,
|
||||
PA_ERROR_SWIMA_RESPONSE_TOO_LARGE = 34,
|
||||
PA_ERROR_SWIMA_SUBSCRIPTION_FULFILLMENT = 35,
|
||||
PA_ERROR_SWIMA_SUBSCRIPTION_ID_REUSE = 36
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -274,7 +274,7 @@ pa_tnc_attr_t *ietf_swima_attr_req_create(uint8_t flags, uint32_t request_id)
|
||||
.set_targets = _set_targets,
|
||||
.get_targets = _get_targets,
|
||||
},
|
||||
.type = { PEN_IETF, IETF_ATTR_SW_REQUEST },
|
||||
.type = { PEN_IETF, IETF_ATTR_SWIMA_REQUEST },
|
||||
.flags = flags & SW_REQ_RESERVED_MASK,
|
||||
.request_id = request_id,
|
||||
.targets = swima_inventory_create(),
|
||||
@@ -309,7 +309,7 @@ pa_tnc_attr_t *ietf_swima_attr_req_create_from_data(size_t length, chunk_t data)
|
||||
.set_targets = _set_targets,
|
||||
.get_targets = _get_targets,
|
||||
},
|
||||
.type = { PEN_IETF, IETF_ATTR_SW_REQUEST },
|
||||
.type = { PEN_IETF, IETF_ATTR_SWIMA_REQUEST },
|
||||
.length = length,
|
||||
.value = chunk_clone(data),
|
||||
.targets = swima_inventory_create(),
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
static const char imc_name[] = "SWIMA";
|
||||
|
||||
static pen_type_t msg_types[] = {
|
||||
{ PEN_IETF, PA_SUBTYPE_IETF_SW }
|
||||
{ PEN_IETF, PA_SUBTYPE_IETF_SWIMA }
|
||||
};
|
||||
|
||||
static imc_agent_t *imc_swima;
|
||||
@@ -180,7 +180,7 @@ static void fulfill_request(imc_state_t *state, imc_msg_t *msg,
|
||||
{
|
||||
snprintf(error_msg, msg_len, "failed to collect SW%s events, "
|
||||
"fallback to SW%s inventory", id_str, id_str);
|
||||
attr = swima_error_create(PA_ERROR_SW, request_id, 0, error_msg);
|
||||
attr = swima_error_create(PA_ERROR_SWIMA, request_id, 0, error_msg);
|
||||
msg->add_attribute(msg, attr);
|
||||
}
|
||||
else {
|
||||
@@ -207,7 +207,7 @@ static void fulfill_request(imc_state_t *state, imc_msg_t *msg,
|
||||
{
|
||||
snprintf(error_msg, msg_len, "failed to collect SW%s inventory",
|
||||
id_str);
|
||||
attr = swima_error_create(PA_ERROR_SW, request_id, 0, error_msg);
|
||||
attr = swima_error_create(PA_ERROR_SWIMA, request_id, 0, error_msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -258,7 +258,7 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
|
||||
|
||||
type = attr->get_type(attr);
|
||||
|
||||
if (type.vendor_id != PEN_IETF || type.type != IETF_ATTR_SW_REQUEST)
|
||||
if (type.vendor_id != PEN_IETF || type.type != IETF_ATTR_SWIMA_REQUEST)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -270,7 +270,7 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
|
||||
|
||||
if (flags & (IETF_SWIMA_ATTR_REQ_FLAG_S | IETF_SWIMA_ATTR_REQ_FLAG_C))
|
||||
{
|
||||
attr = swima_error_create(PA_ERROR_SW_SUBSCRIPTION_DENIED,
|
||||
attr = swima_error_create(PA_ERROR_SWIMA_SUBSCRIPTION_DENIED,
|
||||
request_id, 0, "no subscription available yet");
|
||||
out_msg->add_attribute(out_msg, attr);
|
||||
break;
|
||||
|
||||
@@ -44,7 +44,7 @@ typedef struct private_imv_swima_agent_t private_imv_swima_agent_t;
|
||||
|
||||
/* Subscribed PA-TNC message subtypes */
|
||||
static pen_type_t msg_types[] = {
|
||||
{ PEN_IETF, PA_SUBTYPE_IETF_SW }
|
||||
{ PEN_IETF, PA_SUBTYPE_IETF_SWIMA }
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -175,7 +175,7 @@ static TNC_Result receive_msg(private_imv_swima_agent_t *this,
|
||||
reader->destroy(reader);
|
||||
continue;
|
||||
}
|
||||
if (error_code.type == PA_ERROR_SW_RESPONSE_TOO_LARGE)
|
||||
if (error_code.type == PA_ERROR_SWIMA_RESPONSE_TOO_LARGE)
|
||||
{
|
||||
if (!reader->read_uint32(reader, &max_attr_size))
|
||||
{
|
||||
|
||||
@@ -124,7 +124,7 @@ static req_data_t req_data[] = {
|
||||
START_TEST(test_imcv_swima_sw_req)
|
||||
{
|
||||
pen_type_t type;
|
||||
pen_type_t pen_type = { PEN_IETF, IETF_ATTR_SW_REQUEST };
|
||||
pen_type_t pen_type = { PEN_IETF, IETF_ATTR_SWIMA_REQUEST };
|
||||
pa_tnc_attr_t *attr, *attr1, *attr2;
|
||||
ietf_swima_attr_req_t *c_attr;
|
||||
swima_record_t *target;
|
||||
|
||||
@@ -59,7 +59,7 @@ pa_tnc_attr_t* swima_error_create(pa_tnc_error_code_t code, uint32_t request_id,
|
||||
writer = bio_writer_create(4);
|
||||
writer->write_uint32(writer, request_id);
|
||||
|
||||
if (code == PA_ERROR_SW_RESPONSE_TOO_LARGE)
|
||||
if (code == PA_ERROR_SWIMA_RESPONSE_TOO_LARGE)
|
||||
{
|
||||
writer->write_uint32(writer, max_attr_size);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "tncif_pa_subtypes.h"
|
||||
|
||||
/* IETF PA Subtype names */
|
||||
ENUM_BEGIN(pa_subtype_ietf_names, PA_SUBTYPE_IETF_TESTING, PA_SUBTYPE_IETF_SW,
|
||||
ENUM_BEGIN(pa_subtype_ietf_names, PA_SUBTYPE_IETF_TESTING, PA_SUBTYPE_IETF_SWIMA,
|
||||
"Testing",
|
||||
"Operating System",
|
||||
"Anti-Virus",
|
||||
@@ -26,10 +26,10 @@ ENUM_BEGIN(pa_subtype_ietf_names, PA_SUBTYPE_IETF_TESTING, PA_SUBTYPE_IETF_SW,
|
||||
"IDPS",
|
||||
"VPN",
|
||||
"NEA Client",
|
||||
"Software"
|
||||
"SWIMA"
|
||||
);
|
||||
ENUM_NEXT(pa_subtype_ietf_names, PA_SUBTYPE_IETF_ANY, PA_SUBTYPE_IETF_ANY,
|
||||
PA_SUBTYPE_IETF_SW,
|
||||
PA_SUBTYPE_IETF_SWIMA,
|
||||
"ANY"
|
||||
);
|
||||
ENUM_END(pa_subtype_ietf_names, PA_SUBTYPE_IETF_ANY);
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef enum pa_subtype_ita_t pa_subtype_ita_t;
|
||||
PA_SUBTYPE_IETF_IDPS = 0x06,
|
||||
PA_SUBTYPE_IETF_VPN = 0x07,
|
||||
PA_SUBTYPE_IETF_NEA_CLIENT = 0x08,
|
||||
PA_SUBTYPE_IETF_SW = 0x09,
|
||||
PA_SUBTYPE_IETF_SWIMA = 0x09,
|
||||
PA_SUBTYPE_IETF_ANY = 0xff
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user