---
name: "nutscan_init_ip_ranges"
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_init_ip_ranges"
---

# nutscan\_init\_ip\_ranges(3)

Initialize contents of a \`nutscan\_ip\_range\_list\_t\` structure (and optionally create one in the first place).

## NAME

nutscan\_init\_ip\_ranges - Initialize contents of a \`nutscan\_ip\_range\_list\_t\` structure (and optionally create one in the first place).

## SYNOPSIS

```
        #include <nut-scan.h>
        nutscan_ip_range_list_t * nutscan_init_ip_ranges(nutscan_ip_range_list_t *irl);
```

## DESCRIPTION

The **nutscan\_init\_ip\_ranges()** function can prepare a nutscan\_ip\_range\_list\_t structure by zeroing out its fields. If the argument is NULL, the structure is dynamically allocated. Either way, a pointer to it is returned.

A structure passed by caller is not assumed to have any valid contents to free, as it may have garbage from stack after allocation.

The caller must free the contents of the structure after completing its use by calling nutscan\_free\_ip\_ranges (after which the structure can be re-used), and explicitly free() the structure object itself if it was allocated dynamically (e.g. by originally calling nutscan\_init\_ip\_ranges(NULL)).

## NOTES

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

## SEE ALSO

[**nutscan\_free\_ip\_ranges**(3)](/nutscan_free_ip_ranges/3.md), [**nutscan\_add\_ip\_range**(3)](/nutscan_add_ip_range/3.md), [**nutscan\_stringify\_ip\_ranges**(3)](/nutscan_stringify_ip_ranges/3.md), [**nutscan\_cidr\_to\_ip**(3)](/nutscan_cidr_to_ip/3.md), [**nutscan\_ip\_ranges\_iter\_init**(3)](/nutscan_ip_ranges_iter_init/3.md), [**nutscan\_ip\_ranges\_iter\_inc**(3)](/nutscan_ip_ranges_iter_inc/3.md)
