rc_avpair_copy(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_copy β€” from the radcli girlies πŸ’–

okay so bestie, this page lives in the Radius client library man pages (that's the radcli crew, hey fam ✨), and it's about rc_avpair_copy(3). Buckle up, it's short but it SLAPS.


🌸 NAME 🌸

rc_avpair_copy β€”

not me showing you a NAME section with literally nothing after the dash 😭 the description slot is just empty, that's the whole vibe, we move on πŸ’…


✨ SYNOPSIS ✨

#include <radcli/radcli.h>

VALUE_PAIR * rc_avpair_copy(
    VALUE_PAIR  *p
);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so what this does: it hands you back a copy of the existing list p, strdup() style. Like strdup() but for your VALUE_PAIR list, no cap 🫢 duplicate and deliver, periodt.


πŸŽ€ PARAMETERS πŸŽ€

  • p β€” a pointer to a VALUE_PAIR structure. that's it, that's the parameter, one (1) pointer, she's lowkey simple πŸ’–

🧚 STRUCTURES 🧚

⚠️ bestie listen β€” avoid using this structure directly. Use the rc_avpair_get_ functions instead. I'm serious, put it down πŸ™ˆ
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
};

look at her. iconic fields. name, attribute, type, lvalue, strvalue, next, and a whole pad[32] that's just unused β€” she's carrying dead weight and still serving πŸ‘‘


⭐ RETURN VALUE ⭐

the copy of p. yes literally, you give her p, she gives you the copy of p. the transaction is that simple πŸ’œ


🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” go read these too, iykyk:


and that's the whole page bestie, we ate and left zero crumbs πŸ”₯ this one came straight from radcli, dated 2023-01-29, and it's still rc_avpair_copy(3) forever and ever. mwah πŸ’‹ go copy your lists responsibly. πŸ“

πŸ“¦ where this page comes from