make tshark compile and work also when pcap is not available
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>
Thu, 1 Feb 2007 09:04:46 +0000 (09:04 -0000)
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>
Thu, 1 Feb 2007 09:04:46 +0000 (09:04 -0000)
svn path=/trunk/; revision=20664

tshark.c

index fcd661ddde9db273dc87c541ed56862276c5c02d..4489f60f7710f3edc2eea8944ec2cecf45047bdc 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -1137,6 +1137,7 @@ main(int argc, char *argv[])
     }
   }
 
+#ifdef HAVE_LIBPCAP
   if (!capture_opts.saving_to_file) {
     /* We're not saving the capture to a file; if "-q" wasn't specified,
        we should print packet information */
@@ -1154,6 +1155,12 @@ main(int argc, char *argv[])
       exit(1);
     }
   }
+#else
+  /* We're not saving the capture to a file; if "-q" wasn't specified,
+     we should print packet information */
+  if (!quiet)
+    print_packet_info = TRUE;
+#endif
 
 #ifndef HAVE_LIBPCAP
   if (capture_option_specified)
@@ -1455,7 +1462,11 @@ main(int argc, char *argv[])
     }
 
     /* Process the packets in the file */
+#ifdef HAVE_LIBPCAP
     err = load_cap_file(&cfile, capture_opts.save_file, out_file_type);
+#else
+    err = load_cap_file(&cfile, NULL, out_file_type);
+#endif
     if (err != 0) {
       epan_cleanup();
       exit(2);