From 23a712030065e3705b328fd329f7334448c5a00d Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 15 Mar 2009 13:47:32 +0100 Subject: [PATCH] bindings/perl: Add the `ttl' method. --- bindings/perl/Oping.xs | 9 ++++++++ bindings/perl/lib/Net/Oping.pm | 48 +++++++++++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/bindings/perl/Oping.xs b/bindings/perl/Oping.xs index 135733d..1327a95 100644 --- a/bindings/perl/Oping.xs +++ b/bindings/perl/Oping.xs @@ -62,6 +62,15 @@ _ping_setopt_timeout (obj, timeout) RETVAL int +_ping_setopt_ttl (obj, ttl) + pingobj_t *obj + int ttl + CODE: + RETVAL = ping_setopt (obj, PING_OPT_TTL, &ttl); + OUTPUT: + RETVAL + +int _ping_setopt_source (obj, addr) pingobj_t *obj char *addr diff --git a/bindings/perl/lib/Net/Oping.pm b/bindings/perl/lib/Net/Oping.pm index 92709e4..ff86d4b 100644 --- a/bindings/perl/lib/Net/Oping.pm +++ b/bindings/perl/lib/Net/Oping.pm @@ -49,8 +49,8 @@ host is considered to be unreachable. 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 @@ -78,7 +78,7 @@ 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. @@ -99,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. @@ -122,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