Update copyright notices.
[liboping.git] / src / mans / ping_host_add.pod
1 =head1 NAME
2
3 ping_host_add - Add a host to a liboping object
4
5 =head1 SYNOPSIS
6
7   #include <oping.h>
8
9   int ping_host_add    (pingobj_t *obj, const char *host);
10   int ping_host_remove (pingobj_t *obj, const char *host);
11
12 =head1 DESCRIPTION
13
14 The B<ping_host_add> method tries to resolve the I<host> argument, open a
15 socket and associate everything with the liboping object I<obj>.
16
17 The I<obj> argument is a pointer to an liboping object, as returned by
18 L<ping_construct(3)>.
19
20 The I<host> parameter is a '\0' terminated string which is interpreted as a
21 hostname or an IP address. Depending on the address family setting, set with
22 L<ping_setopt(3)>, the hostname is resolved to an IPv4 or IPv6 address.
23
24 The B<ping_host_remove> method looks for I<host> within I<obj> and remove it if
25 found. It will close the socket and deallocate the memory, too.
26
27 The names passed to B<ping_host_add> and B<ping_host_remove> must match. This
28 name can be queried using L<ping_iterator_get_info(3)>.
29
30 =head1 RETURN VALUE
31
32 If B<ping_host_add> succeeds it returns zero. If an error occurs a value less
33 than zero is returned and the last error is saved internally. You can receive
34 the error message using L<ping_get_error(3)>.
35
36 B<ping_host_remove> returns zero upon success and less than zero if it failed.
37 Currently the only reason for failure is that the host isn't found, but this is
38 subject to change. Use L<ping_get_error(3)> to receive the error message.
39
40 =head1 SEE ALSO
41
42 L<ping_construct(3)>,
43 L<ping_setopt(3)>,
44 L<ping_get_error(3)>,
45 L<liboping(3)>
46
47 =head1 AUTHOR
48
49 liboping is written by Florian "octo" Forster E<lt>ff at octo.itE<gt>.
50 Its homepage can be found at L<http://noping.cc/>.
51
52 Copyright (c) 2006-2017 by Florian "octo" Forster.