POE::Component::Client::Traceroute

POE::Component::Client::Traceroute is a non-blocking traceroute client.
Download

POE::Component::Client::Traceroute Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Andrew Hoying
  • Publisher web site:
  • http://search.cpan.org/~ahoying/POE-Component-Client-Traceroute-0.21/Traceroute.pm

POE::Component::Client::Traceroute Tags


POE::Component::Client::Traceroute Description

POE::Component::Client::Traceroute is a non-blocking traceroute client. POE::Component::Client::Traceroute is a non-blocking traceroute client.SYNOPSIS use POE qw(Component::Client::Traceroute); POE::Component::Client::Traceroute->spawn( Alias => 'tracer', # Defaults to tracer FirstHop => 1, # Defaults to 1 MaxTTL => 16, # Defaults to 32 hops Timeout => 0, # Defaults to never QueryTimeout => 3, # Defaults to 3 seconds Queries => 3, # Defaults to 3 queries per hop BasePort => 33434, # Defaults to 33434 PacketLen => 128, # Defaults to 68 SourceAddress => '0.0.0.0', # Defaults to '0.0.0.0' PerHopPostback => 0, # Defaults to no PerHopPostback Device => 'eth0', # Defaults to undef UseICMP => 0, # Defaults to 0 Debug => 0, # Defaults to 0 DebugSocket => 0, # Defaults to 0 ); sub some_event_handler { $kernel->post( "tracer", # Post request to 'tracer' component "traceroute", # Ask it to traceroute to an address "trace_response", # Post answers to 'trace_response' $destination, # This is the host to traceroute to , # Data to send back with postback event ] ); } # This is the sub which is called with the responses from the # Traceroute component. sub trace_response { my ($request,$response) = @_; my ($destination, $options, $callback) = @$request; my ($hops, $data, $error) = @$response; if ($hops) { print "Traceroute results for $destinationn"; foreach my $hop (@$data) { my $hopnumber = $hop->{hop}; my $routerip = $hop->{routerip}; my @rtts = @{$hop->{results}}; print "$hopnumbert$routeript"; foreach (@rtts) { if ($_ eq "*") { print "* "; } else { printf "%0.3fms ", $_*1000; } } print "n"; } } warn "Error occurred tracing to $destination: $errorn" if ($error); } or sub another_event_handler { $kernel->post( "tracer", # Post request to 'tracer' component "traceroute", # Ask it to traceroute to an address "trace_response", # Post answers to 'trace_response' $destination, # This is the host to traceroute to ); } sub trace_row { my ($request,$response) = @_; my ($destination, $options, $callback) = @$request; my ($currenthop, $data, $error) = @$response; # $data only contains responses for the current TTL # The structure is the same as for trace_response above }POE::Component::Client::Traceroute is a non-blocking Traceroute client. It lets several other sessions traceroute through it in parallel, and it lets them continue doing other things while they wait for responses. Requirements: · Perl


POE::Component::Client::Traceroute Related Software