summaryrefslogtreecommitdiff
path: root/tethereal.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-04 07:03:07 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-04 07:03:07 +0000
commitc2b1feea055c65f002bd86d4f4dba6b48453e942 (patch)
tree182de17caf9f6b68d2197d3aaa68ce1e8c8fc20e /tethereal.c
parent5f0fc518c79f381ea86ee3746ef32e96eb606985 (diff)
downloadwireshark-c2b1feea055c65f002bd86d4f4dba6b48453e942.tar.gz
Turn "ethereal_proto_init()" and "ethereal_proto_cleanup()" into
"dissect_init()" and "dissect_cleanup()", in "packet.c", so that we don't duplicate those routines in Ethereal and Tethereal (and so on), and don't have to remember to update N different versions of them if we have to change the way we do one-time initialization and cleanup. svn path=/trunk/; revision=1790
Diffstat (limited to 'tethereal.c')
-rw-r--r--tethereal.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/tethereal.c b/tethereal.c
index ad145097bd..115e14b94b 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -1,6 +1,6 @@
/* tethereal.c
*
- * $Id: tethereal.c,v 1.23 2000/04/04 06:46:29 guy Exp $
+ * $Id: tethereal.c,v 1.24 2000/04/04 07:02:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -122,22 +122,6 @@ FILE *data_out_file = NULL;
guint main_ctx, file_ctx;
ts_type timestamp_type = RELATIVE;
-/* call initialization routines at program startup time */
-static void
-ethereal_proto_init(void) {
- proto_init();
- dfilter_init();
-#ifdef HAVE_PLUGINS
- init_plugins();
-#endif
-}
-
-static void
-ethereal_proto_cleanup(void) {
- proto_cleanup();
- dfilter_cleanup();
-}
-
static void
print_usage(void)
{
@@ -198,7 +182,7 @@ main(int argc, char *argv[])
We do this here to mirror what happens in the GTK+ version, although
it's not necessary here. */
if (argc >= 2 && strcmp(argv[1], "-G") == 0) {
- ethereal_proto_init();
+ dissect_init();
proto_registrar_dump();
exit(0);
}
@@ -420,12 +404,12 @@ main(int argc, char *argv[])
else if (cf.snap < MIN_PACKET_SIZE)
cf.snap = MIN_PACKET_SIZE;
- ethereal_proto_init(); /* Init anything that needs initializing */
+ dissect_init(); /* Init anything that needs initializing */
if (rfilter != NULL) {
if (dfilter_compile(rfilter, &rfcode) != 0) {
fprintf(stderr, "tethereal: %s\n", dfilter_error_msg);
- ethereal_proto_cleanup();
+ dissect_cleanup();
exit(2);
}
}
@@ -433,12 +417,12 @@ main(int argc, char *argv[])
if (cf_name) {
err = open_cap_file(cf_name, FALSE, &cf);
if (err != 0) {
- ethereal_proto_cleanup();
+ dissect_cleanup();
exit(2);
}
err = load_cap_file(&cf, out_file_type);
if (err != 0) {
- ethereal_proto_cleanup();
+ dissect_cleanup();
exit(2);
}
cf_name[0] = '\0';
@@ -475,7 +459,7 @@ main(int argc, char *argv[])
#endif
}
- ethereal_proto_cleanup();
+ dissect_cleanup();
exit(0);
}