---
name: "nutscan_cidr_to_ip"
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_cidr_to_ip"
---

# nutscan\_cidr\_to\_ip(3)

Convert a CIDR IP to a range of IP address.

## 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

The **nutscan\_cidr\_to\_ip()** function converts a range of IP address in the CIDR format given as a string in *cidr*, to two IPs in strings pointed by *start\_ip* and *stop\_ip* which can be used as input parameters in the scanning functions of the libnutscan API.

It is the caller’s responsibility to [**free**(3)](/free/3.md) the *start\_ip* and *stop\_ip* strings.

## RETURN VALUE

The **nutscan\_cidr\_to\_ip()** function returns *0* if an error occurred (invalid *cidr* address) or *1* if successful.

## NOTES

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

## SEE ALSO

[**nutscan\_scan\_usb**(3)](/nutscan_scan_usb/3.md), [**nutscan\_scan\_xml\_http\_range**(3)](/nutscan_scan_xml_http_range/3.md), [**nutscan\_scan\_nut**(3)](/nutscan_scan_nut/3.md), [**nutscan\_scan\_avahi**(3)](/nutscan_scan_avahi/3.md), [**nutscan\_scan\_ipmi**(3)](/nutscan_scan_ipmi/3.md), [**nutscan\_scan\_snmp**(3)](/nutscan_scan_snmp/3.md), [**nutscan\_display\_ups\_conf\_with\_sanity\_check**(3)](/nutscan_display_ups_conf_with_sanity_check/3.md), [**nutscan\_display\_parsable**(3)](/nutscan_display_parsable/3.md), [**nutscan\_display\_ups\_conf**(3)](/nutscan_display_ups_conf/3.md)
