Manual Reference Pages - LIBOPING (3)
liboping - Library to send ICMPv4/ICMPv6 echo packets to multiple hosts
This is an overview of liboping, a C library to send ICMP ECHO_REQUEST packets
to remote hosts and measure the time it takes for replies to be received. This
method, often simply called ping, is a common way to measure network latency
and/or host reachability.
The goals of this library are to provide the above functionality in a platform
and protocol independent manner. The interface is simple, object oriented and
(hopefully) ANSI-C compliant.
There are two main types that are used by applications. Both are opaque
types, meaning they are structures that are not completely defined in the
header file, so you cannot access the structures members. You dont need to,
dont do it. These structures are subject to change without notice.
Upon startup you usually create one or more pingobj_t objects and add hosts
to it using the ping_host_add method (see below). You periodically send
echo requests using the ping_send method, iterate over all hosts using
ping_iterator_get and ping_iterator_next. For each host you call
ping_iterator_get_info to read the current latency and do something with it.
A ping-object. You can set specific options for this object, add and remove
hosts to/from it and send ICMP packets to all associated hosts. This is often
called a handle.
An iterator over the hosts associated with a pingobj_t object. This iterator
can be used to query more information about a host, for example the hostname,
the measured latency or the current ICMP sequence.
If an error occurs you can use ping_get_error so get information on what
LINKING WITH LIBOPING
Depending on you platform you dont need any extra libraries (e.g. GNU/Linux)
or libsocket (using -lsocket) if the socket function is not in the
C-library. The latter is the case for the Solaris operating system.
All official function or method names are prefixed with ping_. Dont use
any other functions or methods. Although no such functions should exist.
liboping has been designed to be as thread safe a possible. However, this has
not been tested and may need some additional work. Use at your own risk and
please report back any problems or success messages. Thank you :)
liboping is licensed under the GPLv2. No other version of the license is
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 ||LIBOPING (3) ||2011-09-06 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.