php8.5
Home/ Manual/ radius / functions/ radius_put_attr

radius_put_attr

PHP function Edit on GitHub ✎

(PECL radius >= 1.1.0)

Attaches a binary attribute

Description

radius_put_attr(resource $radius_handle, int $type, string $value, int $options = 0, [int $tag]): bool

Attaches a binary attribute to the current RADIUS request.

Required

Parameters

value

The attribute value, which will be treated as a raw binary string.

Return Values

Success

Changelog

VersionDescription
PECL radius 1.3.0The options and tag parameters were added.

Examples

radius_put_attr() example

php
<?php
mt_srand(time());
$chall = mt_rand();
$chapval = hash('md5', pack('Ca*',1 , 'sepp' . $chall));
$pass = pack('CH*', 1, $chapval);
if (!radius_put_attr($res, RADIUS_CHAP_PASSWORD, $pass)) {
    echo 'RadiusError:' . radius_strerror($res). "\n<br />";
    exit;
}
?>

See Also

Source: reference/radius/functions/radius-put-attr.xml · from the official PHP manual (php/doc-en)