PHP Conference Japan 2024

radius_put_addr

(PECL radius >= 1.1.0)

radius_put_addr附加 IP 位址屬性

說明

radius_put_addr(
    資源 $radius_handle,
    整數 $type,
    字串 $addr,
    整數 $options = 0,
    整數 $tag = ?
): 布林值

將 IP 位址屬性附加到目前的 RADIUS 請求。

注意事項:

在呼叫此函式之前,必須透過 radius_create_request() 建立請求。

參數

radius_handle

RADIUS 資源。

type

屬性類型。

addr

一個字串形式的 IPv4 地址,例如 10.0.0.1

options

屬性選項的位元遮罩。可用的選項包括 RADIUS_OPTION_TAGGEDRADIUS_OPTION_SALT

tag

屬性標籤。除非設定了 RADIUS_OPTION_TAGGED 選項,否則會忽略此參數。

返回值

成功時返回 true,失敗時返回 false

更新日誌

版本 說明
PECL radius 1.3.0 新增了 optionstag 參數。

新增筆記

使用者貢獻的筆記 2 則筆記

Do-not-spam at me dot nospam dot com
6 年前
radius_put_addr() 目前不支援 IPv6

使用 IPv6 時的解決方法是使用 radius_put_string
zervu1boris at gmail dot com
3 個月前
附加 IPv6 前綴屬性

$ipv6Prefix = "2001:1111:2222:3333::";
$ipv6PrefixLength = "64";

// Framed-IPv6-Prefix
radius_put_attr($res, 97, chr(0).chr($ipv6PrefixLength).inet_pton($ipv6Prefix));

// Delegated-IPv6-Prefix
radius_put_attr($res, 123, chr(0).chr($ipv6PrefixLength).inet_pton($ipv6Prefix));
To Top