aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtnccs/plugins/tnccs_20/tnccs_20.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2013-09-17 11:19:11 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-09-17 11:19:11 +0200
commitddfc58960080f5fe3f447aa5ff8c235f67efad98 (patch)
tree35ca10059eac8ab7542ec65f300fb31f7fc0b845 /src/libtnccs/plugins/tnccs_20/tnccs_20.c
parentab155e6907518a57cd428592852ba37391d1d866 (diff)
downloadstrongswan-ddfc58960080f5fe3f447aa5ff8c235f67efad98.tar.bz2
strongswan-ddfc58960080f5fe3f447aa5ff8c235f67efad98.tar.xz
Allow vendor-specific PB-TNC messages
Diffstat (limited to 'src/libtnccs/plugins/tnccs_20/tnccs_20.c')
-rw-r--r--src/libtnccs/plugins/tnccs_20/tnccs_20.c59
1 files changed, 49 insertions, 10 deletions
diff --git a/src/libtnccs/plugins/tnccs_20/tnccs_20.c b/src/libtnccs/plugins/tnccs_20/tnccs_20.c
index 5d2d7ee25..6759c92a3 100644
--- a/src/libtnccs/plugins/tnccs_20/tnccs_20.c
+++ b/src/libtnccs/plugins/tnccs_20/tnccs_20.c
@@ -17,13 +17,13 @@
#include "tnccs_20.h"
#include "batch/pb_tnc_batch.h"
#include "messages/pb_tnc_msg.h"
-#include "messages/pb_pa_msg.h"
-#include "messages/pb_error_msg.h"
-#include "messages/pb_assessment_result_msg.h"
-#include "messages/pb_access_recommendation_msg.h"
-#include "messages/pb_remediation_parameters_msg.h"
-#include "messages/pb_reason_string_msg.h"
-#include "messages/pb_language_preference_msg.h"
+#include "messages/ietf/pb_pa_msg.h"
+#include "messages/ietf/pb_error_msg.h"
+#include "messages/ietf/pb_assessment_result_msg.h"
+#include "messages/ietf/pb_access_recommendation_msg.h"
+#include "messages/ietf/pb_remediation_parameters_msg.h"
+#include "messages/ietf/pb_reason_string_msg.h"
+#include "messages/ietf/pb_language_preference_msg.h"
#include "state_machine/pb_tnc_state_machine.h"
#include <tncif_names.h>
@@ -225,11 +225,13 @@ METHOD(tnccs_t, send_msg, TNC_Result,
}
/**
- * Handle a single PB-TNC message according to its type
+ * Handle a single PB-TNC IETF standard message according to its type
*/
-static void handle_message(private_tnccs_20_t *this, pb_tnc_msg_t *msg)
+static void handle_ietf_message(private_tnccs_20_t *this, pb_tnc_msg_t *msg)
{
- switch (msg->get_type(msg))
+ pen_type_t msg_type = msg->get_type(msg);
+
+ switch (msg_type.type)
{
case PB_MSG_EXPERIMENTAL:
/* nothing to do */
@@ -441,6 +443,43 @@ static void handle_message(private_tnccs_20_t *this, pb_tnc_msg_t *msg)
}
/**
+ * Handle a single PB-TNC TCG standard message according to its type
+ */
+static void handle_tcg_message(private_tnccs_20_t *this, pb_tnc_msg_t *msg)
+{
+ pen_type_t msg_type = msg->get_type(msg);
+
+ switch (msg_type.type)
+ {
+ case PB_TCG_MSG_PDP_REFERRAL:
+ /* TODO handle PDP Referral */
+ break;
+ default:
+ break;
+ }
+}
+
+/**
+ * Handle a single PB-TNC message according to its type
+ */
+static void handle_message(private_tnccs_20_t *this, pb_tnc_msg_t *msg)
+{
+ pen_type_t msg_type = msg->get_type(msg);
+
+ switch (msg_type.vendor_id)
+ {
+ case PEN_IETF:
+ handle_ietf_message(this, msg);
+ break;
+ case PEN_TCG:
+ handle_tcg_message(this, msg);
+ break;
+ default:
+ break;
+ }
+}
+
+/**
* Build a CRETRY or SRETRY batch
*/
static void build_retry_batch(private_tnccs_20_t *this)