rc_avpair_gen3
Decode a raw radius attribute buffer into a value_pair list.
Usage
#include <radcli/>
VALUE_PAIR * rc_avpair_gen(
rc_handle const *rh,
VALUE_PAIR *pair,
unsigned char const *ptr,
int length,
uint32_t vendorspec
);
Overview
This is a low-level function retained for ABI compatibility with freeradius-client and radiusclient-ng. Application code should not call it directly; build requests with rc_avpair_add() and send them with rc_auth() or rc_acct(), which handle wire encoding and decoding internally.
Decodes the attribute/value region of a received RADIUS packet (the bytes that follow the 20-byte fixed header) into a linked list of VALUE_PAIR structures. Unknown attributes are logged and skipped; they are not a hard error.
Parameters
rh-
a handle to parsed configuration (used for dictionary lookups).
pair-
optional existing VALUE_PAIR list to append decoded attributes to; pass NULL to start a fresh list.
ptr-
pointer to the start of the attribute data region.
length-
number of bytes in the attribute region.
vendorspec-
vendor PEN when decoding a vendor-specific sub-attribute block; pass 0 for top-level packet attributes.
Return value
head of the (possibly extended) VALUE_PAIR list, or NULL on a hard decode error (malformed length field, allocation failure).
Releases
4 releases since Debian 11 (Bullseye); the text changed 1 time.