radcli_avp_add_ip4prefix(3)

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

list

destination list.

def

the attribute; must be RADCLI_TYPE_IPV4PREFIX.

value

the address.

prefix

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()).

From radcli 2.0.1-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.