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 (NULL is returned) πŸ™ˆ
  • the structure pointer's ip_range list is NULL (NULL is 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 πŸ¦‹


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