aboutsummaryrefslogtreecommitdiffstats
path: root/packet-xot.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-02-12 09:06:19 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-02-12 09:06:19 +0000
commit0097875951d9a6a879f3bac35d97060504f5f8ae (patch)
tree4df3917ec2fa4eb1450ca9fb0a424253f3a1ece4 /packet-xot.c
parentbc81061c08873ede1b582d6fd0074ab330831e38 (diff)
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names, which lets us get rid of the "ex.25" protocol stuff completely and use "x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up some cases where we appeared to be using the modulo-8 fields when dissecting modulo-128 X.25.) This, in turn, allows us to register the X.25 dissector, as there's now only one protocol with which it's associated, and make it static and have it called only through a handle, and to, when registering it with the "llc.dsap" dissector table, associate it with "proto_x25". That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()" calls, and the code to set "pinfo->current_proto", in the X.25 dissector. The code for the display filter expression dialog would, if there are two fields with the same name registered under a protocol, list both of them; have it list only one of them - the fields should have the same type, the same radix, and the same value_string/true_false_string table if any (if they don't, they're really not the same field...). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3023 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-xot.c')
-rw-r--r--packet-xot.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/packet-xot.c b/packet-xot.c
index 290a381e4c..0289e9dd20 100644
--- a/packet-xot.c
+++ b/packet-xot.c
@@ -3,7 +3,7 @@
*
* Copyright 2000, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-xot.c,v 1.4 2001/01/22 08:03:46 guy Exp $
+ * $Id: packet-xot.c,v 1.5 2001/02/12 09:06:17 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -36,13 +36,14 @@
#include <string.h>
#include <glib.h>
#include "packet.h"
-#include "packet-x25.h"
#define TCP_PORT_XOT 1998
static gint proto_xot = -1;
static gint ett_xot = -1;
+static dissector_handle_t x25_handle;
+
static void dissect_xot(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ti;
@@ -70,7 +71,7 @@ static void dissect_xot(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_text(xot_tree, tvb, 2,2,"XOT length : %u",len) ;
}
next_tvb = tvb_new_subset(tvb,4, -1 , -1);
- dissect_x25(next_tvb,pinfo,tree);
+ call_dissector(x25_handle,next_tvb,pinfo,tree);
}
/* Register the protocol with Ethereal */
@@ -93,5 +94,10 @@ void proto_register_xot(void)
void
proto_reg_handoff_xot(void)
{
+ /*
+ * Get a handle for the X.25 dissector.
+ */
+ x25_handle = find_dissector("x.25");
+
dissector_add("tcp.port", TCP_PORT_XOT, dissect_xot, proto_xot);
}