Leser: 1
4 Einträge, 1 Seite |
1
2
3
4
5
my ($address, $netmask, $err);
if (Net::Pcap::lookupnet($dev, \$address, \$netmask, \$err)) {
die 'Unable to look up device information for ', $dev, ' - ', $err;
}
print STDOUT "$dev: addr/mask -> $addr/$mask\n";
eth0: addr/mask -> 3232235776/4294967040
1 2 3 4 5 6
use Data::Dumper; my $ip = join '.', map hex, (sprintf("%x", 3232235776) =~ /\w{2}/g); my $mask = join '.', map hex, (sprintf("%x", 4294967040) =~ /\w{2}/g); print Dumper [$ip, $mask]
1 2 3 4 5 6
use Data::Dumper; my $ip = join '.', unpack "C*", pack "N", 3232235776; my $mask = join '.', unpack "C*", pack "N", 4294967040; print Dumper [$ip, $mask]
4 Einträge, 1 Seite |