|
Radcli library 2.0.0
A simple radius library -- new API reference
|
Convenience wrappers over radcli_dict_lookup_num() + the matching radcli_avp_add_*(), for the common case of a well-known attribute a caller already has a legacy PW_* constant for. More...
Functions | |
| int | radcli_avp_add_bytes_by_num (radcli_avp_list *list, const radcli_ctx *ctx, uint32_t attrid, uint32_t vendor, const void *value, size_t len) |
| Look up an attribute by legacy numeric ID and append its bytes. | |
| int | radcli_avp_add_str_by_num (radcli_avp_list *list, const radcli_ctx *ctx, uint32_t attrid, uint32_t vendor, const char *value) |
| Look up a string-typed attribute by legacy numeric ID and append it. | |
| int | radcli_avp_add_uint32_by_num (radcli_avp_list *list, const radcli_ctx *ctx, uint32_t attrid, uint32_t vendor, uint32_t value) |
| Look up an integer/IPv4-address/date-typed attribute by legacy numeric ID and append it. | |
| int | radcli_avp_add_uint64_by_num (radcli_avp_list *list, const radcli_ctx *ctx, uint32_t attrid, uint32_t vendor, uint64_t value) |
| Look up a 64-bit integer-typed attribute by legacy numeric ID and append it. | |
| int | radcli_avp_add_ip4_by_num (radcli_avp_list *list, const radcli_ctx *ctx, uint32_t attrid, uint32_t vendor, struct in_addr value) |
| Look up an IPv4-address-typed attribute by legacy numeric ID and append it. | |
| int | radcli_avp_add_ip6_by_num (radcli_avp_list *list, const radcli_ctx *ctx, uint32_t attrid, uint32_t vendor, const struct in6_addr *value, unsigned prefix) |
| Look up an IPv6-address or IPv6-prefix-typed attribute by legacy numeric ID and append it. | |
| int | radcli_avp_add_ip4prefix_by_num (radcli_avp_list *list, const radcli_ctx *ctx, uint32_t attrid, uint32_t vendor, struct in_addr value, unsigned prefix) |
| Look up an IPv4-prefix-typed attribute by legacy numeric ID and append it. | |
Convenience wrappers over radcli_dict_lookup_num() + the matching radcli_avp_add_*(), for the common case of a well-known attribute a caller already has a legacy PW_* constant for.
Each folds a radcli_dict_lookup_num() call into the add itself, so appending a well-known attribute (e.g. one of the RFC 2865/2866/2869 attributes the built-in dictionary radcli_ctx_read_config() loads always carries) is back to a single call with a single failure path, instead of a separate lookup, a NULL check on its result, and then the add – exactly the rc_avpair_add() shape radcli.h callers are used to. The un-suffixed radcli_avp_add_*() functions remain the right choice when a radcli_attr_def is already in hand (e.g. reused across a loop, or obtained via radcli_dict_lookup()/radcli_dict_lookup_oid() for a name or OID rather than a numeric ID), or when a NULL from the lookup is a meaningful, distinct outcome the caller wants to detect on its own (e.g. an attribute that depends on an optional, caller-supplied dictionary).
| int radcli_avp_add_bytes_by_num | ( | radcli_avp_list * | list, |
| const radcli_ctx * | ctx, | ||
| uint32_t | attrid, | ||
| uint32_t | vendor, | ||
| const void * | value, | ||
| size_t | len ) |
Look up an attribute by legacy numeric ID and append its bytes.
| list | destination list. |
| ctx | a context with a dictionary loaded. |
| attrid | the attribute ID (a PW_* constant, or a vendor type ID when vendor is non-zero). |
| vendor | the vendor PEN, or 0 for a standard attribute. |
| value | the bytes to copy in; may be NULL only if len is 0. |
| len | number of bytes at value. |
| int radcli_avp_add_ip4_by_num | ( | radcli_avp_list * | list, |
| const radcli_ctx * | ctx, | ||
| uint32_t | attrid, | ||
| uint32_t | vendor, | ||
| struct in_addr | value ) |
Look up an IPv4-address-typed attribute by legacy numeric ID and append it.
| list | destination list. |
| ctx | a context with a dictionary loaded. |
| attrid | the attribute ID (a PW_* constant, or a vendor type ID when vendor is non-zero). |
| vendor | the vendor PEN, or 0 for a standard attribute. |
| value | the address, in the usual network byte order struct in_addr carries. |
| int radcli_avp_add_ip4prefix_by_num | ( | radcli_avp_list * | list, |
| const radcli_ctx * | ctx, | ||
| uint32_t | attrid, | ||
| uint32_t | vendor, | ||
| struct in_addr | value, | ||
| unsigned | prefix ) |
Look up an IPv4-prefix-typed attribute by legacy numeric ID and append it.
| list | destination list. |
| ctx | a context with a dictionary loaded. |
| attrid | the attribute ID (a PW_* constant, or a vendor type ID when vendor is non-zero). |
| vendor | the vendor PEN, or 0 for a standard attribute. |
| value | the address. |
| prefix | the prefix length (0-32). |
| int radcli_avp_add_ip6_by_num | ( | radcli_avp_list * | list, |
| const radcli_ctx * | ctx, | ||
| uint32_t | attrid, | ||
| uint32_t | vendor, | ||
| const struct in6_addr * | value, | ||
| unsigned | prefix ) |
Look up an IPv6-address or IPv6-prefix-typed attribute by legacy numeric ID and append it.
| list | destination list. |
| ctx | a context with a dictionary loaded. |
| attrid | the attribute ID (a PW_* constant, or a vendor type ID when vendor is non-zero). |
| vendor | the vendor PEN, or 0 for a standard attribute. |
| value | the address. |
| prefix | the prefix length (0-128); ignored/must be 0 for RADCLI_TYPE_IPV6ADDR. |
| int radcli_avp_add_str_by_num | ( | radcli_avp_list * | list, |
| const radcli_ctx * | ctx, | ||
| uint32_t | attrid, | ||
| uint32_t | vendor, | ||
| const char * | value ) |
Look up a string-typed attribute by legacy numeric ID and append it.
| list | destination list. |
| ctx | a context with a dictionary loaded. |
| attrid | the attribute ID (a PW_* constant, or a vendor type ID when vendor is non-zero). |
| vendor | the vendor PEN, or 0 for a standard attribute. |
| value | a null-terminated string. |
| int radcli_avp_add_uint32_by_num | ( | radcli_avp_list * | list, |
| const radcli_ctx * | ctx, | ||
| uint32_t | attrid, | ||
| uint32_t | vendor, | ||
| uint32_t | value ) |
Look up an integer/IPv4-address/date-typed attribute by legacy numeric ID and append it.
| list | destination list. |
| ctx | a context with a dictionary loaded. |
| attrid | the attribute ID (a PW_* constant, or a vendor type ID when vendor is non-zero). |
| vendor | the vendor PEN, or 0 for a standard attribute. |
| value | the value; an IPv4 address is given in host byte order. |
| int radcli_avp_add_uint64_by_num | ( | radcli_avp_list * | list, |
| const radcli_ctx * | ctx, | ||
| uint32_t | attrid, | ||
| uint32_t | vendor, | ||
| uint64_t | value ) |
Look up a 64-bit integer-typed attribute by legacy numeric ID and append it.
| list | destination list. |
| ctx | a context with a dictionary loaded. |
| attrid | the attribute ID (a PW_* constant, or a vendor type ID when vendor is non-zero). |
| vendor | the vendor PEN, or 0 for a standard attribute. |
| value | the value. |