---
name: "nutscan_ip_ranges_iter_init"
section: "3"
platform: "linux"
package: "nut"
version: "2.8.5-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/nutscan_ip_ranges_iter_init"
---

# nutscan\_ip\_ranges\_iter\_init(3)

Begin iteration of an IP address range using a \`nutscan\_ip\_range\_list\_iter\_t\` structure.

## NAME

nutscan\_ip\_ranges\_iter\_init - Begin iteration of 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

The **nutscan\_ip\_ranges\_iter\_init()** function can prepare an iterator from the specified nutscan\_ip\_range\_list\_t structure, saving it into the caller-provided nutscan\_ip\_range\_list\_iter\_t helper object.

Different iterators may be created to walk the same nutscan\_ip\_range\_list\_t list from different scans independently, but the list and its contents should not be freed while anyone references it.

This function skips work if:

• the structure pointer is NULL (NULL is returned);

• the structure pointer’s ip\_range list is NULL (NULL is returned).

Returns the first IP address from the first registered IP address range. Subsequent addresses can be returned by nutscan\_ip\_ranges\_iter\_inc(). The caller SHOULD NOT free this string while iterating.

## NOTES

Technically, the function is currently defined in *nutscan-ip.h* file.

## SEE ALSO

[**nutscan\_init\_ip\_ranges**(3)](/nutscan_init_ip_ranges/3.md), [**nutscan\_free\_ip\_ranges**(3)](/nutscan_free_ip_ranges/3.md), [**nutscan\_cidr\_to\_ip**(3)](/nutscan_cidr_to_ip/3.md), [**nutscan\_ip\_ranges\_iter\_inc**(3)](/nutscan_ip_ranges_iter_inc/3.md)
