… | |
… | |
11 | |
11 | |
12 | Getopt::Long::Configure ("bundling", "no_ignore_case"); |
12 | Getopt::Long::Configure ("bundling", "no_ignore_case"); |
13 | |
13 | |
14 | my $count = 1; |
14 | my $count = 1; |
15 | my $rate = 0; |
15 | my $rate = 0; |
16 | my $wait = 0.1; |
16 | my $wait = 0.25; |
17 | |
17 | |
18 | GetOptions ( |
18 | GetOptions ( |
19 | "count|c=i" => \$count, |
19 | "count|c=i" => \$count, |
20 | "rate|r=n" => \$rate, |
20 | "rate|r=n" => \$rate, |
21 | "wait|w=n" => \$wait, |
21 | "wait|w=n" => \$wait, |
… | |
… | |
45 | } |
45 | } |
46 | |
46 | |
47 | Net::FPing::register_cb { |
47 | Net::FPing::register_cb { |
48 | for (@{$_[0]}) { |
48 | for (@{$_[0]}) { |
49 | printf "%s %d %g\n", |
49 | printf "%s %d %g\n", |
50 | (4 == length $_->[0] ? inet_ntoa $_->[0] : inet_ntop (&AF_INET6, $_->[0])), |
50 | (4 == length $_->[0] ? inet_ntoa $_->[0] : Socket6::inet_ntop (&AF_INET6, $_->[0])), |
51 | $_->[2], |
51 | $_->[2], |
52 | $_->[1]; |
52 | $_->[1]; |
53 | } |
53 | } |
54 | }; |
54 | }; |
55 | |
55 | |