"Fossies" - the Fresh Open Source Software Archive

Member "liboping-1.10.0/src/mans/ping_host_add.pod" (11 May 2017, 1723 Bytes) of package /linux/privat/liboping-1.10.0.tar.gz:

Caution: As a special service "Fossies" has tried to format the requested pod source page into HTML format but links to other pod pages may be missing or even erroneous. Alternatively you can here view or download the uninterpreted pod source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "ping_host_add.pod": 1.9.0_vs_1.10.0.


ping_host_add - Add a host to a liboping object


  #include <oping.h>

  int ping_host_add    (pingobj_t *obj, const char *host);
  int ping_host_remove (pingobj_t *obj, const char *host);


The ping_host_add method tries to resolve the host argument, open a socket and associate everything with the liboping object obj.

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

The host parameter is a '\0' terminated string which is interpreted as a hostname or an IP address. Depending on the address family setting, set with ping_setopt(3), the hostname is resolved to an IPv4 or IPv6 address.

The ping_host_remove method looks for host within obj and remove it if found. It will close the socket and deallocate the memory, too.

The names passed to ping_host_add and ping_host_remove must match. This name can be queried using ping_iterator_get_info(3).


If ping_host_add succeeds it returns zero. If an error occurs a value less than zero is returned and the last error is saved internally. You can receive the error message using ping_get_error(3).

ping_host_remove returns zero upon success and less than zero if it failed. Currently the only reason for failure is that the host isn't found, but this is subject to change. Use ping_get_error(3) to receive the error message.


ping_construct(3), ping_setopt(3), ping_get_error(3), liboping(3)


liboping is written by Florian "octo" Forster <ff at octo.it>. Its homepage can be found at http://noping.cc/.

Copyright (c) 2006-2017 by Florian "octo" Forster.