Used register_init_routine() to register "reinit_x25_hashtable()" as a

routine to be called every time a new capture file is opened instead of
calling it in read_cap_file() and do_capture().

svn path=/trunk/; revision=1651
This commit is contained in:
Olivier Abad 2000-02-19 14:00:35 +00:00
parent cc56d8283a
commit 44a7c1ec31
3 changed files with 4 additions and 13 deletions

View File

@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
* $Id: capture.c,v 1.97 2000/02/18 13:41:23 oabad Exp $
* $Id: capture.c,v 1.98 2000/02/19 14:00:33 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -102,7 +102,6 @@
#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 */
@ -165,10 +164,6 @@ 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;

7
file.c
View File

@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
* $Id: file.c,v 1.165 2000/02/19 07:59:53 guy Exp $
* $Id: file.c,v 1.166 2000/02/19 14:00:34 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -81,7 +81,6 @@
#include "dfilter.h"
#include "conversation.h"
#include "globals.h"
#include "packet-x25.h"
#include "plugins.h"
@ -298,10 +297,6 @@ 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);

View File

@ -2,7 +2,7 @@
* Routines for x25 packet disassembly
* Olivier Abad <abad@daba.dhis.net>
*
* $Id: packet-x25.c,v 1.19 2000/02/18 13:41:25 oabad Exp $
* $Id: packet-x25.c,v 1.20 2000/02/19 14:00:35 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -1976,4 +1976,5 @@ proto_register_x25(void)
proto_register_field_array (proto_x25, hf8, array_length(hf8));
proto_register_field_array (proto_ex25, hf128, array_length(hf128));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine(&reinit_x25_hashtable);
}