rc_avpair_assign3
Assigns the given value to an attribute-value pair.
Usage
#include <radcli/>
int rc_avpair_assign(
VALUE_PAIR *vp,
void const *pval,
int len
);
Overview
If the value is of type PW_TYPE_STRING it must either be a null terminated string with len set to -1, or raw data with length properly set. For PW_TYPE_DATE, PW_TYPE_INTEGER, and PW_TYPE_IPADDR an uint32_t number should be set at pval. For IPv4 addresses it should be in host byte order.
For PW_TYPE_IPV6ADDR type a 16-byte long address is expected, and for PW_TYPE_IPV6PREFIX the rfc3162 prefix format is expected. Simply that is a zero byte, a byte with the value of prefix (e.g., 112), and the remaining bytes are the IPv6 address.
Parameters
|
a pointer to a VALUE_PAIR structure. |
|---|---|
|
the value (e.g., the actual username). |
|
the length of pval, or -1 if to calculate (in case of strings). |
Return value
0 on success or -1 on failure.
Releases
4 releases since Debian 11 (Bullseye); the text changed 1 time.