UPSCLI_SPLITADDR(3)
π UPSCLI_SPLITADDR(3) π
okay so bestie, welcome to the NUT Manual</> β¨ this one's upscli_splitaddr, and it's literally the little guy whose whole job is taking a listening address and breaking it into pieces. no cap. π
β¨ NAME β¨
upscli_splitaddr β split a listening address into its components π¦
πΈ SYNOPSIS πΈ
#include <upsclient.h>
int upscli_splitaddr(const char *buf, char **hostname,
int *port)
π DESCRIPTION π
so the way that upscli_splitaddr() works is: you hand it a pointer to the listening address definition buf, and it gives you back a pointer to dynamically allocated memory</> in hostname. it also copies the port number into port. that's it, that's the whole vibe. π
π FORMATTING π
a listening address definition has to be specified according to this format, periodt:
<hostname>[:<port>]
and if you're out here giving a definition with no explicit port value? no worries, it gets the default value of 3493. iconic default behaviour tbh. π
π«Ά MEMORY USAGE π«Ά
bestie LISTEN. you mustfree(3)the pointerhostnamewhen you are done with it to avoid memory leaks. that's not a suggestion, that's a whole lifestyle. don't leave your girlhostnamehanging π
β RETURN VALUE β
upscli_splitaddr() returns 0 on success, or -1 if an error occurs. simple. clean. slay. π
π₯ SEE ALSO π₯
upscli_fd(3)upscli_get(3)upscli_readline(3)upscli_sendline(3)upscli_splitname(3)upscli_ssl(3)upscli_strerror(3)upscli_upserror(3)
and that's the whole page, bestie! π§ this was Network UPS Tools 2.8.5, dated 10/07/2026, and you can find it filed under UPSCLI_SPLITADDR(3). go free your memory and stay hydrated ππβ¨
π¦ where this page comes from
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms