summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Abad <oabad@noos.fr>2000-02-18 13:41:26 +0000
committerOlivier Abad <oabad@noos.fr>2000-02-18 13:41:26 +0000
commitbb2454e8bd4fc8f4f479a46898bff3c47f3af5bd (patch)
tree5a1805fc0370fc404120d3acba0e50327307ffaa
parent5aa0493bb3dc3ae9ba18ef79bdf388d26fcde873 (diff)
downloadwireshark-bb2454e8bd4fc8f4f479a46898bff3c47f3af5bd.tar.gz
Renamed init_dissect_x25() to reinit_x25_hashtable() and actually used it !
This function is used to re-initialize the hash table used by the X.25 dissector to record the upper layer protocol used by each VC. The hash table should be re-initialized each time we read / start a new capture. I moved the definition of the function from packet.h to packet-x25.h, and added calls to reinit_x25_hashtable() in read_cap_file (file.c) and do_capture (capture.c). svn path=/trunk/; revision=1644
-rw-r--r--capture.c7
-rw-r--r--file.c7
-rw-r--r--packet-x25.c4
-rw-r--r--packet-x25.h3
-rw-r--r--packet.h3
5 files changed, 17 insertions, 7 deletions
diff --git a/capture.c b/capture.c
index 043f858955..6ae1fb67ad 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.96 2000/02/15 21:01:53 gram Exp $
+ * $Id: capture.c,v 1.97 2000/02/18 13:41:23 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -102,6 +102,7 @@
#include "packet-ppp.h"
#include "packet-raw.h"
#include "packet-tr.h"
+#include "packet-x25.h"
int sync_mode; /* fork a child to do the capture, and sync between them */
static int sync_pipe[2]; /* used to sync father */
@@ -164,6 +165,10 @@ do_capture(char *capfile_name)
g_assert(cf.save_file == NULL);
cf.save_file = capfile_name;
+ /* The hash table used by the X.25 dissector must be re-initialized
+ * before starting a new capture */
+ reinit_x25_hashtable();
+
if (sync_mode) { /* use fork() for capture */
#ifndef _WIN32
int fork_child;
diff --git a/file.c b/file.c
index e8517aa58d..61ded2cb9d 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.163 2000/02/14 04:57:30 guy Exp $
+ * $Id: file.c,v 1.164 2000/02/18 13:41:24 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -81,6 +81,7 @@
#include "dfilter.h"
#include "conversation.h"
#include "globals.h"
+#include "packet-x25.h"
#include "plugins.h"
@@ -297,6 +298,10 @@ read_cap_file(capture_file *cf)
#define O_BINARY 0
#endif
+ /* The hash table used by the X.25 dissector must be re-initialized
+ * before starting a new capture */
+ reinit_x25_hashtable();
+
freeze_clist(cf);
proto_tree_is_visible = FALSE;
success = wtap_loop(cf->wth, 0, wtap_dispatch_cb, (u_char *) cf, &err);
diff --git a/packet-x25.c b/packet-x25.c
index e8e44287b1..23141ec8ba 100644
--- a/packet-x25.c
+++ b/packet-x25.c
@@ -2,7 +2,7 @@
* Routines for x25 packet disassembly
* Olivier Abad <abad@daba.dhis.net>
*
- * $Id: packet-x25.c,v 1.18 2000/02/15 21:03:29 gram Exp $
+ * $Id: packet-x25.c,v 1.19 2000/02/18 13:41:25 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -201,7 +201,7 @@ free_vc_info(vc_info *pt)
}
void
-init_dissect_x25()
+reinit_x25_hashtable()
{
int i;
diff --git a/packet-x25.h b/packet-x25.h
index 064aa3fa52..49690d5edf 100644
--- a/packet-x25.h
+++ b/packet-x25.h
@@ -1,6 +1,6 @@
/* packet-x25.h
*
- * $Id: packet-x25.h,v 1.1 2000/02/15 21:03:32 gram Exp $
+ * $Id: packet-x25.h,v 1.2 2000/02/18 13:41:26 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -24,3 +24,4 @@
void dissect_x25(const u_char *, int, frame_data *, proto_tree *);
+extern void reinit_x25_hashtable();
diff --git a/packet.h b/packet.h
index 1676c17f7e..9e7e91cec6 100644
--- a/packet.h
+++ b/packet.h
@@ -1,7 +1,7 @@
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.172 2000/02/15 21:03:35 gram Exp $
+ * $Id: packet.h,v 1.173 2000/02/18 13:41:26 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -268,7 +268,6 @@ void init_all_protocols(void);
void init_dissect_rpc(void);
void init_dissect_udp(void);
-void init_dissect_x25(void);
typedef void (*DissectFunc) (const u_char*, int, frame_data*, proto_tree*);