radcli_avp_add_ip4prefix3
Append an ipv4-prefix-typed attribute.
Usage
#include <radcli/>
int radcli_avp_add_ip4prefix(
radcli_avp_list *list,
const radcli_attr_def *def,
struct in_addr value,
unsigned prefix
);
Overview
The RFC 8044 SS3.9 wire format is built internally: a reserved zero octet, the prefix length, and the 4-octet address.
A dedicated function rather than a prefix parameter on radcli_avp_add_ip4(): unlike radcli_avp_add_ip6() (which took a prefix parameter from its introduction), radcli_avp_add_ip4() already shipped without one, with real callers; adding one now would force every existing caller to update for a type most of them don't use.
Parameters
|
destination list. |
|---|---|
|
the attribute; must be RADCLI_TYPE_IPV4PREFIX. |
|
the address. |
|
the prefix length (0-32). |
Return value
0 on success, -1 on failure (wrong type, prefix out of range, or as radcli_avp_add_bytes()).