aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-02-07 20:52:59 +0000
committerGuy Harris <guy@alum.mit.edu>2005-02-07 20:52:59 +0000
commit802a3977bfa68030d968427c8c2ad02e1da81fe8 (patch)
treefb1730b11f4106c1681f279e8ed081796f4de7d6
parentd2cf31dc22989c0d7180a41b42a5bf51e3279fea (diff)
Make Ethereal and Tethereal compile if we're building without libpcap.
svn path=/trunk/; revision=13346
-rw-r--r--file.h2
-rw-r--r--gtk/font_utils.c6
-rw-r--r--gtk/main.c6
-rw-r--r--gtk/ui_util.c4
-rw-r--r--tethereal.c5
5 files changed, 19 insertions, 4 deletions
diff --git a/file.h b/file.h
index 032ecfc9ab..4c95a51be3 100644
--- a/file.h
+++ b/file.h
@@ -59,8 +59,10 @@ typedef enum {
cf_cb_file_closed,
cf_cb_file_read_start,
cf_cb_file_read_finished,
+#ifdef HAVE_LIBPCAP
cf_cb_live_capture_started,
cf_cb_live_capture_finished,
+#endif
cf_cb_packet_selected,
cf_cb_packet_unselected,
cf_cb_field_unselected,
diff --git a/gtk/font_utils.c b/gtk/font_utils.c
index f3ef5998b8..917eee2c84 100644
--- a/gtk/font_utils.c
+++ b/gtk/font_utils.c
@@ -710,7 +710,11 @@ static void try_to_get_windows_font_gtk2(void)
#endif /* _WIN32 */
-void font_init(gboolean capture_child)
+void font_init(gboolean capture_child
+#ifndef HAVE_LIBPCAP
+ _U_
+#endif
+)
{
#if GTK_MAJOR_VERSION < 2
gchar *bold_font_name;
diff --git a/gtk/main.c b/gtk/main.c
index b448f53c1f..b3d8617e9c 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1347,6 +1347,7 @@ main_cf_cb_file_read_finished(capture_file *cf)
main_set_for_capture_file(TRUE);
}
+#ifdef HAVE_LIBPCAP
static void
main_cf_cb_live_capture_started(capture_options *capture_opts)
{
@@ -1395,6 +1396,7 @@ main_cf_cb_live_capture_finished(capture_file *cf)
/* Set up main window for a capture file. */
main_set_for_capture_file(TRUE);
}
+#endif
static void
main_cf_cb_packet_selected(gpointer data)
@@ -1474,12 +1476,14 @@ void main_cf_callback(gint event, gpointer data, gpointer user_data _U_)
case(cf_cb_file_read_finished):
main_cf_cb_file_read_finished(data);
break;
+#ifdef HAVE_LIBPCAP
case(cf_cb_live_capture_started):
main_cf_cb_live_capture_started(data);
break;
case(cf_cb_live_capture_finished):
main_cf_cb_live_capture_finished(data);
break;
+#endif
case(cf_cb_packet_selected):
main_cf_cb_packet_selected(data);
break;
@@ -2792,11 +2796,13 @@ welcome_new(void)
gtk_box_pack_start(GTK_BOX(welcome_vb), w, FALSE, FALSE, 10);
gtk_misc_set_alignment (GTK_MISC(w), 0.0, 0.0);
+#ifdef HAVE_LIBPCAP
item_hb = welcome_item(ETHEREAL_STOCK_CAPTURE_START,
"Capture",
"Capture live data from your network",
GTK_SIGNAL_FUNC(capture_prep_cb), NULL);
gtk_box_pack_start(GTK_BOX(welcome_vb), item_hb, TRUE, FALSE, 5);
+#endif
item_hb = welcome_item(GTK_STOCK_OPEN,
"Open",
diff --git a/gtk/ui_util.c b/gtk/ui_util.c
index 0bb9d3513a..1c9d7685f5 100644
--- a/gtk/ui_util.c
+++ b/gtk/ui_util.c
@@ -580,14 +580,14 @@ set_main_window_name(gchar *window_name)
}
-#ifdef HAVE_LIBPCAP
-
/* update the main window */
void main_window_update(void)
{
while (gtk_events_pending()) gtk_main_iteration();
}
+#ifdef HAVE_LIBPCAP
+
/* exit the main window */
void main_window_exit(void)
{
diff --git a/tethereal.c b/tethereal.c
index 133dbb1e3a..e03831d419 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -858,9 +858,10 @@ main(int argc, char *argv[])
char badopt;
ethereal_tap_list *tli;
-
+#ifdef HAVE_LIBPCAP
/* XXX - better use capture_opts_init instead */
capture_opts.cfilter = g_strdup("");
+#endif
set_timestamp_setting(TS_RELATIVE);
@@ -2772,6 +2773,7 @@ print_columns(capture_file *cf)
for (i = 0; i < cf->cinfo.num_cols; i++) {
switch (cf->cinfo.col_fmt[i]) {
case COL_NUMBER:
+#ifdef HAVE_LIBPCAP
/*
* Don't print this if we're doing a live capture from a network
* interface - if we're doing a live capture, you won't be
@@ -2785,6 +2787,7 @@ print_columns(capture_file *cf)
*/
if (capture_opts.iface != NULL)
continue;
+#endif
column_len = strlen(cf->cinfo.col_data[i]);
if (column_len < 3)
column_len = 3;