# a) common to both files and
# b) portable between both files
#
-# $Id: Makefile.common,v 1.34 2004/03/23 19:51:05 guy Exp $
+# $Id: Makefile.common,v 1.35 2004/03/23 21:19:55 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
menu.h \
progress_dlg.h \
proto_hier_stats.h \
- report_err.h \
simple_dialog.h \
statusbar.h \
summary.h \
* Routines to put up various "standard" alert boxes used in multiple
* places
*
- * $Id: alert_box.c,v 1.4 2004/02/21 02:15:05 guy Exp $
+ * $Id: alert_box.c,v 1.5 2004/03/23 21:19:55 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <epan/dfilter/dfilter.h>
#include "alert_box.h"
-#include "report_err.h"
#include "simple_dialog.h"
}
/*
- * Open/create errors are reported with an alert box in Ethereal.
- */
-void
-report_open_failure(const char *filename, int err, gboolean for_writing)
-{
- open_failure_alert_box(filename, err, for_writing);
-}
-
-/*
- * Read errors are reported with an alert box in Ethereal.
+ * Alert box for a failed attempt to read a file.
+ * "err" is assumed to be a UNIX-style errno.
*/
void
-report_read_failure(const char *filename, int err)
+read_failure_alert_box(const char *filename, int err)
{
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"An error occurred while reading from the file \"%s\": %s.",
* Routines to put up various "standard" alert boxes used in multiple
* places
*
- * $Id: alert_box.h,v 1.3 2004/02/11 01:37:11 guy Exp $
+ * $Id: alert_box.h,v 1.4 2004/03/23 21:19:55 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
extern void open_failure_alert_box(const char *filename, int err,
gboolean for_writing);
+/*
+ * Alert box for a failed attempt to read a file.
+ * "err" is assumed to be a UNIX-style errno.
+ */
+extern void read_failure_alert_box(const char *filename, int err);
+
/*
* Alert box for a failed attempt to write to a file.
* "err" is assumed to be a UNIX-style errno.
/* dftest.c.c
*
- * $Id: dftest.c,v 1.9 2004/03/18 19:04:31 obiot Exp $
+ * $Id: dftest.c,v 1.10 2004/03/23 21:19:55 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
packet_info pi;
+static void open_failure_message(const char *filename, int err,
+ gboolean for_writing);
+static void read_failure_message(const char *filename, int err);
+
int
main(int argc, char **argv)
{
by the dissectors, and we must do it before we read the preferences,
in case any dissectors register preferences. */
epan_init(PLUGIN_DIR,register_all_protocols,
- register_all_protocol_handoffs);
+ register_all_protocol_handoffs,
+ open_failure_message, read_failure_message);
/* now register the preferences for any non-dissector modules.
we must do that before we read the preferences as well. */
/*
* Open/create errors are reported with an console message in "dftest".
*/
-void
-report_open_failure(const char *filename, int err, gboolean for_writing)
+static void
+open_failure_message(const char *filename, int err, gboolean for_writing)
{
- char *errmsg;
+ char *errmsg;
- errmsg = g_strdup_printf(file_open_error_message(err, for_writing), filename);
- fprintf(stderr, "dftest: %s\n", errmsg);
- g_free(errmsg);
+ errmsg = g_strdup_printf(file_open_error_message(err, for_writing),
+ filename);
+ fprintf(stderr, "dftest: %s\n", errmsg);
+ g_free(errmsg);
}
/*
* Read errors are reported with an console message in "dftest".
*/
-void
-report_read_failure(const char *filename, int err)
+static void
+read_failure_message(const char *filename, int err)
{
- fprintf(stderr, "dftest: An error occurred while reading from the file \"%s\": %s.",
- filename, strerror(err));
+ fprintf(stderr, "dftest: An error occurred while reading from the file \"%s\": %s.",
+ filename, strerror(err));
}
# Automake file for the EPAN library
# (Ethereal Protocol ANalyzer Library)
#
-# $Id: Makefile.am,v 1.43 2004/03/22 21:29:52 gerald Exp $
+# $Id: Makefile.am,v 1.44 2004/03/23 21:19:56 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
column-utils.h \
epan.c \
epan.h \
- epan_dissect.h \
+ epan_dissect.h \
except.c \
except.h \
exceptions.h \
proto.h \
resolv.c \
resolv.h \
+ report_err.h \
slab.h \
sna-utils.c \
sna-utils.h \
/* epan.h
*
- * $Id: epan.c,v 1.23 2003/05/04 18:50:53 gerald Exp $
+ * $Id: epan.c,v 1.24 2004/03/23 21:19:56 guy Exp $
*
* Ethereal Protocol Analyzer Library
*/
#include <glib.h>
#include "epan.h"
#include "epan_dissect.h"
+#include "report_err.h"
#include "conversation.h"
#include "circuit.h"
#include "../tap.h"
#include "resolv.h"
+static void (*report_open_failure_func)(const char *, int, gboolean);
+static void (*report_read_failure_func)(const char *, int);
+
/*
* XXX - this takes the plugin directory as an argument, because
* libethereal now has its own configure script and "config.h" file,
* libraries are located.)
*/
void
-epan_init(const char *plugin_dir, void (register_all_protocols)(void),
- void (register_all_handoffs)(void))
+epan_init(const char *plugin_dir, void (*register_all_protocols)(void),
+ void (*register_all_handoffs)(void),
+ void (*report_open_failure)(const char *, int, gboolean),
+ void (*report_read_failure)(const char *, int))
{
+ report_open_failure_func = report_open_failure;
+ report_read_failure_func = report_read_failure;
except_init();
tvbuff_init();
frame_data_init();
circuit_init();
}
+/*
+ * Report an error when trying to open a file.
+ */
+void
+report_open_failure(const char *filename, int err,
+ gboolean for_writing)
+{
+ (*report_open_failure_func)(filename, err, for_writing);
+}
+
+/*
+ * Report an error when trying to read a file.
+ */
+void
+report_read_failure(const char *filename, int err)
+{
+ (*report_read_failure_func)(filename, err);
+}
+
epan_dissect_t*
epan_dissect_new(gboolean create_proto_tree, gboolean proto_tree_visible)
{
/* epan.h
*
- * $Id: epan.h,v 1.15 2002/10/22 08:44:33 guy Exp $
+ * $Id: epan.h,v 1.16 2004/03/23 21:19:56 guy Exp $
*
* Ethereal Protocol Analyzer Library
*
#include "dfilter/dfilter.h"
-void epan_init(const char * plugindir, void (register_all_protocols)(void),
- void (register_all_handoffs)(void));
+void epan_init(const char * plugindir, void (*register_all_protocols)(void),
+ void (*register_all_handoffs)(void),
+ void (*report_open_failure)(const char *, int, gboolean),
+ void (*report_read_failure)(const char *, int));
void epan_cleanup(void);
void epan_conversation_init(void);
void epan_circuit_init(void);
* Declarations of routines for dissectors to use to report errors to
* the user (e.g., problems with preference settings)
*
- * $Id: report_err.h,v 1.1 2004/02/21 02:15:06 guy Exp $
+ * $Id: report_err.h,v 1.1 2004/03/23 21:19:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/* main.c
*
- * $Id: main.c,v 1.419 2004/03/20 06:34:08 guy Exp $
+ * $Id: main.c,v 1.420 2004/03/23 21:19:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
"-G" flag, as the "-G" flag dumps information registered by the
dissectors, and we must do it before we read the preferences, in
case any dissectors register preferences. */
- epan_init(PLUGIN_DIR,register_all_protocols,register_all_protocol_handoffs);
+ epan_init(PLUGIN_DIR,register_all_protocols,register_all_protocol_handoffs,
+ open_failure_alert_box, read_failure_alert_box);
/* Register all tap listeners; we do this before we parse the arguments,
as the "-z" argument can specify a registered tap. */
/* packet-diameter.c
* Routines for Diameter packet disassembly
*
- * $Id: packet-diameter.c,v 1.64 2004/03/21 23:19:36 guy Exp $
+ * $Id: packet-diameter.c,v 1.65 2004/03/23 21:19:55 guy Exp $
*
* Copyright (c) 2001 by David Frascone <dave@frascone.com>
*
#include "xmlstub.h"
#include <epan/packet.h>
#include <epan/resolv.h>
-#include "report_err.h"
+#include <epan/report_err.h>
#include "prefs.h"
#include "packet-tcp.h"
*
* Copyright (c) 2003 by Matthijs Melchior <matthijs.melchior@xs4all.nl>
*
- * $Id: packet-asn1.c,v 1.21 2004/03/02 23:45:34 jmayer Exp $
+ * $Id: packet-asn1.c,v 1.22 2004/03/23 21:19:58 guy Exp $
*
* A plugin for:
*
#include "prefs.h"
#include <epan/strutil.h>
#include <epan/filesystem.h>
+#include <epan/report_err.h>
#include "asn1.h"
-#include "report_err.h"
#include "simple_dialog.h"
#include "plugins/plugin_api_defs.h"
/* plugin_api.h
* Routines for Ethereal plugins.
*
- * $Id: plugin_api.h,v 1.60 2004/03/04 07:07:03 guy Exp $
+ * $Id: plugin_api.h,v 1.61 2004/03/23 21:19:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
#include <epan/packet.h>
#include <epan/conversation.h>
+#include <epan/report_err.h>
#include "prefs.h"
#include "reassemble.h"
#include "packet-giop.h"
#include "xdlc.h"
#include "epan/except.h"
#include "epan/filesystem.h"
-#include "report_err.h"
#include "plugin_table.h"
/* plugin_api_list.c
* Used to generate various included files for plugin API
*
- * $Id: plugin_api_list.c,v 1.30 2004/03/04 07:07:03 guy Exp $
+ * $Id: plugin_api_list.c,v 1.31 2004/03/23 21:19:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <epan/packet.h>
#include <epan/conversation.h>
#include <epan/filesystem.h>
+#include <epan/report_err.h>
+#include <epan/except.h>
#include "prefs.h"
#include "reassemble.h"
#include "packet-giop.h"
#include "tap.h"
#include "asn1.h"
#include "xdlc.h"
-#include "epan/except.h"
-#include "report_err.h"
gint check_col(column_info*, gint);
void col_clear(column_info*, gint);
/* tethereal.c
*
- * $Id: tethereal.c,v 1.232 2004/03/18 19:04:31 obiot Exp $
+ * $Id: tethereal.c,v 1.233 2004/03/23 21:19:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include "ringbuffer.h"
#include <epan/epan_dissect.h>
#include "tap.h"
-#include "report_err.h"
#include <epan/timestamp.h>
#ifdef HAVE_LIBPCAP
#endif /* _WIN32 */
#endif
+static void open_failure_message(const char *filename, int err,
+ gboolean for_writing);
+static void read_failure_message(const char *filename, int err);
+
capture_file cfile;
#ifdef HAVE_LIBPCAP
typedef struct {
"-G" flag, as the "-G" flag dumps information registered by the
dissectors, and we must do it before we read the preferences, in
case any dissectors register preferences. */
- epan_init(PLUGIN_DIR,register_all_protocols,register_all_protocol_handoffs);
+ epan_init(PLUGIN_DIR,register_all_protocols,register_all_protocol_handoffs,
+ open_failure_message, read_failure_message);
/* Register all tap listeners; we do this before we parse the arguments,
as the "-z" argument can specify a registered tap. */
/*
* Open/create errors are reported with an console message in Tethereal.
*/
-void
-report_open_failure(const char *filename, int err, gboolean for_writing)
+static void
+open_failure_message(const char *filename, int err, gboolean for_writing)
{
char *errmsg;
/*
* Read errors are reported with an console message in Tethereal.
*/
-void
-report_read_failure(const char *filename, int err)
+static void
+read_failure_message(const char *filename, int err)
{
fprintf(stderr, "tethereal: An error occurred while reading from the file \"%s\": %s.",
filename, strerror(err));