From benjamin@kryten.oitsec.umn.edu  Tue Mar 21 14:03:56 2006
Return-Path: <benjamin@kryten.oitsec.umn.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2045416A400
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Mar 2006 14:03:56 +0000 (UTC)
	(envelope-from benjamin@kryten.oitsec.umn.edu)
Received: from mail.oitsec.umn.edu (mail.oitsec.umn.edu [128.101.238.120])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 71C4443D48
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Mar 2006 14:03:55 +0000 (GMT)
	(envelope-from benjamin@kryten.oitsec.umn.edu)
Received: from localhost (localhost [127.0.0.1])
	by mail.oitsec.umn.edu (Postfix) with ESMTP id CE3F11CC097;
	Tue, 21 Mar 2006 08:03:54 -0600 (CST)
Received: from mail.oitsec.umn.edu ([127.0.0.1])
 by localhost (mail.oitsec.umn.edu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 30869-04-4; Tue, 21 Mar 2006 08:03:53 -0600 (CST)
Received: from kryten.oitsec.umn.edu (kryten.oitsec.umn.edu [160.94.247.227])
	by mail.oitsec.umn.edu (Postfix) with ESMTP id D69101CC09E;
	Tue, 21 Mar 2006 08:03:49 -0600 (CST)
Received: by kryten.oitsec.umn.edu (Postfix, from userid 1001)
	id D057D844AC; Mon, 20 Mar 2006 13:42:54 -0600 (CST)
Message-Id: <20060321140349.D057D844AC@kryten.oitsec.umn.edu>
Date: Mon, 20 Mar 2006 13:42:54 -0600 (CST)
From: Ben Allen <benjamin@umn.edu>
Reply-To: Ben Allen <benjamin@umn.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Ben Allen <benjamin@umn.edu>
Subject: [patch] Add --zero-delay option to net-mgmt/etherape
X-Send-Pr-Version: 3.113
X-GNATS-Notify: samy@kerneled.org

>Number:         94777
>Category:       ports
>Synopsis:       [patch] Add --zero-delay option to net-mgmt/etherape
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 21 14:10:14 GMT 2006
>Closed-Date:    Sat Apr 29 17:24:56 GMT 2006
>Last-Modified:  Sat Apr 29 17:24:56 GMT 2006
>Originator:     Ben Allen
>Release:        FreeBSD 5.4-RELEASE-p11 i386
>Organization:
University of Minnesota
>Environment:
System: FreeBSD kryten.oitsec.umn.edu 5.4-RELEASE-p11 FreeBSD 5.4-RELEASE-p11 #9: Fri Feb 17 12:28:15 CST 2006 root@kryten.oitsec.umn.edu:/usr/obj/usr/src/sys/OITSEC-5_4-BEN i386


	CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (2394.01-MHz 686-class CPU)
	libraries:
		libgnome-2.12.0.1 & friends
	
>Description:
	When using etherape to analyze long packet captures, the "real-time" mode is frustrating.
	This patch adds a command line option to disable the inter-packet timing analysis, and 
	just read the capture file as fast as possible, and then draw the diagram once.  This provides
	a fast way to analyze conversations occuring in long packet captures.
	
>How-To-Repeat:
	Using tcpdump, capture an hour's worth of low, volume traffic - DNS/SMTP/HTTP traffic on one 
	workstation should suffice - to a file.   Open the capture file in etherape, and watch it
	draw the graph.  Note, this will take an hour.   The patch below will cause the graph to be
	drawn as quickly as possible when the "-z" or "--zero-delay" flag is added on the command line.


>Fix:

	The patch below applies to /usr/ports/net-mgmt/etherape/work/etherape-0.9.1/src .
	ie:
	# cd /usr/ports/net-mgmt/etherape
	# make extract
	# cd work/etherape-0.9.1/src
	# patch < the_patch_below
	# cd /usr/ports/net-mgmt/etherape
	# make install
	

	The patch below has been submitted to the etherape developers as well.  However, based on their
project at sourceforge, it seems that the main project seems to be moving rather slowly at the moment.


--- patch.etherape.zero_delay begins here ---
--- capture.c.orig	Mon Mar 20 11:08:13 2006
+++ capture.c	Mon Mar 20 11:08:53 2006
@@ -527,7 +527,16 @@
   this_time.tv_usec = phdr.ts.tv_usec;
 
   diff = substract_times (this_time, last_time);
-  ms_to_next = diff.tv_sec * 1000 + diff.tv_usec / 1000;
+
+  if (pref.zero_delay)
+    {
+      ms_to_next = 0;
+    }
+  else
+    {
+      ms_to_next = diff.tv_sec * 1000 + diff.tv_usec / 1000;
+    }
+
 
   last_time = this_time;
 
--- globals.h.orig	Mon Mar 20 11:06:35 2006
+++ globals.h	Mon Mar 20 11:07:16 2006
@@ -342,6 +342,8 @@
   gchar *interface;		/* Network interface to listen to */
   gchar *filter;		/* Pcap filter to be used */
 
+  gboolean zero_delay;         /* no delay processing tcpdump files */
+
 }
 pref;
 
--- main.c.orig	Mon Mar 20 11:07:35 2006
+++ main.c	Mon Mar 20 11:07:56 2006
@@ -60,6 +60,9 @@
      N_("set the node color"), N_("color")},
     {"text-color", 'T', POPT_ARG_STRING, &(pref.text_color), 0,
      N_("set the text color"), N_("color")},
+    {"zero-delay", 'z', POPT_ARG_NONE, &(pref.zero_delay), 0,
+     N_("zero delay for reading capture files [cli only]"), NULL},
+
 
     POPT_AUTOHELP {NULL, 0, 0, NULL, 0}
   };
--- patch.etherape.zero_delay ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue Mar 21 14:12:12 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94777 
State-Changed-From-To: feedback->closed 
State-Changed-By: mnag 
State-Changed-When: Sat Apr 29 17:24:54 UTC 2006 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94777 
>Unformatted:
