1ping_host_add(3)                   liboping                   ping_host_add(3)
2
3
4

NAME

6       ping_host_add - Add a host to a liboping object
7

SYNOPSIS

9         #include <oping.h>
10
11         int ping_host_add    (pingobj_t *obj, const char *host);
12         int ping_host_remove (pingobj_t *obj, const char *host);
13

DESCRIPTION

15       The ping_host_add method tries to resolve the host argument, open a
16       socket and associate everything with the liboping object obj.
17
18       The obj argument is a pointer to an liboping object, as returned by
19       ping_construct(3).
20
21       The host parameter is a '\0' terminated string which is interpreted as
22       a hostname or an IP address. Depending on the address family setting,
23       set with ping_setopt(3), the hostname is resolved to an IPv4 or IPv6
24       address.
25
26       The ping_host_remove method looks for host within obj and remove it if
27       found. It will close the socket and deallocate the memory, too.
28
29       The names passed to ping_host_add and ping_host_remove must match. This
30       name can be queried using ping_iterator_get_info(3).
31

RETURN VALUE

33       If ping_host_add succeeds it returns zero. If an error occurs a value
34       less than zero is returned and the last error is saved internally. You
35       can receive the error message using ping_get_error(3).
36
37       ping_host_remove returns zero upon success and less than zero if it
38       failed.  Currently the only reason for failure is that the host isn't
39       found, but this is subject to change. Use ping_get_error(3) to receive
40       the error message.
41

SEE ALSO

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

AUTHOR

46       liboping is written by Florian "octo" Forster <ff at octo.it>.  Its
47       homepage can be found at <http://noping.cc/>.
48
49       Copyright (c) 2006-2017 by Florian "octo" Forster.
50
51
52
531.10.0                            2017-05-11                  ping_host_add(3)
Impressum