Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ping_iterator_get_context(3) [debian man page]

ping_iterator_get_context(3)					     liboping					      ping_iterator_get_context(3)

NAME
ping_iterator_get_context, ping_iterator_set_context - Store host-dependent data SYNOPSIS
#include <oping.h> void *ping_iterator_get_context (pingobj_iter_t *iter); void ping_iterator_set_context (pingobj_iter_t *iter, void *context); DESCRIPTION
ping_iterator_set_context can be used to store host-specific data within the liboping structures. This data can be received again by calling ping_iterator_get_context. The data itself is never touched by liboping. If you call ping_host_remove (see ping_host_add(3)) or ping_destroy (see ping_construct(3)) and the context is not NULL liboping will assume you know what you're doing and simply ignore the fact this might be a memory leak. The iter argument is an iterator object as returned by ping_iterator_get(3) and ping_iterator_next. The context argument of ping_iterator_set_context is a pointer to anything and may be NULL. RETURN VALUE
ping_iterator_get_context returns the same pointer previously passed to ping_iterator_set_context or NULL if ping_iterator_set_context has never been called before. SEE ALSO
ping_iterator_get(3), ping_construct(3), ping_host_add(3), liboping(3) AUTHOR
liboping is written by Florian "octo" Forster <octo at verplant.org>. Its homepage can be found at <http://verplant.org/liboping/>. Copyright (c) 2005-2011 by Florian "octo" Forster. 1.6.2 2012-01-31 ping_iterator_get_context(3)

Check Out this Related Man Page

ping_host_add(3)						     liboping							  ping_host_add(3)

NAME
ping_host_add - Add a host to a liboping object SYNOPSIS
#include <oping.h> int ping_host_add (pingobj_t *obj, const char *host); int ping_host_remove (pingobj_t *obj, const char *host); DESCRIPTION
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 '' 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). RETURN VALUE
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. SEE ALSO
ping_construct(3), ping_setopt(3), ping_get_error(3), liboping(3) AUTHOR
liboping is written by Florian "octo" Forster <octo at verplant.org>. Its homepage can be found at <http://verplant.org/liboping/>. Copyright (c) 2005-2011 by Florian "octo" Forster. 1.6.2 2012-01-31 ping_host_add(3)
Man Page