NOZZLE_GET_IPS(3)

πŸ’– NOZZLE_GET_IPS(3) πŸ’–

okay bestie, welcome to the Kronosnet Programmer's Manual ✨ this one's about nozzle_get_ips, and it's lowkey one of the most useful little guys in the whole libnozzle friend group. sit down, hydrate, let's go 🫢


✨ NAME ✨

nozzle_get_ips β€” retrieve the list of all configured ips for a given interface

like. it goes and gets the IPs. all of them. for the interface you asked about. that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

#include <libnozzle.h>

int nozzle_get_ips(
    const nozzle_t       nozzle,
    struct nozzle_ip   **nozzle_ip
);

πŸ¦‹ DESCRIPTION πŸ¦‹

nozzle_get_ips πŸŽ€

here's who's who in this function call, bestie:

  • nozzle β€” pointer to the nozzle struct. yes, the nozzle. the whole point of the library. give it here 🫴
  • nozzle_ip β€” pointer to the head of a list of nozzle_ip structs. the last IP in that list will have next = NULL, so that's how you know you've hit the end (iconic linked-list behaviour, we love a clean sentinel πŸ‘‘). nozzle_ip can be NULL if there are no IP addresses associated with this nozzle device β€” no IPs, no problem, it just hands you a whole lot of nothing πŸ“
🚨 DO NOT free those structs. they are used internally for IP address tracking. hands off, bestie. that memory is not yours, it's the library's, and it will notice. βœ‹πŸ’€

πŸ’œ STRUCTURES πŸ’œ

here's the tea on an IP address on a nozzle interface, as returned from nozzle_get_ips 🧚

struct nozzle_ip {
    char     ipaddr[IPADDR_CHAR_MAX+1];  /* The IP address */
    char     prefix[PREFIX_CHAR_MAX+1];  /* Prefix - eg "24" */
    int      domain;                     /* AF_INET or AF_INET6 */
    struct   next;                       /* Pointer to next struct or NULL */
};

field-by-field, no cap:

  • ipaddr β€” the IP address, fr fr πŸ“
  • prefix β€” the prefix, e.g. "24" (yes literally the string "24", it said so) 🌈
  • domain β€” AF_INET or AF_INET6, pick your fighter ⭐
  • next β€” pointer to next struct or NULL. the chain continues, or it doesn't. vibe check complete πŸ’…

πŸ”₯ RETURN VALUE πŸ”₯

  • 0 on success πŸŽ‰
  • -1 on error, and errno is set 😭

that's it. that's the whole scoring system. binary. main character energy.


🌟 SEE ALSO 🌟

the whole squad, in this exact order, because we respect the roster:


Copyright (C) 2010-2026 Red Hat, Inc. All rights reserved.


and that's the page, bestie!! this was kronosnet's very own NOZZLE_GET_IPS(3), dated 2026-07-20 β€” screenshot it, cite it, love it, and remember: don't free the structs πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from