⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.67
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
.cpan
/
build
/
NetAddr-IP-4.079-0
/
Lite
/
t
/
View File Name :
v4-num.t
use NetAddr::IP::Lite; my $nets = { '10.1.2.3' => [ 32, 0 ], '10.2.3.4' => [ 31, 1 ], '10.0.0.16' => [ 24, 255 ], '10.128.0.1' => [ 8, 2 ** 24 - 1 ], '10.0.0.5' => [ 30, 3 ], '0.0.0.0' => [ 0, 2 ** 32 -1 ], }; my $new = 1; # flag for old vs new numeric returns $| = 1; $test = keys %$nets; $test *= 2; print "1..", $test, "\n"; $test = 1; sub tst { for my $a (keys %$nets) { my $nc = $nets->{$a}->[1] - $new; # net count $nc = 1 if $nc < 0; $nc = 2 if $new && $nets->{$a}->[0] == 31; # special case for /31, /127 my $ip = new NetAddr::IP::Lite $a, $nets->{$a}->[0]; print "got: $_, exp: $nc\nnot " unless ($_ = $ip->num) == $nc; print "ok ", $test++, "\n"; } } tst(); import NetAddr::IP::Lite qw(:old_nth); $new = 0; tst();