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
valueThe attribute value, which will be treated as a raw binary string.
Return Values
Success
Changelog
| Version | Description |
|---|---|
| PECL radius 1.3.0 | The 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;
}
?>