The B<ping_setopt> method sets options that effect all hosts associated with
the object I<obj> and hosts that are yet to be added to the object.
-The I<obj> argument is a pointer to an liboping object, as returned by
+The I<obj> argument is a pointer to an I<liboping> object, as returned by
L<ping_construct(3)>.
The I<opt> argument specifies the option to set. Use one of the following
-constants:
+constants. You can check if the required constant is supported by the library
+at compile time using C<#ifdef>. It is recommended to check for desired
+features using the C<OPING_VERSION> define.
=over 4
The address family to use. The memory pointed to by I<val> is interpreted as an
integer and must be either B<AF_UNSPEC>, B<AF_INET>, or B<AF_INET6>. This
option only effects hosts that are being added B<after> this option has been
-set. Default is B<PING_DEF_AF>.
+set. Default is B<PING_DEF_AF>. If you change this option, and a source address
+is set (see B<PING_OPT_SOURCE>) that setting will be reset.
=item B<PING_OPT_DATA>
packet size of an ICMPv4 packet is exactly 64 bytes. That's the behavior of the
L<ping(1)> command.
+=item B<PING_OPT_SOURCE>
+
+Set the source address to use. The value passed must be a char-pointer to a
+null-terminated string. This option will ignore the address family setting (as
+set with B<PING_OPT_AF>) and will set the object's address family according to
+the source address assigned.
+
=back
The I<val> argument is a pointer to the new value. It must not be NULL. It is
-dereferences depending on the value of the I<opt> argument, see above. The
+dereferenced depending on the value of the I<opt> argument, see above. The
memory pointed to by I<val> is not changed.
=head1 RETURN VALUE
liboping is written by Florian octo Forster E<lt>octo at verplant.orgE<gt>.
It's homepage can be found at L<http://verplant.org/liboping/>.
-(c) 2005, 2006 by Florian octo Forster.
+(c) 2005-2009 by Florian octo Forster.