X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2Fperl%2Flib%2FNet%2FOping.pm;h=ba67f739afffcb606a3cc1594b528fb7b9ef7a8d;hb=40f1574f0b5f713e44c73115553977900c9f933f;hp=6c59ecb4b43fff70e78e580db472be9f2548fe05;hpb=9d8baf99b9327e832ce25c306f0ad63eabe035f6;p=liboping.git diff --git a/bindings/perl/lib/Net/Oping.pm b/bindings/perl/lib/Net/Oping.pm index 6c59ecb..ba67f73 100644 --- a/bindings/perl/lib/Net/Oping.pm +++ b/bindings/perl/lib/Net/Oping.pm @@ -1,3 +1,27 @@ +# +# Net-Oping - lib/Net/Oping.pm +# Copyright (C) 2007 Olivier Fredj +# Copyright (C) 2008,2009 Florian octo Forster +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; only version 2 of the License is +# applicable. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# Authors: +# Olivier Fredj +# Florian octo Forster +# + package Net::Oping; =head1 NAME @@ -6,7 +30,7 @@ Net::Oping - ICMP latency measurement module using the oping library. =head1 SYNOPSIS - use Net::Oping; + use Net::Oping (); my $obj = Net::Oping->new (); $obj->host_add (qw(one.example.org two.example.org)); @@ -17,15 +41,16 @@ Net::Oping - ICMP latency measurement module using the oping library. =head1 DESCRIPTION This Perl module is a high-level interface to the -L. Its purpose it to send C packets (also known as "ping") to a host and measure the time -that elapses until the reception of an C packet (also known as -"pong"). If no such packet is received after a certain timeout the host is considered to be unreachable. +L. Its purpose it to send C +packets (also known as "ping") to a host and measure the time that elapses +until the reception of an C packet (also known as "pong"). If +no such packet is received after a certain timeout the host is considered to be +unreachable. -The used C library supports "ping"ing multiple hosts in parallel and +The used I library supports "ping"ing multiple hosts in parallel and works with IPv4 and IPv6 transparently. Other advanced features that are -provided by the underlying library, such as setting the data sent or -configuring the time of live (TTL) are not yet supported by this interface. +provided by the underlying library, such as setting the data sent, are not yet +supported by this interface. =cut @@ -36,7 +61,7 @@ use warnings; use Carp (qw(cluck confess)); -our $VERSION = '1.02'; +our $VERSION = '1.21'; require XSLoader; XSLoader::load ('Net::Oping', $VERSION); @@ -46,14 +71,14 @@ return (1); The interface is kept simple and clean. First you need to create an object to which you then add hosts. Using the C method you can request a latency -measurement and get the current values returned. If neccessary you can remove +measurement and get the current values returned. If necessary you can remove hosts from the object, too. The constructor and methods are defined as follows: =over 4 -=item my I<$obj> = Net::Oping-EB (); +=item I<$obj> = Net::Oping-EB (); Creates and returns a new object. @@ -74,7 +99,7 @@ sub DESTROY _ping_destroy ($obj->{'c_obj'}); } -=item my I<$status> = I<$obj>-EB (I<$timeout>); +=item I<$status> = I<$obj>-EB (I<$timeout>); Sets the timeout before a host is considered unreachable to I<$timeout> seconds, which may be a floating point number to specify fractional seconds. @@ -97,11 +122,35 @@ sub timeout return (1); } -=item my I<$status> = I<$obj>-EB (I<$ip_addr>); +=item I<$status> = I<$obj>-EB (I<$ttl>); + +Sets the I