Code

Created standard subversion directories.
[liboping.git] / src / mans / ping_host_add.pod
1 =head1 NAME
3 ping_host_add - Add a host to a liboping object
5 =head1 SYNOPSIS
7   #include <oping.h>
9   int ping_host_add    (pingobj_t *obj, const char *host);
10   int ping_host_remove (pingobj_t *obj, const char *host);
12 =head1 DESCRIPTION
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>.
17 The I<obj> argument is a pointer to an liboping object, as returned by
18 L<ping_construct(3)>.
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.
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.
27 =head1 RETURN VALUE
29 If B<ping_host_add> succeeds it returns zero. If an error occurs a value less
30 than zero is returned and the last error is saved internally. You can receive
31 the error message using L<ping_get_error(3)>.
33 B<ping_host_remove> returns zero upon success and less than zero if it failed.
34 Currently the only reason for failure is that the host isn't found, but this is
35 subject to change. Use L<ping_get_error(3)> to receive the error message.
37 =head1 SEE ALSO
39 L<ping_construct(3)>,
40 L<ping_setopt(3)>,
41 L<ping_get_error(3)>,
42 L<liboping(3)>
44 =head1 AUTHOR
46 liboping is written by Florian octo Forster E<lt>octo at verplant.orgE<gt>.
47 It's homepage can be found at L<http://verplant.org/liboping/>.
49 (c) 2005, 2006 by Florian octo Forster.