NUTSCAN_SCAN_XML_HTT(3)

πŸ’– NUTSCAN_SCAN_XML_HTT(3) β€” the NUT Manual, bestie edition πŸ’–

okay so this is a page from the NUT Manual (that's Network UPS Tools, iykyk) and it's literally all about sniffing out XML/HTTP devices on your network. put your hair up, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

nutscan_scan_xml_http_range β€” go scan the network for XML/HTTP devices, no cap.


🌸 SYNOPSIS 🌸

#include <nut-scan.h>
#include <unistd.h> /* useconds_t */

nutscan_device_t * nutscan_scan_xml_http_range(
        const char * start_ip,
        const char * end_ip,
        useconds_t usec_timeout,
        nutscan_xml_t * sec)

nutscan_device_t * nutscan_scan_ip_range_xml_http(
        nutscan_ip_range_list_t irl,
        useconds_t usec_timeout,
        nutscan_xml_t * sec)
bestie pls note: yes, the second one takes a nutscan_ip_range_list_t * irl β€” I'm showing you the shape of it, the real signature is exactly the one up there in the code block. copy it, don't freestyle it πŸ’…

πŸ‘‘ DESCRIPTION πŸ‘‘

so the two functions, nutscan_scan_xml_http_range() and nutscan_scan_ip_range_xml_http(), are out here trying to detect NUT compatible XML/HTTP devices. that's the whole job. that's the assignment. ✨

here's the tea on how they decide where to look:

  • if start_ip (for nutscan_scan_xml_http_range()) or irl (for nutscan_scan_ip_range_xml_http()) is NULL, the function in question does the chaotic thing and issues a broadcast message on all currently configured network interfaces. yes, all of them. it's giving "i'll just ask everyone" 🫢
  • otherwise, nutscan_scan_xml_http_range() queries every IP ranging from start_ip to stop_ip, where startIP is mandatory and stopIP is optional β€” if stopIP is NULL, it just scans the one startIP address. meanwhile nutscan_scan_ip_range_xml_http() can walk several IP address ranges represented by a nutscan_ip_range_list_t structure. iconic behavior, honestly.

and those IP arguments? they may be either IPv4 or IPv6 addresses, or even host names. flexible queen 🌈

it waits up to usec_timeout microseconds for a response from potential devices. so like, set that timeout with intention, okay? ⏳

🚨 THE BIG ONE, DO NOT SKIP: You MUST call nutscan_init(3) before using this function. like, before. not after. before. this is not a vibe check you can skip 😭

πŸ’… RETURN VALUE πŸ’…

nutscan_scan_xml_http_range() returns a pointer to a nutscan_device_t structure containing all found devices, or NULL if an error occurs or no device is found. that's it. that's the return. either you get the goods or you get nothing, no in-between πŸŽ€


πŸ¦‹ SEE ALSO πŸ¦‹

go read these too, bestie, they're all part of the family:


okay that's the whole page, you ate it πŸ’– this came to you from Network UPS Tools 2.8.5, dated 10/07/2026 β€” main character energy, periodt. now go call nutscan_init(3) first, I'm literally begging 🫢✨

πŸ“¦ where this page comes from