aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-01-10 09:51:23 +0000
committerGuy Harris <guy@alum.mit.edu>2002-01-10 09:51:23 +0000
commitd663cdb4a1a478d23bd92e8143ddd84df61bd553 (patch)
tree8ee8de2f446223c3ee791f2cef48b8b19791d0ae
parent60c8a87e441e916229fc2c1d5bdd7b5cef19bc96 (diff)
Fix some problems with building Ethereal/Tethereal without libpcap.
Get rid of a #include I'd #if 0'ed out. svn path=/trunk/; revision=4513
-rw-r--r--gtk/capture_prefs.c33
-rw-r--r--gtk/main.c10
-rw-r--r--tethereal.c8
3 files changed, 42 insertions, 9 deletions
diff --git a/gtk/capture_prefs.c b/gtk/capture_prefs.c
index 0039d2900e..c93d7fef6d 100644
--- a/gtk/capture_prefs.c
+++ b/gtk/capture_prefs.c
@@ -1,7 +1,7 @@
/* capture_prefs.c
* Dialog box for capture preferences
*
- * $Id: capture_prefs.c,v 1.1 2002/01/10 07:43:39 guy Exp $
+ * $Id: capture_prefs.c,v 1.2 2002/01/10 09:51:23 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -26,13 +26,13 @@
#include "config.h"
#endif
-#ifdef HAVE_LIBPCAP
-
#include <string.h>
#include <errno.h>
#include <gtk/gtk.h>
+#ifdef HAVE_LIBPCAP
#include <pcap.h>
+#endif
#include "globals.h"
#include "capture_prefs.h"
@@ -41,13 +41,11 @@
#include "prefs.h"
#include "prefs-int.h"
#include "ui_util.h"
-#include "dlg_utils.h"
#include "pcap-util.h"
-#if 0
-#include "proto_draw.h"
-#endif
#include "main.h"
+#ifdef HAVE_LIBPCAP
+
static void create_option_check_button(GtkWidget *main_vb, const gchar *key,
GtkWidget *main_tb, int table_position, const gchar *label_text,
gboolean active);
@@ -179,4 +177,25 @@ capture_prefs_destroy(GtkWidget *w)
{
}
+#else /* HAVE_LIBPCAP */
+
+/*
+ * Stub routines.
+ */
+
+void
+capture_prefs_apply(GtkWidget *w)
+{
+}
+
+void
+capture_prefs_destroy(GtkWidget *w)
+{
+}
+
+void
+capture_prefs_fetch(GtkWidget *w)
+{
+}
+
#endif /* HAVE_LIBPCAP */
diff --git a/gtk/main.c b/gtk/main.c
index 7be6344f3e..ca945e0ec9 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1,6 +1,6 @@
/* main.c
*
- * $Id: main.c,v 1.223 2002/01/08 09:32:15 guy Exp $
+ * $Id: main.c,v 1.224 2002/01/10 09:51:23 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -752,8 +752,10 @@ do_quit(void)
the capture and discard it, and return TRUE, before nuking
any child capture, if they say they don't want to do so. */
+#ifdef HAVE_LIBPCAP
/* Nuke any child capture in progress. */
kill_capture_child();
+#endif
/* Are we in the middle of reading a capture? */
if (cfile.state == FILE_READ_IN_PROGRESS) {
@@ -888,6 +890,7 @@ get_positive_int(const char *string, const char *name)
return number;
}
+#ifdef HAVE_LIBPCAP
/*
* Given a string of the form "<autostop criterion>:<value>", as might appear
* as an argument to a "-a" option, parse it and set the criterion in
@@ -932,6 +935,7 @@ set_autostop_criterion(const char *autostoparg)
*colonp = ':'; /* put the colon back */
return TRUE;
}
+#endif
/* And now our feature presentation... [ fade to music ] */
int
@@ -1403,6 +1407,7 @@ main(int argc, char *argv[])
arg_error = TRUE;
}
+#ifdef HAVE_LIBPCAP
if (cfile.ringbuffer_on) {
/* Ring buffer works only under certain conditions:
a) ring buffer does not work with temporary files;
@@ -1423,6 +1428,7 @@ main(int argc, char *argv[])
cfile.ringbuffer_on = FALSE;
}
}
+#endif
#ifdef WIN32
/* Load wpcap if possible */
@@ -1492,6 +1498,7 @@ main(int argc, char *argv[])
cfile.cinfo.col_buf[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
}
+#ifdef HAVE_LIBPCAP
if (cfile.snap < 1)
cfile.snap = WTAP_MAX_PACKET_SIZE;
else if (cfile.snap < MIN_PACKET_SIZE)
@@ -1502,6 +1509,7 @@ main(int argc, char *argv[])
cfile.ringbuffer_num_files = RINGBUFFER_MIN_NUM_FILES;
else if (cfile.ringbuffer_num_files > RINGBUFFER_MAX_NUM_FILES)
cfile.ringbuffer_num_files = RINGBUFFER_MAX_NUM_FILES;
+#endif
rc_file = get_persconffile_path(RC_FILE, FALSE);
gtk_rc_parse(rc_file);
diff --git a/tethereal.c b/tethereal.c
index 98f31bc5b1..fe8fc2587a 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -1,6 +1,6 @@
/* tethereal.c
*
- * $Id: tethereal.c,v 1.114 2002/01/10 07:43:37 guy Exp $
+ * $Id: tethereal.c,v 1.115 2002/01/10 09:51:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -211,6 +211,7 @@ get_positive_int(const char *string, const char *name)
return number;
}
+#ifdef HAVE_LIBPCAP
/*
* Given a string of the form "<autostop criterion>:<value>", as might appear
* as an argument to a "-a" option, parse it and set the criterion in
@@ -255,6 +256,7 @@ set_autostop_criterion(const char *autostoparg)
*colonp = ':'; /* put the colon back */
return TRUE;
}
+#endif
int
main(int argc, char *argv[])
@@ -618,6 +620,7 @@ main(int argc, char *argv[])
}
}
+#ifdef HAVE_LIBPCAP
/* If they didn't specify a "-w" flag, but specified a maximum capture
file size, tell them that this doesn't work, and exit. */
if (cfile.autostop_filesize != 0 && cfile.save_file == NULL) {
@@ -640,6 +643,7 @@ main(int argc, char *argv[])
exit(2);
}
}
+#endif
#ifdef WIN32
/* Start windows sockets */
@@ -672,6 +676,7 @@ main(int argc, char *argv[])
cfile.cinfo.col_buf[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
}
+#ifdef HAVE_LIBPCAP
if (cfile.snap < 1)
cfile.snap = WTAP_MAX_PACKET_SIZE;
else if (cfile.snap < MIN_PACKET_SIZE)
@@ -682,6 +687,7 @@ main(int argc, char *argv[])
cfile.ringbuffer_num_files = RINGBUFFER_MIN_NUM_FILES;
else if (cfile.ringbuffer_num_files > RINGBUFFER_MAX_NUM_FILES)
cfile.ringbuffer_num_files = RINGBUFFER_MAX_NUM_FILES;
+#endif
if (rfilter != NULL) {
if (!dfilter_compile(rfilter, &rfcode)) {