~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to test/tcpdumpscii.txt

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
From marcs@znep.com Fri Apr 17 15:16:16 1998
 
3
Date: Sat, 22 Nov 1997 20:44:10 -0700 (MST)
 
4
From: Marc Slemko <marcs@znep.com>
 
5
To: TLOSAP <new-httpd@apache.org>
 
6
Subject: Re: Getting ethernet packets content under FreeBSD?  (fwd)
 
7
Reply-To: new-httpd@apache.org
 
8
 
 
9
Anyone too lazy to hack tcpdump (eg. my tcpdump has a -X option to display
 
10
the data in ASCII) can use something like the below to grab HTTP headers
 
11
when debugging broken clients.
 
12
 
 
13
Nothing complicated, but handy.
 
14
 
 
15
---------- Forwarded message ----------
 
16
Date: Sat, 22 Nov 1997 14:35:23 PST
 
17
From: Bill Fenner <fenner@parc.xerox.com>
 
18
To: Nate Williams <nate@mt.sri.com>
 
19
Cc: bmah@ca.sandia.gov, hackers@FreeBSD.ORG
 
20
Subject: Re: Getting ethernet packets content under FreeBSD? 
 
21
 
 
22
I usually just use this perl script, which I call "tcpdumpscii".
 
23
Then run "tcpdumpscii -s 1500 -x [other tcpdump args]".
 
24
 
 
25
  Bill
 
26
 
 
27
#!/import/misc/bin/perl
 
28
#
 
29
#
 
30
open(TCPDUMP,"tcpdump -l @ARGV|");
 
31
while (<TCPDUMP>) {
 
32
        if (/^\s+(\S\S)+/) {
 
33
                $sav = $_;
 
34
                $asc = "";
 
35
                while (s/\s*(\S\S)\s*//) {
 
36
                        $i = hex($1);
 
37
                        if ($i < 32 || $i > 126) {
 
38
                                $asc .= ".";
 
39
                        } else {
 
40
                                $asc .= pack(C,hex($1));
 
41
                        }
 
42
                }
 
43
                $foo = "." x length($asc);
 
44
                $_ = $sav;
 
45
                s/\t/        /g;
 
46
                s/^$foo/$asc/;
 
47
        }
 
48
        print;
 
49
}
 
50