pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/xplot-devel Fixes to tcpdump2xplot:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c54b716ba83f
branches:  trunk
changeset: 520057:c54b716ba83f
user:      bad <bad%pkgsrc.org@localhost>
date:      Sat Oct 14 09:20:14 2006 +0000

description:
Fixes to tcpdump2xplot:
- Strip output added by modern tcpdump versions in verbose mode from
input lines (IP options, tcp checksum status).
- Split sack ranges on consecutive spaces instead of just a single space.

While here use a string comparison operator to compare second filed against
"IP" by copying the code from graphics/xplot patch-ab.

diffstat:

 graphics/xplot-devel/Makefile         |   3 ++-
 graphics/xplot-devel/distinfo         |   3 ++-
 graphics/xplot-devel/patches/patch-ab |  34 ++++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 2 deletions(-)

diffs (64 lines):

diff -r 05c17f0e008d -r c54b716ba83f graphics/xplot-devel/Makefile
--- a/graphics/xplot-devel/Makefile     Sat Oct 14 09:13:14 2006 +0000
+++ b/graphics/xplot-devel/Makefile     Sat Oct 14 09:20:14 2006 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.1.1.1 2006/08/16 18:11:40 gdt Exp $
+# $NetBSD: Makefile,v 1.2 2006/10/14 09:20:14 bad Exp $
 
 DISTNAME=      xplot-0.90.8
+PKGREVISION=   1
 CATEGORIES=    graphics x11
 MASTER_SITES=  http://acert.ir.bbn.com/downloads/acert-geospatial/
 HOMEPAGE=      http://www.xplot.org/
diff -r 05c17f0e008d -r c54b716ba83f graphics/xplot-devel/distinfo
--- a/graphics/xplot-devel/distinfo     Sat Oct 14 09:13:14 2006 +0000
+++ b/graphics/xplot-devel/distinfo     Sat Oct 14 09:20:14 2006 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.1.1.1 2006/08/16 18:11:40 gdt Exp $
+$NetBSD: distinfo,v 1.2 2006/10/14 09:20:14 bad Exp $
 
 SHA1 (xplot-0.90.8.tar.gz) = d87a382b01c7a48787d2c6fa2d16e0961de9d81c
 RMD160 (xplot-0.90.8.tar.gz) = ac8877ad7fa1c80afa0281236b3a4992482109c2
 Size (xplot-0.90.8.tar.gz) = 243259 bytes
 SHA1 (patch-aa) = 48a475a550a2ea9d2bc50f2782d598830802817e
+SHA1 (patch-ab) = f7eaac7296a830584b2cf02324086101579cc3d5
 SHA1 (patch-ac) = 671b63a8db7c41df4e9f14147988d81ff921aca7
 SHA1 (patch-ad) = fd19823030badf91734fde92b45fcaecc06cf0f8
diff -r 05c17f0e008d -r c54b716ba83f graphics/xplot-devel/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/xplot-devel/patches/patch-ab     Sat Oct 14 09:20:14 2006 +0000
@@ -0,0 +1,34 @@
+$NetBSD: patch-ab,v 1.1 2006/10/14 09:20:14 bad Exp $
+
+--- tcpdump2xplot.pl.orig      2006-07-27 21:55:59.000000000 +0200
++++ tcpdump2xplot.pl
+@@ -229,12 +229,16 @@ for ($lineNo = 1; <$Tcpdump>; $lineNo++)
+     local(%opts);
+ 
+     chop;
++    # strip unwanted output added by modern tcdump versions in verbose mode
++    s/\(tos.*?\)//;     # (tos 0x0, ttl ... length: \d+)
++    s/ \[(?:bad )?tcp (?:ck)?sum.*?\]//; # [tcp sum ok]/[bad tcp cksum ....]
+     $opts = $_;   # save this for later 
+ 
+-    split(/ /);
+-    if ($_[1] == "IP") {
+-      splice @_,1,1;
+-    }
++    split(/ +/);
++    # Sometime after version 3.7.1 tcpdump started to print 'IP'
++    # as the second field in the output. Get rid of it again.
++    # also remove additional fields printed in verbose mode
++    splice @_, 1, 1 if $_[1] eq 'IP';
+     $time = $_[0];
+ 
+     # If there is if_signal.c-style signal strength info, elide it.
+@@ -432,7 +436,7 @@ for ($lineNo = 1; <$Tcpdump>; $lineNo++)
+ 
+               # print stderr "SACKS after : $sacks \n";
+ 
+-              @sacks = split(/ /, $sacks);
++              @sacks = split(/ +/, $sacks);
+               
+               for ($i = 0; $i <= $#sacks; $i++) {
+                   local($start);



Home | Main Index | Thread Index | Old Index