aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--packet-eap.c6
-rw-r--r--packet-radius.c32
3 files changed, 29 insertions, 10 deletions
diff --git a/AUTHORS b/AUTHORS
index 5d01995aee..747578e095 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1049,6 +1049,7 @@ Adam Sulmicki <adam[AT]cfar.umd.edu> {
Fix off-by-one bug when displaying Code of EAP message.
Additional AVPs for RADIUS, and making RD_TP_CONNECT_INFO a
RADIUS_STRING rather than a RADIUS_STRING_TAGGED
+ Dissect EAP messages inside RADIUS
}
Kari Tiirikainen <ktiirika[AT]stybba.ntc.nokia.com> {
diff --git a/packet-eap.c b/packet-eap.c
index 6796e49a1e..dc7a64aa41 100644
--- a/packet-eap.c
+++ b/packet-eap.c
@@ -2,7 +2,7 @@
* Routines for EAP Extensible Authentication Protocol header disassembly,
* RFC 2284
*
- * $Id: packet-eap.c,v 1.8 2002/02/22 09:52:00 guy Exp $
+ * $Id: packet-eap.c,v 1.9 2002/02/22 21:31:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -152,6 +152,8 @@ proto_register_eap(void)
"EAP", "eap");
proto_register_field_array(proto_eap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ register_dissector("eap", dissect_eap, proto_eap);
}
void
@@ -159,6 +161,6 @@ proto_reg_handoff_eap(void)
{
dissector_handle_t eap_handle;
- eap_handle = create_dissector_handle(dissect_eap, proto_eap);
+ eap_handle = find_dissector("eap");
dissector_add("ppp.protocol", PPP_EAP, eap_handle);
}
diff --git a/packet-radius.c b/packet-radius.c
index 6ecdd612a2..40ad5de276 100644
--- a/packet-radius.c
+++ b/packet-radius.c
@@ -2,7 +2,7 @@
* Routines for RADIUS packet disassembly
* Copyright 1999 Johan Feyaerts
*
- * $Id: packet-radius.c,v 1.42 2002/02/22 09:57:04 guy Exp $
+ * $Id: packet-radius.c,v 1.43 2002/02/22 21:31:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -52,6 +52,8 @@ static int hf_radius_id =-1;
static gint ett_radius = -1;
static gint ett_radius_avp = -1;
+static dissector_handle_t eap_handle;
+
#define UDP_PORT_RADIUS 1645
#define UDP_PORT_RADIUS_NEW 1812
#define UDP_PORT_RADACCT 1646
@@ -870,9 +872,8 @@ gchar *rd_value_to_str(e_avphdr *avph, tvbuff_t *tvb, int offset)
}
-void dissect_attribute_value_pairs(tvbuff_t *tvb, int offset, proto_tree *tree,
- int avplength)
-{
+void dissect_attribute_value_pairs(tvbuff_t *tvb, int offset,proto_tree *tree,
+ int avplength,packet_info *pinfo) {
/* adds the attribute value pairs to the tree */
e_avphdr avph;
gchar *avptpstrval;
@@ -899,10 +900,20 @@ void dissect_attribute_value_pairs(tvbuff_t *tvb, int offset, proto_tree *tree,
avptpstrval,avph.avp_type,avph.avp_length);
break;
}
+
valstr=rd_value_to_str(&avph, tvb, offset);
- proto_tree_add_text(tree, tvb,offset,avph.avp_length,
- "t:%s(%u) l:%u, %s",
- avptpstrval,avph.avp_type,avph.avp_length,valstr);
+
+ if (avph.avp_type == RD_TP_EAP_MESSAGE) {
+ tvbuff_t *next_tvb;
+ proto_tree_add_text(tree, tvb,offset,2,"t:%s(%u) l:%u",
+ avptpstrval,avph.avp_type,avph.avp_length);
+ next_tvb = tvb_new_subset(tvb, offset+2,avph.avp_length, -1);
+ call_dissector(eap_handle, next_tvb, pinfo, tree);
+ } else
+ proto_tree_add_text(tree, tvb,offset,avph.avp_length,
+ "t:%s(%u) l:%u, %s",
+ avptpstrval,avph.avp_type,avph.avp_length,valstr);
+
offset=offset+avph.avp_length;
avplength=avplength-avph.avp_length;
}
@@ -973,7 +984,7 @@ static void dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (avptree !=NULL)
{
dissect_attribute_value_pairs(tvb, hdrlength,
- avptree,avplength);
+ avptree,avplength,pinfo);
}
}
}
@@ -1011,6 +1022,11 @@ proto_reg_handoff_radius(void)
{
dissector_handle_t radius_handle;
+ /*
+ * Get a handle for the EAP dissector.
+ */
+ eap_handle = find_dissector("eap");
+
radius_handle = create_dissector_handle(dissect_radius, proto_radius);
dissector_add("udp.port", UDP_PORT_RADIUS, radius_handle);
dissector_add("udp.port", UDP_PORT_RADIUS_NEW, radius_handle);