const char *name;
/**
- * message type of IMV
+ * message vendor ID of IMV
*/
- TNC_MessageType type;
+ TNC_VendorID vendor_id;
+
+ /**
+ * message subtype of IMV
+ */
+ TNC_MessageSubtype subtype;
/**
* ID of IMV as assigned by TNCS
rwlock_t *connection_lock;
/**
- * Inform a TNCS about the set of message types the IMV is able to receive
+ * Inform a TNCS about the set of message types the IMV is able to receive
*
* @param imv_id IMV ID assigned by TNCS
* @param supported_types list of supported message types
TNC_UInt32 type_count);
/**
+ * Inform a TNCS about the set of message types the IMV is able to receive
+ *
+ * @param imv_id IMV ID assigned by TNCS
+ * @param supported_vids list of supported message vendor IDs
+ * @param supported_subtypes list of supported message subtypes
+ * @param type_count number of list elements
+ * @return TNC result code
+ */
+ TNC_Result (*report_message_types_long)(TNC_IMVID imv_id,
+ TNC_VendorIDList supported_vids,
+ TNC_MessageSubtypeList supported_subtypes,
+ TNC_UInt32 type_count);
+
+ /**
* Call when an IMV-IMC message is to be sent
*
* @param imv_id IMV ID assigned by TNCS
{
this->report_message_types = NULL;
}
+ if (bind_function(this->id, "TNC_TNCS_ReportMessageTypesLong",
+ (void**)&this->report_message_types_long) != TNC_RESULT_SUCCESS)
+ {
+ this->report_message_types_long = NULL;
+ }
if (bind_function(this->id, "TNC_TNCS_RequestHandshakeRetry",
(void**)&this->public.request_handshake_retry) != TNC_RESULT_SUCCESS)
{
DBG2(DBG_IMV, "IMV %u \"%s\" provided with bind function",
this->id, this->name);
- if (this->report_message_types)
+ if (this->report_message_types_long)
{
- this->report_message_types(this->id, &this->type, 1);
+ this->report_message_types_long(this->id, &this->vendor_id,
+ &this->subtype, 1);
+ }
+ else if (this->report_message_types &&
+ this->vendor_id <= TNC_VENDORID_ANY &&
+ this->subtype <= TNC_SUBTYPE_ANY)
+ {
+ TNC_MessageType type;
+
+ type = (this->vendor_id << 8) | this->subtype;
+ this->report_message_types(this->id, &type, 1);
}
return TNC_RESULT_SUCCESS;
}
METHOD(imv_agent_t, send_message, TNC_Result,
private_imv_agent_t *this, TNC_ConnectionID connection_id, chunk_t msg)
{
+ TNC_MessageType type;
+
if (!this->send_message)
{
return TNC_RESULT_FATAL;
}
- return this->send_message(this->id, connection_id, msg.ptr, msg.len,
- this->type);
+ type = (this->vendor_id << 8) | this->subtype;
+ return this->send_message(this->id, connection_id, msg.ptr, msg.len, type);
}
METHOD(imv_agent_t, set_recommendation, TNC_Result,
.destroy = _destroy,
},
.name = name,
- .type = (vendor_id << 8) | (subtype & 0xff),
+ .vendor_id = vendor_id,
+ .subtype = subtype,
.id = id,
.connections = linked_list_create(),
.connection_lock = rwlock_create(RWLOCK_TYPE_DEFAULT),