aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2007-11-19 19:07:49 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2007-11-19 19:07:49 +0000
commit9fb579537e90ca6015e9c3e5493c5757173466cb (patch)
tree1a7d1f8bd9914b72faad046762e3f1636bde1b1e
parent38d450159f5a6767431655605ab3a85b00c9e1ef (diff)
- Prettify "Value" node that contains EAP tree with top-level details
- Lose unuseful header file svn path=/trunk/; revision=23499
-rw-r--r--plugins/wimaxasncp/ChangeLog1
-rw-r--r--plugins/wimaxasncp/Makefile.common1
-rw-r--r--plugins/wimaxasncp/packet-wimaxasncp.c28
-rw-r--r--plugins/wimaxasncp/packet-wimaxasncp.h31
4 files changed, 23 insertions, 38 deletions
diff --git a/plugins/wimaxasncp/ChangeLog b/plugins/wimaxasncp/ChangeLog
index 7b0cc4e3ed..dccc530513 100644
--- a/plugins/wimaxasncp/ChangeLog
+++ b/plugins/wimaxasncp/ChangeLog
@@ -8,6 +8,7 @@
* packet-wimaxasncp.c: fixed memory leak in function
wimaxasncp_dissect_tlv_value()
+
2007-11-04 Zhang Li <lzhang@cienet.com.cn>
* Add EAP support. EAP payload is dessected by calling EAP dissector
diff --git a/plugins/wimaxasncp/Makefile.common b/plugins/wimaxasncp/Makefile.common
index 611474f163..a88806bc2c 100644
--- a/plugins/wimaxasncp/Makefile.common
+++ b/plugins/wimaxasncp/Makefile.common
@@ -33,7 +33,6 @@ DISSECTOR_SRC = \
# corresponding headers
DISSECTOR_INCLUDES = \
wimaxasncp_dict_lex.h \
- packet-wimaxasncp.h \
wimaxasncp_dict.h
# Dissector helpers. They're included in the source files in this
diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c
index 451f171c64..05534de5d8 100644
--- a/plugins/wimaxasncp/packet-wimaxasncp.c
+++ b/plugins/wimaxasncp/packet-wimaxasncp.c
@@ -48,11 +48,10 @@
#include <epan/report_err.h>
#include <epan/eap.h>
-/* TODO: delete?. */
-#include "packet-wimaxasncp.h"
#include "wimaxasncp_dict.h"
-/* Forward declaration we need below */
+/* Forward declarations we need below */
+void proto_register_wimaxasncp(void);
void proto_reg_handoff_wimaxasncp(void);
/* Initialize the protocol and registered fields */
@@ -399,7 +398,7 @@ static const wimaxasncp_dict_tlv_t *wimaxasncp_get_tlv_info(
if (wimaxasncp_dict)
{
wimaxasncp_dict_tlv_t *tlv;
-
+
for (tlv = wimaxasncp_dict->tlvs; tlv; tlv = tlv->next)
{
if (tlv->type == type)
@@ -1496,6 +1495,19 @@ static void wimaxasncp_dissect_tlv_value(
proto_item_set_text(item, "Value");
eap_tree = proto_item_add_subtree(item, ett_wimaxasncp_tlv_eap);
+ /* Also show high-level details in this root item */
+ proto_item_append_text(item, " (%s",
+ val_to_str(eap_code, eap_code_vals,
+ "Unknown code (0x%02X)"));
+ if (eap_code == EAP_REQUEST || eap_code == EAP_RESPONSE)
+ {
+ proto_item_append_text(item, ", %s",
+ val_to_str(eap_type, eap_type_vals,
+ "Unknown type (0x%02X)"));
+ }
+ proto_item_append_text(item, ")");
+
+
/* Extract remaining bytes into new tvb */
eap_tvb = tvb_new_subset(tvb, offset, length,
tvb_length_remaining(tvb, offset));
@@ -3107,20 +3119,24 @@ proto_register_wimaxasncp(void)
if (wimaxasncp_dict)
{
wimaxasncp_dict_tlv_t *tlv;
-
+
+ /* For each TLV found in XML file */
for (tlv = wimaxasncp_dict->tlvs; tlv; tlv = tlv->next)
{
if (tlv->enums)
{
+ /* Create array for enums */
wimaxasncp_dict_enum_t *e;
GArray* array = g_array_new(TRUE, TRUE, sizeof(value_string));
+ /* Copy each entry into value_string array */
for (e = tlv->enums; e; e = e->next)
{
value_string item = { e->code, e->name };
g_array_append_val(array, item);
}
+ /* Set enums to use with this TLV */
tlv->enum_vs = (value_string*)array->data;
}
@@ -3162,7 +3178,7 @@ proto_register_wimaxasncp(void)
if (wimaxasncp_dict)
{
wimaxasncp_dict_tlv_t *tlv;
-
+
for (tlv = wimaxasncp_dict->tlvs; tlv; tlv = tlv->next)
{
printf(
diff --git a/plugins/wimaxasncp/packet-wimaxasncp.h b/plugins/wimaxasncp/packet-wimaxasncp.h
deleted file mode 100644
index bd2be6790c..0000000000
--- a/plugins/wimaxasncp/packet-wimaxasncp.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$
- *
- * Routines for WiMAX ASN Control Plane packet dissection
- * Copyright 2007, Mobile Metrics - http://mobilemetrics.net/
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PACKET_WIMAXASNCP_H__
-#define __PACKET_WIMAXASNCP_H__
-
-void proto_register_wimaxasncp (void);
-void proto_reg_handoff_wimaxasncp(void);
-
-#endif /* __PACKET_WIMAXASNCP_H__ */