added IMC and IMV IDs as arguments to send_message()

This commit is contained in:
Andreas Steffen
2010-11-17 00:04:10 +01:00
parent 66c30fa244
commit a423a96140
6 changed files with 39 additions and 25 deletions
+11 -7
View File
@@ -22,6 +22,7 @@
#define TNCCS_H_
#include <tnc/tncif.h>
#include <tnc/tncifimc.h>
#include <tnc/tncifimv.h>
#include <library.h>
@@ -54,13 +55,16 @@ typedef tnccs_t* (*tnccs_constructor_t)(bool is_server);
/**
* Callback function adding a message to a TNCCS batch
*
* @param message message to be added
* @param message_len message length
* @param message_type message type
* @param imc_id ID of IMC or TNC_IMCID_ANY
* @param imc_id ID of IMV or TNC_IMVID_ANY
* @param msg message to be added
* @param msg_len message length
* @param msg_type message type
*/
typedef void (*tnccs_send_message_t)(tnccs_t* tncss,
TNC_BufferReference message,
TNC_UInt32 message_len,
TNC_MessageType message_type);
typedef void (*tnccs_send_message_t)(tnccs_t* tncss, TNC_IMCID imc_id,
TNC_IMVID imv_id,
TNC_BufferReference msg,
TNC_UInt32 msg_len,
TNC_MessageType msg_type);
#endif /** TNCCS_H_ @}*/
+6 -5
View File
@@ -233,10 +233,11 @@ METHOD(tnccs_manager_t, remove_connection, void,
}
METHOD(tnccs_manager_t, send_message, TNC_Result,
private_tnccs_manager_t *this, TNC_ConnectionID id,
TNC_BufferReference message,
TNC_UInt32 message_len,
TNC_MessageType message_type)
private_tnccs_manager_t *this, TNC_IMCID imc_id, TNC_IMVID imv_id,
TNC_ConnectionID id,
TNC_BufferReference msg,
TNC_UInt32 msg_len,
TNC_MessageType msg_type)
{
enumerator_t *enumerator;
tnccs_connection_entry_t *entry;
@@ -259,7 +260,7 @@ METHOD(tnccs_manager_t, send_message, TNC_Result,
if (tnccs && send_message)
{
send_message(tnccs, message, message_len, message_type);
send_message(tnccs, imc_id, imv_id, msg, msg_len, msg_type);
return TNC_RESULT_SUCCESS;
}
return TNC_RESULT_FATAL;
+6 -2
View File
@@ -86,14 +86,18 @@ struct tnccs_manager_t {
/**
* Add an IMC/IMV message to the batch of a given connection ID.
*
* @param id target connection ID
* @param imc_id ID of IMC or TNC_IMCID_ANY
* @param imv_id ID of IMV or TNC_IMVID_ANY
* @param connection_id ID of target connection
* @param msg message to be added
* @param msg_len message length
* @param msg_type message type
* @return return code
*/
TNC_Result (*send_message)(tnccs_manager_t *this,
TNC_ConnectionID id,
TNC_IMCID imc_id,
TNC_IMVID imv_id,
TNC_ConnectionID connection_id,
TNC_BufferReference msg,
TNC_UInt32 msg_len,
TNC_MessageType msg_type);