rc_avpair_insert(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_insert β€” the radcli manual, but make it make sense πŸ’–

okay bestie, so this is rc_avpair_insert(3) from the Radius client library (radcli, section 3). it's a tiny little function with main character energy: it slides one value pair into a list. that's it. that's the whole vibe. but let's do it properly because we're not messy here πŸ’…


✨ NAME ✨

rc_avpair_insert β€” (yes the original description line is literally empty, no cap, they left it blank, we're not inventing lore)


🌸 SYNOPSIS 🌸

#include <radcli/radcli.h>

void rc_avpair_insert(
    VALUE_PAIR  **a,
    VALUE_PAIR   *p,
    VALUE_PAIR   *b
);

look at her. three args. returns nothing. confident. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, we're inserting a VALUE_PAIR into a list. that's the whole job description.

you hand over the address of an existing list, <pink>a</pink>, plus a pointer to an entry in that list, <pink>p</pink>, and then the value pair <pink>b</pink> gets added to the a list after the p entry. right after. immediately. no gap, no drama. ✨

and the little plot twist: if p is NULL? then b just gets added to the end of a. like, "no anchor point? fine, we're going to the back of the line then." πŸŽ€


πŸ’… PARAMETERS πŸ’…

  • a β€” a VALUE_PAIR array of values. this is the list we're messing with.
  • p β€” a pointer to a VALUE_PAIR in a. this is the "put it right after this one" marker. can be NULL (see above, back of the line behavior).
  • b β€” the VALUE_PAIR pointer to add in a. the little newcomer. the fresh face. the icon. πŸ‘‘

πŸ”₯ STRUCTURES πŸ”₯

avoid using this structure directly. use the rc_avpair_get_ functions. i'm saying it three times because the original says it three times. i don't make the rules bestie, i just relay them faithfully. 🫑
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
};
avoid using this structure directly. use the rc_avpair_get_ functions.
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
};
avoid using this structure directly. use the rc_avpair_get_ functions.
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
};

🌈 SEE ALSO 🌈

the whole friend group, fr fr:


okay and one lil sign-off moment πŸ’Œ β€” this page is from radcli, dated 2023-01-29, and yeah that's the whole thing. go insert your value pairs, bestie, you're doing amazing. πŸ§šπŸ’œ ⭐

πŸ“¦ where this page comes from