]> mj.ucw.cz Git - netgrind.git/blobdiff - netgrind/netgrind.c
Implemented dumping of HTTP transactions
[netgrind.git] / netgrind / netgrind.c
index da020748a0340ca46fb3aef1cd01fab29db68a3d..b3d1a3c621c516c2c38e17a6990d4590e23ccf5c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Netgrind -- The Network Traffic Analyser
  *
- *     (c) 2003 Martin Mares <mj@ucw.cz>
+ *     (c) 2003--2013 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU General Public License.
@@ -125,6 +125,7 @@ static void usage(void)
 -s             Dump connection summary\n\
 -t             Calculate statistics only\n\
 -w             TCP: Wait for ACK before processing packets\n\
+-x <dir>       Dump HTTP transactions to a given directory\n\
 ");
   exit(1);
 }
@@ -141,7 +142,7 @@ int main(int argc, char **argv)
   byte *histogram = NULL;
 
   tcp_default_appl = &appl_mux;
-  while ((c = getopt(argc, argv, "ac:d:D:f:h:stw")) >= 0)
+  while ((c = getopt(argc, argv, "ac:d:D:f:h:stwx:")) >= 0)
     switch (c)
       {
       case 'a':
@@ -173,6 +174,9 @@ int main(int argc, char **argv)
       case 't':
        tcp_default_appl = &appl_sink;
        break;
+      case 'x':
+       http_log_dir = optarg;
+       break;
       default:
        usage();
       }
@@ -242,6 +246,7 @@ int main(int argc, char **argv)
     }
   tcp_cleanup(last_timestamp);
   histogram_cleanup();
+  printf("\n");
   printf("# Netgrind statistics:\n");
   printf("# Pcap: %Ld(%Ld) in, %Ld(%Ld) incomplete\n",
         stat_pcap_in.packets, stat_pcap_in.bytes,