liboping(3)
π liboping β the manual page, but make it make sense π
okay bestie, gather round, because we're talking about liboping(3) β the C library that lets you yeet ICMP ECHO_REQUEST packets at a whole squad of hosts and time how long the replies take to come back. it's ping, but as a library. you're gonna slay. β¨
π DESCRIPTION
so here's the vibe: this is the overview of liboping, a C library that sends ICMP ECHO_REQUEST packets to remote hosts and measures how long it takes for the replies to show up. this method is often just called "ping", and it's the classic way to measure network latency and/or whether a host is even reachable. fr fr, it's the og vibe check for a server.
the goals of this library are to give you all that functionality in a platform and protocol independent way. the interface is simple, object oriented, and (hopefully) ANSI-C compliant. we love a portable queen. π
π«Ά GENERAL USAGE
there are two main types that applications use. both are "opaque types", meaning they're 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". it's giving main character energy.pingobj_iter_tβ an iterator over the hosts associated with apingobj_tobject. you use this iterator to query more info about a host β like the hostname, the measured latency, or the current ICMP sequence. iconic.
upon startup you usually create one or more pingobj_t objects and add hosts to it using the ping_host_add method (see below, bestie, it's all connected π
). you periodically send "echo requests" using the ping_send method, then 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. that's the whole loop, and it ate. π₯
if an error occurs you can use ping_get_error to get information on what failed. so when it's not working, you actually know why. not me being emotional support for your segfault. π
π LINKING WITH LIBOPING
depending on your platform you don't need any extra libraries (e.g. GNU/Linux) β or you need libsocket (by using -lsocket) if the socket function is not in the C-library. the latter is the case for the Solaris operating system. so like, Solaris girlies, link accordingly. periodt.
β 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. so like... there's nothing else to use anyway. mystery solved. π¦
π THREAD SAFETY
liboping has been designed to be as thread safe as possible. however, this has not been tested and may need some additional work. so use at your own risk, and please report back any problems or success messages. thank you :) π«Ά
bestie. i cannot stress this enough. not tested. tread carefully and text me how it goes. π
π SEE ALSO
ping_construct(3)ping_setopt(3)ping_host_add(3)ping_send(3)ping_get_error(3)ping_iterator_count(3)ping_iterator_get(3)ping_iterator_get_info(3)ping_iterator_get_context(3)
π LICENSE
liboping is licensed under the LGPL 2.1 or later.
π AUTHOR
liboping is written by Florian "octo" Forster <ff at octo.it>. its homepage can be found at <http://noping.cc/>. go give it a look, bestie, show some love. πΈ
Copyright (c) 2006-2017 by Florian "octo" Forster.
and that's the whole thing, no cap. this was liboping version 1.10.0, dated 2017-05-11 β a true classic, an icon, a legend, and honestly the moment. go ping something. πβ¨
π¦ where this page comes from
- alpine 3.24: liboping-doc 1.10.0-r2 Β· LGPL-2.0-or-later
- epel 10: liboping-devel 1.10.0-33.el10_0 Β· GPL-2.0-only
- epel 9: liboping-devel 1.10.0-19.el9 Β· GPLv2
- fedora 43: liboping-devel 1.10.0-35.fc43 Β· GPL-2.0-only
- fedora 43: liboping-devel 1.10.0-35.fc43 Β· GPL-2.0-only
- fedora 44: liboping-devel 1.10.0-36.fc44 Β· GPL-2.0-only
- fedora 44: liboping-devel 1.10.0-36.fc44 Β· GPL-2.0-only
- nixos 26.05: liboping 1.10.0
- nixpkgs unstable: liboping 1.10.0
- opensuse-leap 16.0: liboping-devel 1.10.0-bp160.1.14 Β· LGPL-2.1-only
- opensuse-leap 16.0: liboping-devel 1.10.0-bp160.1.14 Β· LGPL-2.1-only
- opensuse-leap 16.0: liboping-devel 1.10.0-bp160.1.14 Β· LGPL-2.1-only
- opensuse-leap 16.0: liboping-devel 1.10.0-bp160.1.14 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms