Subject: | obsolete functions of Net::Libdnet and the warning by loading Net::Packet::Env. |
Date: | Thu, 27 Aug 2009 18:41:31 +0900 |
To: | bug-Net-Packet [...] rt.cpan.org |
From: | Kurotsu Motoya <motoya.kurotsu.2009 [...] gmail.com> |
Hi,
My browser does not accept certificate of rt.cpan.org.
I am sorry to send directly to this mail address.
Thank you for providing Net::Packet module.
I plan to write a program based on this module.
I run some examples in this module and studied in some source code.
I found that some obsolete functions of Net::Libdnet used such as addr_net,
intf_get_dst and so on.
Do you have a plan to modify using new APIs suggested by Net::Libdnet
in the near future?
For the moment, some examples put the warning in the following;
addr_net: undef input
This warning come by just loading Net::Packet::Env.
More precisely, in getSubnet method.
sub getSubnet {
Net::Libdnet::addr_net(shift->[$___dnet]->{addr}) || '127.0.0.0';
}
In my case, shift->[$___dnet] is {} when this method is called first time,
since getDevInfo does not found the device to Internet.
sub getDevInfo {
my $self = shift;
# By default, we take outgoing device to Internet
$self->[$___dnet] = Net::Libdnet::intf_get_dst(shift() || '1.1.1.1');
$self->getDev;
}
Could you tell me what the ip adrress 1.1.1.1 is? Does it really exist?
It seems better to use a.root-server.net such like in
the test code (07-intf.t) of Net::Libdnet, for example.
I think it is much better for user to have an option of skipping
initialization of dev, mac, subnet, ip, ip6 and getwayIp
in the method 'new', since it can take time. Instead it is expected that
user initialize them afterward by calling updateDevInfo for example if
user skipping initialization of them in the method 'new'.
Could you tell me your opinion?
My environment:
Net::Libnet: 0.92
Net::Packet: 3.26
perl: v5.10.0 built for i386-linux-thread-multi
Thank you in advance.
Motoya Kurotsu