Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

liboping(3) [debian man page]

liboping(3)							     liboping							       liboping(3)

NAME
liboping - Library to send ICMPv4/ICMPv6 echo packets to multiple hosts DESCRIPTION
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. GENERAL USAGE
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 don't need to, don't do it. These structures are subject to change without notice. "pingobj_t" 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". "pingobj_iter_t" 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. 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. If an error occurs you can use "ping_get_error" so get information on what failed. LINKING WITH LIBOPING
Depending on you platform you don't 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. SYMBOL NAMES
All "official" function or method names are prefixed with "ping_". Don't use any other functions or methods. Although no such functions should exist. THREAD SAFETY
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 :) SEE ALSO
ping_construct(3), ping_setopt(3), ping_host_add(3), ping_send(3), ping_get_error(3), ping_iterator_get(3), ping_iterator_get_info(3), ping_iterator_get_context(3) LICENSE
liboping is licensed under the GPLv2. No other version of the license is applicable. 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 liboping(3)

Check Out this Related Man Page

ping(8) 						      System Manager's Manual							   ping(8)

Name
       ping - send ICMP ECHO_REQUEST packets to network hosts

Syntax
       /etc/ping [ options ] host [ datasize [ npackets ]]

Description
       The  DARPA  Internet  is  a large and complex network of hardware connected together by gateways.  The command utilizes the ICMP protocol's
       mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.	ECHO_REQUEST datagrams (pings) have an IP and ICMP
       header,	followed  by  a  struct timeval, and then an arbitrary number of pad bytes used to fill out the packet.  The length of the default
       datagram 64 bytes, but this may be changed using the command-line option.

       Typing ``ping host'' without any options will either report ``host is alive'' or ``no answer from host''.  To get more statistics  use  the
       -l option or one of the other options.

       When  using  for  fault	isolation,  it should first be run on the local host to verify that the local network interface is up and running.
       Then, hosts and gateways further and further away should be pinged.  The command with options sends one datagram per second and prints  one
       line  of  output  for every ECHO_RESPONSE returned.  No output is produced if there is no response.  If an optional npackets is given, only
       that number of requests is sent.  Round-trip times and packet loss statistics are computed.  When all responses have been received  or  the
       program times out with npackets specified, or if the program is terminated with a SIGINT, a brief summary is displayed.

Options
       -d   Turns on SO_DEBUG flag on the socket.

       -l   Gives more statistics than if is used without options.  Long output.

       -r   Bypasses  the  normal  routing  tables and sends directly to a host on an attached network.  If the host is not on a directly-attached
	    network, an error is returned.  This option can be used to ping a local host through an interface that has no route through  it.   For
	    example, after the interface was dropped by

       -v   Lists ICMP packets other than ECHO RESPONSE that are received. Verbose output.

Restrictions
       This  program is intended for use in network testing, measurement, and management.  It should be used primarily for manual fault isolation.
       Because of the load it could impose on the network, it is unwise to use during normal operations or from automated scripts.

See Also
       netstat(1), ifconfig(8c)

																	   ping(8)
Man Page