NUTSCAN_IP_RANGES_IT(3)
π NUTSCAN_IP_RANGES_IT(3) β like, the NUT Manual bestie β¨
okay so real talk, this is the NUTSCAN_IP_RANGES_IT page from the NUT Manual, and it's all about one very specific little function that gets your IP-address-range walk started π
π NAME π
nutscan_ip_ranges_iter_init β start iterating over an IP address range using a nutscan_ip_range_list_iter_t structure π¦
β¨ SYNOPSIS β¨
#include <nut-scan.h>
char * nutscan_ip_ranges_iter_init(
nutscan_ip_range_list_iter_t *irliter,
const nutscan_ip_range_list_t *irl);
πΈ DESCRIPTION πΈ
So nutscan_ip_ranges_iter_init() is the glow-up moment for your iterator π
What it does is take the nutscan_ip_range_list_t structure you hand it and prep an iterator out of it, tucking it all neatly into the caller-provided nutscan_ip_range_list_iter_t helper object. Very demure, very mindful, very "here's your iterator bestie" π«Ά
You can absolutely make different iterators to walk the same nutscan_ip_range_list_t list from different scans, all independently β no gatekeeping here π BUT (and this is the important part, ngl) the list and everything inside it should not be freed while literally anyone still references it. That's a one-way ticket to undefined-behavior city ππ
Also, the way this function is not about doing work when it doesn't have to be β it skips work if:
- the structure pointer is
NULL(NULLis returned) π - the structure pointer's
ip_rangelist isNULL(NULLis returned) π
When it does do the thing, it returns the first IP address from the first registered IP address range β¨ The addresses after that one? Those come from nutscan_ip_ranges_iter_inc(), iykyk π₯
The caller SHOULD NOT free this string while iterating. fr fr, don't do it π¨
π§ NOTES π§
Technically (and this is the fun little lore drop π), the function is currently defined in the nutscan-ip.h file.
π¦ SEE ALSO π¦
nutscan_init_ip_ranges(3)nutscan_free_ip_ranges(3)nutscan_cidr_to_ip(3)nutscan_ip_ranges_iter_inc(3)
mwah, that's the whole page π β brought to you by Network UPS Tools 2.8.5, dated 06/21/2026. go forth and iterate, bestie πβ
π¦ where this page comes from
- arch rolling: nut 2.8.5-2 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms