refactored PA-TNC message handling by IMCs

This commit is contained in:
Andreas Steffen
2012-10-17 10:02:53 +02:00
parent 154cae09e3
commit f8a70254a9
15 changed files with 898 additions and 606 deletions
+44 -31
View File
@@ -50,6 +50,44 @@ struct imc_agent_t {
TNC_ConnectionID connection_id,
TNC_RetryReason reason);
/**
* Call when an IMC-IMC message is to be sent
*
* @param imc_id IMC ID assigned by TNCC
* @param connection_id network connection ID assigned by TNCC
* @param msg message to send
* @param msg_len message length in bytes
* @param msg_type message type
* @return TNC result code
*/
TNC_Result (*send_message)(TNC_IMCID imc_id,
TNC_ConnectionID connection_id,
TNC_BufferReference msg,
TNC_UInt32 msg_len,
TNC_MessageType msg_type);
/**
* Call when an IMC-IMC message is to be sent with long message types
*
* @param imc_id IMC ID assigned by TNCC
* @param connection_id network connection ID assigned by TNCC
* @param msg_flags message flags
* @param msg message to send
* @param msg_len message length in bytes
* @param msg_vid message vendor ID
* @param msg_subtype message subtype
* @param dst_imc_id destination IMV ID
* @return TNC result code
*/
TNC_Result (*send_message_long)(TNC_IMCID imc_id,
TNC_ConnectionID connection_id,
TNC_UInt32 msg_flags,
TNC_BufferReference msg,
TNC_UInt32 msg_len,
TNC_VendorID msg_vid,
TNC_MessageSubtype msg_subtype,
TNC_UInt32 dst_imv_id);
/**
* Bind TNCC functions
*
@@ -100,43 +138,18 @@ struct imc_agent_t {
TNC_ConnectionID connection_id, imc_state_t **state);
/**
* Call when an PA-TNC message is to be sent
* Get IMC name
*
* @param connection_id network connection ID assigned by TNCC
* @param excl exclusive flag
* @param src_imc_id IMC ID to be set as source
* @param dst_imv_id IMV ID to be set as destination
* @param msg_vid message vendor ID
* @param msg_subtype message subtype
* @param attr_list list of PA-TNC attributes to send
* @return TNC result code
* return IMC name
*/
TNC_Result (*send_message)(imc_agent_t *this,
TNC_ConnectionID connection_id, bool excl,
TNC_UInt32 src_imc_id, TNC_UInt32 dst_imv_id,
TNC_VendorID msg_vid,
TNC_MessageSubtype msg_subtype,
linked_list_t *attr_list);
const char* (*get_name)(imc_agent_t *this);
/**
* Call when a PA-TNC message was received
* Get base IMC ID
*
* @param state state for current connection
* @param msg received unparsed message
* @param msg_vid message vendorID of the received message
* @param msg_subtype message subtype of the received message
* @param src_imv_id source IMV ID
* @param dst_imc_id destination IMC ID
* @param pa_tnc_message parsed PA-TNC message or NULL if an error occurred
* @return TNC result code
* return base IMC ID
*/
TNC_Result (*receive_message)(imc_agent_t *this,
imc_state_t *state, chunk_t msg,
TNC_VendorID msg_vid,
TNC_MessageSubtype msg_subtype,
TNC_UInt32 src_imv_id,
TNC_UInt32 dst_imc_id,
pa_tnc_msg_t **pa_tnc_msg);
TNC_IMCID (*get_id)(imc_agent_t *this);
/**
* Reserve additional IMC IDs from TNCC