ping_iterator_get_info(3)
π ping_iterator_get_info(3) β the liboping bestie era π
okay so bestie, welcome to liboping's little info-dispenser. this is the man page for ping_iterator_get_info, and yes it's a whole vibe. π¦
β¨ NAME β¨
ping_iterator_get_info β get the tea about a host π
πΈ SYNOPSIS πΈ
#include <oping.h>
int ping_iterator_get_info (pingobj_iter_t *iter,
int info,
void *buffer,
size_t *buffer_len);
π DESCRIPTION π
The ping_iterator_get_info method can be used on a host iterator to return various information about the current host. it's giving "tell me everything about this host" energy fr fr π
The iter argument is an iterator as returned by ping_iterator_get(3) or ping_iterator_next(3). you know, the lil pointer that's like "this one, this host right here."
The info argument specifies the type of information returned. Use the following defines:
PING_INFO_USERNAMEβ Return the hostname of the host the iterator points to as supplied by the user. This is the name you passed toping_host_add(3)and which you need to pass to"ping_host_remove", too. so basically the name you gave it, not whatever the internet decided to call it. iconic πPING_INFO_HOSTNAMEβ Return the hostname of the host the iterator points to. Since the name is looked up using the socket address this may differ from the hostname passed toping_host_add(3). The hostname is actually looked up every time you call this method, no cache is involved within liboping. no cap, every single time. π«
It is recommended to include"netdb.h"and allocateNI_MAXHOSTbytes of buffer.
PING_INFO_ADDRESSβ Return the address used in ASCII (i.e. human readable) format. The address is looked up every time you call this method. 40 bytes should be sufficient for the buffer (16 octets in hex format, seven colons and one null byte), but more won't hurt. β¨PING_INFO_FAMILYβ Returns the address family of the host. The buffer should be big enough to hold an integer. The value is eitherAF_INETorAF_INET6. pick a lane bestie π«PING_INFO_LATENCYβ Return the last measured latency or less than zero if the timeout occurred before a echo response was received. The buffer should be big enough to hold adoublevalue. she's fast, she's slow, or she ghosted you entirely πPING_INFO_DROPPEDβ Return the number of times that no response was received within the timeout. This value is only increased but may wrap around at the 32 bit boundary. The buffer should be big enough to hold a 32 bit integer, e. g. an"uint32_t".PING_INFO_SEQUENCEβ Return the last sequence number sent. This number is increased regardless of echo responses being received or not. The buffer should hold an integer. it's keeping count whether or not anyone's answering, main character energy πPING_INFO_IDENTβ Return the ident that is put into every ICMP packet sent to this host. Per convention this usually is the PID of the sending process, but since liboping can handle several hosts in parallel it uses a (pseudo-)random number here. The buffer should be big enough to hold an integer value. π²PING_INFO_RECV_TTLβ Returns the time to live (TTL) of the received network packets. This number depends on the value that was used by the remote host when it sent the echo reply and has nothing to do with thePING_OPT_TTLofping_setopt(3). The buffer should be big enough to hold an integer value. not the same thing bestie, don't get it twisted πPING_INFO_RECV_QOSβ Returns the value of the Quality of Service (QoS) byte of the incoming IPv4 or IPv6 packet. This byte is not interpreted by liboping at all and may be DSCP / ECN or precedence / ToS depending on your network setup. Please see the appropriate RFCs for further information on values you can expect to receive. The buffer is expected to an"uint8_t". π
The buffer argument is a pointer to an appropriately sized area of memory where the result of the call will be stored. The buffer_len value is used as input and output: When calling ping_iterator_get_info it reports the size of the memory region pointed to by buffer. The method will write the number of bytes actually written to the memory into buffer_len before returning. so she reads it, then she writes it. multi-talented fr π§
π₯ RETURN VALUE π₯
ping_iterator_get_info returns zero if it succeeds. slay. β¨
EINVAL is returned if the value passed as info is unknown. Both, buffer and buffer_len, will be left untouched in this case. she didn't touch anything, she's innocent π
If the requested information didn't fit into buffer then the size that would have been needed is written into buffer_len; buffer itself is left untouched. The return value is ENOMEM in this case. your buffer was too smol, so here's how big it should've been π
π SEE ALSO π
ping_iterator_get(3), liboping(3)
π AUTHOR π
liboping is written by Florian "octo" Forster <ff at octo.it>. Its homepage can be found at <http://noping.cc/>.
Copyright (c) 2006-2017 by Florian "octo" Forster.
and that's the whole page bestie π«Ά this was liboping 1.10.0, dated 2017-05-11, and it's the ping_iterator_get_info(3) manual page. go forth and query your hosts, you absolute icon πβ¨π
π¦ 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