Net-Traceroute6
view release on metacpan or search on metacpan
Traceroute6.pm view on Meta::CPAN
# Field offsets for query info array
my $query_stat_offset = 0;
my $query_host_offset = 1;
my $query_time_offset = 2;
#real address family if you specify PF_UNSPEC
my $real_af = -1;
# check whether we have IPv6 support;
my $inet6 = defined(eval 'PF_INET6');
###
# Public methods
# Constructor
sub new {
my $self = shift;
my $type = ref($self) || $self;
Traceroute6.pm view on Meta::CPAN
sub af {
my $self = shift;
my $elem = "af";
my $old = $self->{$elem};
if (@_) {
$self->{$elem} = PF_UNSPEC if ($_[0]== PF_UNSPEC) ;
$self->{$elem} = PF_INET if ($_[0]== PF_INET) ;
$self->{$elem} = PF_INET6 if ($inet6 && ($_[0] == PF_INET6));
}
return $old;
}
# Accessor for status of this traceroute object. Externally read only
# (not enforced).
sub stat {
my $self = shift;
my $elem = "stat";
Traceroute6.pm view on Meta::CPAN
my $self = shift;
my @args; # collector of arguments
my $os=$Config{'osname'};
my $prg_sw;
OSNAMESW: {
# here comes Solaris
if ($os = ~ /solaris/) {
push (@args, "traceroute");
push (@args, "-A");
$prg_sw = ($self->af == PF_INET6) ? "inet6" : "inet";
push (@args, $prg_sw);
last OSNAMESW;
}
# here comes AIX
#
# here comes Tru64 UNIX
#
# here comes W2K
#
# for the rest we assume traceroute6/traceroute
( run in 0.251 second using v1.01-cache-2.11-cpan-5f2e87ce722 )