diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2012-07-11 23:34:51 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2012-07-11 23:34:51 +0200 |
commit | 246c9ad8314e8e72d242f9bc26aab84bf938c272 (patch) | |
tree | 971d7d49b939a9e11610dd06acbe355ddfe4a1ba /src/libimcv/imc | |
parent | c9c3da66a8045ec92b612b0a36b817d560757dfe (diff) | |
download | strongswan-246c9ad8314e8e72d242f9bc26aab84bf938c272.tar.bz2 strongswan-246c9ad8314e8e72d242f9bc26aab84bf938c272.tar.xz |
imc/imv->send_message() uses attr_list
Diffstat (limited to 'src/libimcv/imc')
-rw-r--r-- | src/libimcv/imc/imc_agent.c | 15 | ||||
-rw-r--r-- | src/libimcv/imc/imc_agent.h | 5 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/libimcv/imc/imc_agent.c b/src/libimcv/imc/imc_agent.c index de2f959a4..4f9bb03be 100644 --- a/src/libimcv/imc/imc_agent.c +++ b/src/libimcv/imc/imc_agent.c @@ -18,7 +18,6 @@ #include <tncif_names.h> #include <debug.h> -#include <utils/linked_list.h> #include <threading/rwlock.h> typedef struct private_imc_agent_t private_imc_agent_t; @@ -453,11 +452,14 @@ METHOD(imc_agent_t, get_state, bool, METHOD(imc_agent_t, send_message, TNC_Result, private_imc_agent_t *this, TNC_ConnectionID connection_id, bool excl, - TNC_UInt32 src_imc_id, TNC_UInt32 dst_imv_id, chunk_t msg) + TNC_UInt32 src_imc_id, TNC_UInt32 dst_imv_id, linked_list_t *attr_list) { TNC_MessageType type; TNC_UInt32 msg_flags; imc_state_t *state; + pa_tnc_attr_t *attr; + pa_tnc_msg_t *pa_tnc_msg; + chunk_t msg; state = find_connection(this, connection_id); if (!state) @@ -467,6 +469,15 @@ METHOD(imc_agent_t, send_message, TNC_Result, return TNC_RESULT_FATAL; } + pa_tnc_msg = pa_tnc_msg_create(); + + while (attr_list->remove_first(attr_list, (void**)&attr) == SUCCESS) + { + pa_tnc_msg->add_attribute(pa_tnc_msg, attr); + } + pa_tnc_msg->build(pa_tnc_msg); + msg = pa_tnc_msg->get_encoding(pa_tnc_msg); + if (state->has_long(state) && this->send_message_long) { if (!src_imc_id) diff --git a/src/libimcv/imc/imc_agent.h b/src/libimcv/imc/imc_agent.h index d1fef4d8d..33335d1a2 100644 --- a/src/libimcv/imc/imc_agent.h +++ b/src/libimcv/imc/imc_agent.h @@ -26,6 +26,7 @@ #include <tncifimc.h> #include <pen/pen.h> +#include <utils/linked_list.h> #include <library.h> @@ -104,13 +105,13 @@ struct imc_agent_t { * @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 message to send + * @param attr_list list of PA-TNC attributes to send * @return TNC result code */ TNC_Result (*send_message)(imc_agent_t *this, TNC_ConnectionID connection_id, bool excl, TNC_UInt32 src_imc_id, TNC_UInt32 dst_imv_id, - chunk_t msg); + linked_list_t *attr_list); /** * Call when a PA-TNC message was received |