summaryrefslogtreecommitdiff
path: root/graphics/xplot-devel/patches
diff options
context:
space:
mode:
authorbad <bad>2006-10-14 09:20:14 +0000
committerbad <bad>2006-10-14 09:20:14 +0000
commitaddae3b32e276c8405c3ab90b85aa11b270c9032 (patch)
treeeabf2b5ea75c2ea4f4bf6c63c64591ba1893e30f /graphics/xplot-devel/patches
parentb5e45d17dd16d9a553f4dd9ca23430c2c8a16cb0 (diff)
downloadpkgsrc-addae3b32e276c8405c3ab90b85aa11b270c9032.tar.gz
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 (limited to 'graphics/xplot-devel/patches')
-rw-r--r--graphics/xplot-devel/patches/patch-ab34
1 files changed, 34 insertions, 0 deletions
diff --git a/graphics/xplot-devel/patches/patch-ab b/graphics/xplot-devel/patches/patch-ab
new file mode 100644
index 00000000000..80622a6039b
--- /dev/null
+++ b/graphics/xplot-devel/patches/patch-ab
@@ -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);