NUTSCAN_CIDR_TO_IP(3)
π NUTSCAN_CIDR_TO_IP π
okay bestie, so this is a page from the NUT Manual β yes, that's the Network UPS Tools manual, and the function we're stanning today is nutscan_cidr_to_ip, living its best life over in section 3 of the manual (that's the library-functions section, iykyk). π
β¨ NAME β¨
nutscan_cidr_to_ip β convert a CIDR IP to a range of IP address. π
β¨ SYNOPSIS β¨
#include <nut-scan.h>
int nutscan_cidr_to_ip(const char * cidr, char ** start_ip, char ** stop_ip);
β¨ DESCRIPTION β¨
so the way that nutscan_cidr_to_ip() works is literally iconic: you hand it a range of IP address written in CIDR format as a string in cidr, and it gives you back two IPs as strings β pointed to by start_ip and stop_ip π¦ β and those two lil cuties can be used as input parameters in the scanning functions of the libnutscan API. no cap. π₯
β οΈ bestie listen β it is the caller's responsibility tofree(3)thestart_ipandstop_ipstrings. like, that's on you. don't be the girl who leaks memory, we are not doing that in this house π
β¨ RETURN VALUE β¨
nutscan_cidr_to_ip() returns 0 if an error occurred (invalid cidr address) π or 1 if successful β¨. that's it, that's the vibe check. two outcomes, no in-between. π
β¨ NOTES β¨
technically π§ the function is currently defined in nutscan-ip.h file. not the file you'd guess from the vibe, but okay, slay, we move. π
β¨ SEE ALSO β¨
your girl is not doing this alone, here's the whole squad π:
nutscan_scan_usb(3)nutscan_scan_xml_http_range(3)nutscan_scan_nut(3)nutscan_scan_avahi(3)nutscan_scan_ipmi(3)nutscan_scan_snmp(3)nutscan_display_ups_conf_with_sanity_check(3)nutscan_display_parsable(3)nutscan_display_ups_conf(3)
okay that's the whole page bestie, go forth and convert those CIDRs responsibly π«ΆπΈ
Network UPS Tools 2.8.5 β¨ 10/07/2026 β¨ that's the version and the date, mwah π β and yes, this whole thing is NUTSCAN_CIDR_TO_IP(3), periodt. π
π¦ where this page comes from
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms