aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/tnccs_20/tnccs_20.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2011-06-24 17:31:47 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2011-06-24 17:31:47 +0200
commitb324976aa1b0523ae00ac6021eddf70fce4f5277 (patch)
treecef4acd5b96d424e65bb56cbc960faec3ce96579 /src/libcharon/plugins/tnccs_20/tnccs_20.c
parent535f5d8a107c9096a2b077e2b4e7c33a535a648a (diff)
downloadstrongswan-b324976aa1b0523ae00ac6021eddf70fce4f5277.tar.bz2
strongswan-b324976aa1b0523ae00ac6021eddf70fce4f5277.tar.xz
output all known PA-TNC subtype names
Diffstat (limited to 'src/libcharon/plugins/tnccs_20/tnccs_20.c')
-rw-r--r--src/libcharon/plugins/tnccs_20/tnccs_20.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libcharon/plugins/tnccs_20/tnccs_20.c b/src/libcharon/plugins/tnccs_20/tnccs_20.c
index e74485890..db1a4ba2b 100644
--- a/src/libcharon/plugins/tnccs_20/tnccs_20.c
+++ b/src/libcharon/plugins/tnccs_20/tnccs_20.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 Sansar Choinyanbuu
- * Copyright (C) 2010 Andreas Steffen
+ * Copyright (C) 2010-2011 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
#include "state_machine/pb_tnc_state_machine.h"
#include <tncif_names.h>
+#include <tncif_pa_subtypes.h>
#include <debug.h>
#include <daemon.h>
@@ -102,6 +103,7 @@ METHOD(tnccs_t, send_msg, TNC_Result,
TNC_VendorID msg_vendor_id;
pb_tnc_msg_t *pb_tnc_msg;
pb_tnc_batch_type_t batch_type;
+ enum_name_t *pa_subtype_names;
if (!this->send_msg)
{
@@ -117,10 +119,11 @@ METHOD(tnccs_t, send_msg, TNC_Result,
pb_tnc_msg = pb_pa_msg_create(msg_vendor_id, msg_sub_type, imc_id, imv_id,
chunk_create(msg, msg_len));
- if (msg_vendor_id == PEN_IETF)
+ pa_subtype_names = get_pa_subtype_names(msg_vendor_id);
+ if (pa_subtype_names)
{
DBG2(DBG_TNC, "creating PB-PA message type '%N/%N' 0x%06x/0x%02x",
- pen_names, msg_vendor_id, pa_tnc_subtype_names, msg_sub_type,
+ pen_names, msg_vendor_id, pa_subtype_names, msg_sub_type,
msg_vendor_id, msg_sub_type);
}
else
@@ -164,16 +167,18 @@ static void handle_message(private_tnccs_20_t *this, pb_tnc_msg_t *msg)
TNC_MessageType msg_type;
u_int32_t vendor_id, subtype;
chunk_t msg_body;
+ enum_name_t *pa_subtype_names;
pa_msg = (pb_pa_msg_t*)msg;
vendor_id = pa_msg->get_vendor_id(pa_msg, &subtype);
msg_type = (vendor_id << 8) | (subtype & 0xff);
msg_body = pa_msg->get_body(pa_msg);
- if (vendor_id == PEN_IETF)
+ pa_subtype_names = get_pa_subtype_names(vendor_id);
+ if (pa_subtype_names)
{
DBG2(DBG_TNC, "handling PB-PA message type '%N/%N' 0x%06x/0x%02x",
- pen_names, vendor_id, pa_tnc_subtype_names, subtype,
+ pen_names, vendor_id, pa_subtype_names, subtype,
vendor_id, subtype);
}
else