saintmike has asked for the wisdom of the Perl Monks concerning the following question:
Net::Pcap provides a function lookupnet to query a host's network interface and to return its network and and netmask setting.
However, when running
the output is something likeuse Net::Pcap; my $err; my($address, $netmask); my $dev = Net::Pcap::lookupdev(\$err); print "dev is $dev\n"; if(Net::Pcap::lookupnet($dev, \$address, \$netmask, \$err)) { die "Failed to look up dev info on $dev"; } print "address=$address netmask=$netmask\n";
Which format is this in? I've tried inet_ntoa and friends but can't seem to convert the result to the xx.xx.xx.xx format I'm looking for. Any ideas?dev is eth0 address=-1062731776 netmask=-256
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Network/Netmask returned by Net::Pcap's lookupnet
by Fletch (Bishop) on Sep 07, 2004 at 01:54 UTC | |
|
Re: Network/Netmask returned by Net::Pcap's lookupnet
by tachyon (Chancellor) on Sep 07, 2004 at 02:24 UTC | |
|
Re: Network/Netmask returned by Net::Pcap's lookupnet
by PodMaster (Abbot) on Sep 07, 2004 at 01:54 UTC | |
|
Re: Network/Netmask returned by Net::Pcap's lookupnet
by NetWallah (Canon) on Sep 07, 2004 at 02:03 UTC |