aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEd Warnicke <hagbard@physics.rutgers.edu>2001-04-01 22:01:34 +0000
committerEd Warnicke <hagbard@physics.rutgers.edu>2001-04-01 22:01:34 +0000
commit10cd0c5f704823cd6dd901d3438ebcc01f00e44e (patch)
tree0ae30fc13772568f8d93f815b30d6d6526958a9b /epan
parent62e9875d34c9a5242806db8fe3729c3bcc26906e (diff)
Changed packet_init() to look up the frame dissector and cache its
dissector_handle in a static variable in packet.c. Changed dissect_packet to call dissector from using the call_dissector() function and the cached dissector_handle for frame_dissector. Changed the order of function calls in epan_init() to allow for this change ( it sucks to look up a dissector when none are registered ). svn path=/trunk/; revision=3234
Diffstat (limited to 'epan')
-rw-r--r--epan/epan.c4
-rw-r--r--epan/packet.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/epan/epan.c b/epan/epan.c
index 75ae31a463..a779cb876b 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -1,6 +1,6 @@
/* epan.h
*
- * $Id: epan.c,v 1.8 2001/04/01 04:11:50 hagbard Exp $
+ * $Id: epan.c,v 1.9 2001/04/01 22:01:34 hagbard Exp $
*
* Ethereal Protocol Analyzer Library
*
@@ -46,9 +46,9 @@ epan_init(const char *plugin_dir)
{
except_init();
tvbuff_init();
- packet_init();
frame_data_init();
proto_init(plugin_dir);
+ packet_init();
dfilter_init();
}
diff --git a/epan/packet.c b/epan/packet.c
index d1e7e5bded..4176ec6ea8 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.31 2001/04/01 07:32:35 hagbard Exp $
+ * $Id: packet.c,v 1.32 2001/04/01 22:01:34 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -82,10 +82,12 @@
#include "tvbuff.h"
#include "plugins.h"
+static dissector_handle_t frame_handle = NULL;
+
void
packet_init(void)
{
- /* nothing */
+ frame_handle = find_dissector("frame");
}
void
@@ -155,7 +157,8 @@ dissect_packet(tvbuff_t **p_tvb, union wtap_pseudo_header *pseudo_header,
}
ENDTRY;
- dissect_frame(*p_tvb, &pi, tree);
+ if(frame_handle != NULL)
+ call_dissector(frame_handle, *p_tvb, &pi, tree);
fd->flags.visited = 1;
}