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

HOBBITPING(1)						      General Commands Manual						     HOBBITPING(1)

NAME
hobbitping - Xymon ping tool SYNOPSIS
hobbitping [--retries=N] [--timeout=N] [IP-adresses] DESCRIPTION
hobbitping(1) is used for ping testing of the hosts monitored by the xymon(7) monitoring system. It reads a list of IP adresses from stdin, and performs a "ping" check to see if these hosts are alive. It is normally invoked by the bbtest-net(1) utility, which performs all of the Xymon network tests. Optionally, if a list of IP-adresses is passed as commandline arguments, it will ping those IP's instead of reading them from stdin. hobbitping only handles IP-adresses, not hostnames. hobbitping was inspired by the fping(1) tool, but has been written from scratch to implement a fast ping tester without much of the over- head found in other such utilities. The output from hobbitping is similar to that of "fping -Ae". hobbitping probes multiple systems in parallel, and the runtime is therefore mostly dependant on the timeout-setting and the number of retries. With the default options, hobbitping takes approximately 18 seconds to ping all hosts (tested with an input set of 1500 IP adresses). SUID-ROOT INSTALLATION REQUIRED hobbitping needs to be installed with suid-root privileges, since it requires a "raw socket" to send and receive ICMP Echo (ping) packets. hobbitping is implemented such that it immediately drops the root privileges, and only regains them to perform two operations: Obtaining the raw socket, and optionally binding it to a specific source address. These operations are performed as root, the rest of the time hob- bitping runs with normal user privileges. Specifically, no user-supplied data or network data is used while running with root privileges. Therefore it should be safe to provide hobbitping with the necessary suid-root privileges. OPTIONS
--retries=N Sets the number of retries for hosts that fail to respond to the initial ping, i.e. the number of ping probes sent in addition to the initial probe. The default is --retries=2, to ping a host 3 times before concluding that it is not responding. --timeout=N Determines the timeout (in seconds) for ping probes. If a host does not respond within N seconds, it is regarded as unavailable, unless it responds to one of the retries. The default is --timeout=5. --responses=N hobbitping normally stops pinging a host after receiving a single response, and uses that to determine the round-trip time. If the first response takes longer to arrive - e.g. because of additional network overhead when first determining the route to the target host - it may skew the round-trip-time reports. You can then use this option to require N responses, and hobbitping will calculate the round-trip time as the average of all of responsetimes. --max-pps=N Maximum number of packets per second. This limits the number of ICMP packets hobbitping will send per second, by enforcing a brief delay after each packet is sent. The default setting is to send a maximum of 50 packets per second. Note that increasing this may cause flooding of the network, and since ICMP packets can be discarded by routers and other network equipment, this can cause erratic behaviour with hosts recorded as not responding when they are in fact OK. --source=ADDRESS Use ADDRESS as the source IP address of the ping packets sent. On multi-homed systems, allows you to select the source IP of the hosts going out, which might be necessary for ping to work. --debug Enable debug output. This prints out all packets sent and received. SEE ALSO
xymon(7), bbtest-net(1), fping(1) Xymon Version 4.2.3: 4 Feb 2009 HOBBITPING(1)
Man Page