NAME

ping_setopt - Set options for a liboping object


SYNOPSIS

  #include <oping.h>
  int ping_setopt (pingobj_t *obj, int opt, void *val);


DESCRIPTION

The ping_setopt method sets options that effect all hosts associated with the object obj and hosts that are yet to be added to the object.

The obj argument is a pointer to an liboping object, as returned by ping_construct(3).

The opt argument specifies the option to set. Use one of the following constants:

PING_OPT_TIMEOUT

The time to wait for a ``echo reply'' to be received; in seconds. In this case the memory pointed to by val is interpreted as a double value and must be greater than zero. The default is PING_DEF_TIMEOUT.

PING_OPT_TTL

The value written into the time-to-live (= TTL) field of generated ICMP packets. The memory pointed to by val is interpreted as an integer. Valid values are 1 through 255. Default is PING_DEF_TTL.

PING_OPT_AF

The address family to use. The memory pointed to by val is interpreted as an integer and must be either AF_UNSPEC, AF_INET, or AF_INET6. This option only effects hosts that are being added after this option has been set. Default is PING_DEF_AF.

The val argument is a pointer to the new value. It must not be NULL. It is dereferences depending on the value of the opt argument, see above. The memory pointed to by val is not changed.


RETURN VALUE

ping_setopt returns zero upon success or less than zero upon failure.


SEE ALSO

ping_construct(3), liboping(3)


AUTHOR

liboping is written by Florian octo Forster <octo at verplant.org>. It's homepage can be found at http://verplant.org/liboping/.

(c) 2005, 2006 by Florian octo Forster.