summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ffe2fe)
raw | patch | inline | side by side (parent: 8ffe2fe)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 18 Jul 2009 12:59:16 +0000 (14:59 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 18 Jul 2009 12:59:16 +0000 (14:59 +0200) |
bindings/perl/Oping.xs | patch | blob | history | |
bindings/perl/lib/Net/Oping.pm | patch | blob | history |
diff --git a/bindings/perl/Oping.xs b/bindings/perl/Oping.xs
index 1327a95c3443299d5ca83455ea57c70dcc2adada..6106e13760cae899222033299c08e0f88ab35b8d 100644 (file)
--- a/bindings/perl/Oping.xs
+++ b/bindings/perl/Oping.xs
OUTPUT:
RETVAL
+int
+_ping_setopt_device (obj, dev)
+ pingobj_t *obj
+ char *dev
+ CODE:
+#if OPING_VERSION >= 1003000
+ RETVAL = ping_setopt (obj, PING_OPT_DEVICE, dev);
+#else
+ RETVAL = -95;
+#endif
+ OUTPUT:
+ RETVAL
+
int
_ping_host_add (obj, host);
pingobj_t *obj
index dc06ad3f592d7ef24ffa75940d1b9db76745e221..9dff945fda3962f5d698fb1f7f7d9ce2bda8bb1c 100644 (file)
return (1);
}
+=item I<$status> = I<$obj>-E<gt>B<device> (I<$device>);
+
+Sets the network device used for communication. This may not be supported on
+all platforms.
+
+I<Requires liboping 1.3 or later.>
+
+=cut
+
+sub device
+{
+ my $obj = shift;
+ my $device = shift;
+ my $status;
+
+ $status = _ping_setopt_device ($obj->{'c_obj'}, $device);
+ if ($status == -95) # Feature not supported.
+ {
+ $obj->{'err_msg'} = "Feature not supported by your version of liboping.";
+ }
+ elsif ($status != 0)
+ {
+ $obj->{'err_msg'} = "" . _ping_get_error ($obj->{'c_obj'});
+ return;
+ }
+
+ return (1);
+}
+
=item I<$status> = I<$obj>-E<gt>B<host_add> (I<$host>, [I<$host>, ...]);
Adds one or more hosts to the Net::Oping-object I<$obj>. The number of