rc_avpair_get_in6(3)

πŸ“¦
version 1.5.2 Β· 4 versions
, in alpine 3.24, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– rc_avpair_get_in6 β€” bestie's guide to yanking IPv6 addys out of a value-pair πŸ’–

okay so real talk, this one lives in the Radius client library, and its manual page is literally rc_avpair_get_in6(3). She's a lil function that pulls IPv6 info out of an attribute value-pair. No cap. Let's get into it πŸ¦‹


✨ NAME ✨

rc_avpair_get_in6 β€” (yeah the original page literally leaves the description blank, iconic behaviour honestly, the synopsis speaks for itself πŸ’…)


🌸 SYNOPSIS 🌸

#include <radcli/radcli.h>

int rc_avpair_get_in6(
    VALUE_PAIR       *vp,
    struct in6_addr  *res,
    unsigned         *prefix
);

πŸŽ€ DESCRIPTION πŸŽ€

She gets the IPv6 address and prefix value of the given attribute value-pair. That's the whole job, and she does it slayfully.

This function is valid for PW_TYPE_IPV6ADDR and PW_TYPE_IPV6PREFIX. Like, those are the only types she fw. Anything else? Not her problem, bestie 😭


🫢 PARAMETERS 🫢

  • vp β€” a pointer to a VALUE_PAIR structure. This is the thing you're snooping through.
  • res β€” an in6_addr structure for the result to be copied in. That's where the address lands, periodt.
  • prefix β€” if it's of type PW_TYPE_IPV6PREFIX the prefix will be copied in here (may be NULL, so it's optional, lowkey chill about it).

🧚 STRUCTURES 🧚

⚠️ bestie please β€” avoid using this structure directly. Use the rc_avpair_get_ functions. Direct struct access is giving chaos energy.
struct rc_value_pair {
  char                   name[RC_NAME_LENGTH+1];      // attribute name if known.
  uint64_t               attribute; // attribute numeric value of type rc_attr_id including vendor; use VENDOR() and ATTRID() to separate.
  rc_attr_type           type;      // attribute type.
  uint32_t               lvalue;    // attribute value if type is PW_TYPE_INTEGER, PW_TYPE_DATE or PW_TYPE_IPADDR.
  char                   strvalue[AUTH_STRING_LEN+1];  // contains attribute value in other cases.
  struct rc_value_pair  *next;
  char                   pad[32];       // unused pad
};

🌈 RETURN VALUE 🌈

  • zero on success πŸŽ‰
  • -1 on failure πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

The whole friend group showed up, fr fr:


and that's the whole page, bestie 🫢 this one's brought to you by radcli, dated 2023-01-29 β€” go forth and parse those IPv6 addys, you absolute icon πŸ’œβœ¨

πŸ“¦ where this page comes from