radcli_avp_add_gigawords64(3) Radius client library radcli_avp_add_gigawords64(3)

radcli_avp_add_gigawords64 - Append a 64-bit counter as an Octets/Gigawords attribute pair.

#include <radcli/>

int radcli_avp_add_gigawords64(
    radcli_ctx             *ctx,
    radcli_avp_list        *list,
    const radcli_attr_def  *octets,
    uint64_t                value
);

No standard RADIUS attribute counts octets as a 64-bit integer; real 64-bit accounting is done with a pair of 32-bit attributes e.g. Acct-Input-Octets (the low 32 bits) and Acct-Input-Gigawords (the high 32 bits) which is what every deployed server actually implements. This is the one call an accounting caller needs instead of computing and adding both halves by hand.

Implements the Acct-Input/Output-Octets (RFC 2866 SS5.3/5.4) plus Acct-Input/Output-Gigawords (RFC 2869 SS5.1/5.2) pairing: Gigawords holds the number of times its Octets counterpart has wrapped past 2^32, so the pair together give a 64-bit octet count. Not RADCLI_TYPE_INTEGER64/RFC 8044 no standard accounting attribute uses that type.

octets' Gigawords counterpart is looked up from the dictionary (an ATTRIBUTE line's "gigawords=" option, etc/dictionary), not derived from its name, so passing an attribute with no such counterpart configured is an error rather than a silent truncation to 32 bits. The gigawords attribute is omitted from list when it would be zero (value fits in 32 bits), matching how a real NAS sends it.

the context octets was looked up from the gigawords= pairing is recorded per dictionary, not on radcli_attr_def itself (that would need a public struct field, and the struct is frozen ABI), so finding it means searching ctx's loaded dictionary.
destination list.
the octets attribute (e.g. Acct-Input-Octets); its dictionary entry must declare a gigawords= counterpart.
the full 64-bit count.

0 on success, -1 on failure (octets has no configured gigawords counterpart, or as radcli_avp_add_bytes()).

radcli_avp_add_bytes(3), radcli_avp_add_bytes_by_num(3), radcli_avp_add_gigawords64_by_num(3), radcli_avp_add_ip4(3), radcli_avp_add_ip4_by_num(3), radcli_avp_add_ip4prefix(3), radcli_avp_add_ip4prefix_by_num(3), radcli_avp_add_ip6(3), radcli_avp_add_ip6_by_num(3), radcli_avp_add_str(3), radcli_avp_add_str_by_num(3), radcli_avp_add_uint32(3), radcli_avp_add_uint32_by_num(3), radcli_avp_add_uint64(3), radcli_avp_add_uint64_by_num(3), radcli_avp_add_username(3), radcli_avp_concat_str(3), radcli_avp_concat_str_by_num(3), radcli_avp_def(3), radcli_avp_get(3), radcli_avp_get_by_num(3), radcli_avp_get_bytes(3), radcli_avp_get_bytes_by_num(3), radcli_avp_get_cstr(3), radcli_avp_get_cstr_by_num(3), radcli_avp_get_gigawords64(3), radcli_avp_get_gigawords64_by_num(3), radcli_avp_get_ip4prefix(3), radcli_avp_get_ip4prefix_by_num(3), radcli_avp_get_ip6(3), radcli_avp_get_ip6_by_num(3), radcli_avp_get_uint32(3), radcli_avp_get_uint32_by_num(3), radcli_avp_get_uint64(3), radcli_avp_get_uint64_by_num(3), radcli_avp_iter_next(3), radcli_avp_list_error(3), radcli_avp_list_free(3), radcli_avp_list_iter(3), radcli_avp_list_new(3)

2026-09-03 radcli