/[maps]/Maps.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /Maps.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations)
Mon Oct 15 21:14:50 2007 UTC (16 years, 6 months ago) by dpavlin
Original Path: Mireo.pm
File size: 1113 byte(s)
Net::Analysis::Listener::Mireo to decode saved pcap traffic
1 dpavlin 1 package Net::Analysis::Listener::Mireo;
2    
3     use strict;
4     use warnings;
5     use base qw(Net::Analysis::Listener::Base);
6     use File::Slurp;
7    
8     sub http_transaction {
9     my ($self, $args) = @_;
10     my ($req) = $args->{req}; # isa HTTP::Request
11     my ($resp) = $args->{resp}; # isa HTTP::Response
12     my ($req_mono) = $args->{req_mono}; # isa Net::Analysis::TCPMonologue
13     my ($resp_mono) = $args->{resp_mono}; # isa Net::Analysis::TCPMonologue
14    
15     # Print out time between sending last part of request, and receiving
16     # first part of response.
17     # (Note; these are Net::Analsysis::Time objects)
18     my ($network_wait_time) = $resp_mono->t_start() - $req_mono->t_end();
19     printf "%-50.50s: %8.2f\n", $req->uri(), $network_wait_time;
20    
21     if ( $req->uri() =~ m!/GElin/MapSrv\.aspx\?lwM=(\d+)&twM=(\d+)&zf=(\d+)! ) {
22     mkdir "dump" unless -e "dump";
23     mkdir "dump/$3" unless -e "dump/$3";
24     write_file( "dump/$3/$1-$2.gif", $resp->content );
25     }
26     }
27    
28     1;
29    
30     =head1 NAME
31    
32     Net::Analysis::Listener::Mireo - looking at HTTP transactions
33    
34     $ perl -MNet::Analysis -e main HTTP Mireo t/t1_google.tcp
35    

  ViewVC Help
Powered by ViewVC 1.1.26