Wrap stufff that's used only if we have "libpcap" in "#ifdef

HAVE_LIBPCAP"/"#endif".

svn path=/trunk/; revision=754
This commit is contained in:
Guy Harris 1999-10-02 19:33:14 +00:00
parent 3395559532
commit 37aa821603
2 changed files with 12 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/* capture_dlg.c
* Routines for packet capture windows
*
* $Id: capture_dlg.c,v 1.7 1999/10/02 07:13:20 guy Exp $
* $Id: capture_dlg.c,v 1.8 1999/10/02 19:33:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -28,6 +28,8 @@
# include "config.h"
#endif
#ifdef HAVE_LIBPCAP
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@ -525,4 +527,4 @@ free_if_cb(gpointer data, gpointer user_data)
g_free(data);
}
#endif /* HAVE_LIBPCAP */

View File

@ -1,6 +1,6 @@
/* main.c
*
* $Id: main.c,v 1.15 1999/10/02 06:26:52 guy Exp $
* $Id: main.c,v 1.16 1999/10/02 19:33:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -497,9 +497,11 @@ main(int argc, char *argv[])
exit(0);
}
#ifdef HAVE_LIBPCAP
/* Set "capture_child" to indicate whether this is going to be a child
process for a "-S" or "-F" capture? */
capture_child = (strcmp(command_name, CHILD_NAME) == 0);
#endif
/* Let GTK get its args */
gtk_init (&argc, &argv);
@ -648,13 +650,13 @@ main(int argc, char *argv[])
}
#endif
#ifdef HAVE_LIBPCAP
if (start_capture) {
if (cf.iface == NULL) {
fprintf(stderr, "ethereal: \"-k\" flag was specified without \"-i\" flag\n");
exit(1);
}
}
#ifdef HAVE_LIBPCAP
if (capture_child) {
if (cf.save_file_fd == -1) {
/* XXX - send this to the standard output as something our parent
@ -852,10 +854,12 @@ main(int argc, char *argv[])
ethereal_proto_init(); /* Init anything that needs initializing */
#ifdef HAVE_LIBPCAP
/* Is this a "child" ethereal, which is only supposed to pop up a
capture box to let us stop the capture, and run a capture
to a file that our parent will read? */
if (!capture_child) {
#endif
/* No. Pop up the main window, and read in a capture file if
we were told to. */
@ -891,7 +895,9 @@ main(int argc, char *argv[])
}
}
}
#ifdef HAVE_LIBPCAP
}
#endif
/* If we failed to open the preferences file, pop up an alert box;
we defer it until now, so that the alert box is more likely to