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 to free(3) the start_ip and stop_ip strings. 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 πŸ’œ:


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