aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libcharon/plugins/tnc_imc/tnc_imc_bind_function.c12
-rw-r--r--src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c12
-rw-r--r--src/libcharon/plugins/tnccs_20/tnccs_20.c3
-rw-r--r--src/libcharon/tnc/tnccs/tnccs.h18
-rw-r--r--src/libcharon/tnc/tnccs/tnccs_manager.c11
-rw-r--r--src/libcharon/tnc/tnccs/tnccs_manager.h8
6 files changed, 39 insertions, 25 deletions
diff --git a/src/libcharon/plugins/tnc_imc/tnc_imc_bind_function.c b/src/libcharon/plugins/tnc_imc/tnc_imc_bind_function.c
index be6debb36..5cc14f109 100644
--- a/src/libcharon/plugins/tnc_imc/tnc_imc_bind_function.c
+++ b/src/libcharon/plugins/tnc_imc/tnc_imc_bind_function.c
@@ -18,6 +18,8 @@
#include <debug.h>
#include <daemon.h>
+#define TNC_IMVID_ANY 0xffff
+
/**
* Called by the IMC to inform a TNCC about the set of message types the IMC
* is able to receive
@@ -46,12 +48,12 @@ TNC_Result TNC_TNCC_RequestHandshakeRetry(TNC_IMCID imc_id,
*/
TNC_Result TNC_TNCC_SendMessage(TNC_IMCID imc_id,
TNC_ConnectionID connection_id,
- TNC_BufferReference message,
- TNC_UInt32 message_len,
- TNC_MessageType message_type)
+ TNC_BufferReference msg,
+ TNC_UInt32 msg_len,
+ TNC_MessageType msg_type)
{
- return charon->tnccs->send_message(charon->tnccs, connection_id, message,
- message_len, message_type);
+ return charon->tnccs->send_message(charon->tnccs, imc_id, TNC_IMVID_ANY,
+ connection_id, msg, msg_len, msg_type);
}
/**
diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c b/src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c
index cc4f5b27b..e36997ea0 100644
--- a/src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c
+++ b/src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c
@@ -18,6 +18,8 @@
#include <debug.h>
#include <daemon.h>
+#define TNC_IMCID_ANY 0xffff
+
/**
* Called by the IMV to inform a TNCS about the set of message types the IMV
* is able to receive
@@ -46,12 +48,12 @@ TNC_Result TNC_TNCS_RequestHandshakeRetry(TNC_IMVID imv_id,
*/
TNC_Result TNC_TNCS_SendMessage(TNC_IMVID imv_id,
TNC_ConnectionID connection_id,
- TNC_BufferReference message,
- TNC_UInt32 message_len,
- TNC_MessageType message_type)
+ TNC_BufferReference msg,
+ TNC_UInt32 msg_len,
+ TNC_MessageType msg_type)
{
- return charon->tnccs->send_message(charon->tnccs, connection_id, message,
- message_len, message_type);
+ return charon->tnccs->send_message(charon->tnccs, TNC_IMCID_ANY, imv_id,
+ connection_id, msg, msg_len, msg_type);
}
/**
diff --git a/src/libcharon/plugins/tnccs_20/tnccs_20.c b/src/libcharon/plugins/tnccs_20/tnccs_20.c
index afd105c82..8d29bfb2b 100644
--- a/src/libcharon/plugins/tnccs_20/tnccs_20.c
+++ b/src/libcharon/plugins/tnccs_20/tnccs_20.c
@@ -61,7 +61,8 @@ struct private_tnccs_20_t {
};
METHOD(tnccs_t, send_message, void,
- private_tnccs_20_t* this, TNC_BufferReference message,
+ private_tnccs_20_t* this, TNC_IMCID imc_id, TNC_IMVID imv_id,
+ TNC_BufferReference message,
TNC_UInt32 message_len,
TNC_MessageType message_type)
{
diff --git a/src/libcharon/tnc/tnccs/tnccs.h b/src/libcharon/tnc/tnccs/tnccs.h
index e4b7585be..48374aadf 100644
--- a/src/libcharon/tnc/tnccs/tnccs.h
+++ b/src/libcharon/tnc/tnccs/tnccs.h
@@ -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_ @}*/
diff --git a/src/libcharon/tnc/tnccs/tnccs_manager.c b/src/libcharon/tnc/tnccs/tnccs_manager.c
index 14c648025..898c4f00a 100644
--- a/src/libcharon/tnc/tnccs/tnccs_manager.c
+++ b/src/libcharon/tnc/tnccs/tnccs_manager.c
@@ -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;
diff --git a/src/libcharon/tnc/tnccs/tnccs_manager.h b/src/libcharon/tnc/tnccs/tnccs_manager.h
index 7c0c7d274..23f7a6810 100644
--- a/src/libcharon/tnc/tnccs/tnccs_manager.h
+++ b/src/libcharon/tnc/tnccs/tnccs_manager.h
@@ -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);