These constants define RADIUS attribute types that can be used with radius_put_addr(), radius_put_attr(), radius_put_int() and radius_put_string().
RADIUS_USER_NAME (int)RADIUS_USER_PASSWORD (int)RADIUS_CHAP_PASSWORD (int)RADIUS_CHAP_CHALLENGE attribute.Example #1 Using CHAP passwords
<?php
// Firstly, we'll create an authentication handle and request.
$radh = radius_auth_open();
radius_add_server($radh, $server, $port, $secret, 3, 3);
radius_create_request($radh, RADIUS_ACCESS_REQUEST);
// Assuming $password contains the plaintext password, we now:
// Generate a challenge.
$challenge = mt_rand();
// Specify a CHAP identifier.
$ident = 1;
// Add the Chap-Password attribute.
$cp = hash('md5', pack('Ca*', $ident, $password.$challenge), true);
radius_put_attr($radh, RADIUS_CHAP_PASSWORD, pack('C', $ident).$cp);
// Add the Chap-Challenge attribute.
radius_put_attr($radh, RADIUS_CHAP_CHALLENGE, $challenge);
/* From here, you would add the remaining attributes and
* call radius_send_request(). */
?>RADIUS_NAS_IP_ADDRESS (int)RADIUS_NAS_PORT (int)RADIUS_SERVICE_TYPE (int)A number of constants are provided to represent the possible values of this attribute. They include:
RADIUS_FRAMED_PROTOCOL (int)The Framed-Protocol attribute. The attribute value is expected to be an int indicating the framing to be used for framed access, and can be set using radius_put_int(). The possible attribute values include these constants:
RADIUS_FRAMED_IP_ADDRESS (int)RADIUS_FRAMED_IP_NETMASK (int)RADIUS_FRAMED_ROUTING (int)Possible values include:
0: No routing1: Send routing packets2: Listen for routing packets3: Send and listenRADIUS_FILTER_ID (int)RADIUS_FRAMED_MTU (int)RADIUS_FRAMED_COMPRESSION (int)The Framed-Compression attribute. The attribute value is expected to be an int indicating the compression protocol to be used, and can be set using radius_put_int(). Possible values include these constants:
RADIUS_COMP_NONE: No compressionRADIUS_COMP_VJ: VJ TCP/IP header compressionRADIUS_COMP_IPXHDR: IPX header compressionRADIUS_COMP_STAC_LZS: Stac-LZS compression (added in PECL radius 1.3.0b2)RADIUS_LOGIN_IP_HOST (int)RADIUS_LOGIN_SERVICE (int)RADIUS_LOGIN_TCP_PORT (int)RADIUS_REPLY_MESSAGE (int)RADIUS_CALLBACK_NUMBER (int)RADIUS_CALLBACK_ID (int)RADIUS_FRAMED_ROUTE (int)RADIUS_FRAMED_IPX_NETWORK (int)0xFFFFFFFE to indicate that the RADIUS client should select the network, and can be accessed via radius_cvt_int().RADIUS_STATE (int)RADIUS_CLASS (int)RADIUS_VENDOR_SPECIFIC (int)RADIUS_SESSION_TIMEOUT (int)RADIUS_IDLE_TIMEOUT (int)RADIUS_TERMINATION_ACTION (int)RADIUS_CALLED_STATION_ID (int)RADIUS_CALLING_STATION_ID (int)RADIUS_NAS_IDENTIFIER (int)RADIUS_PROXY_STATE (int)RADIUS_LOGIN_LAT_SERVICE (int)RADIUS_LOGIN_LAT_NODE (int)RADIUS_LOGIN_LAT_GROUP (int)RADIUS_FRAMED_APPLETALK_LINK (int)RADIUS_FRAMED_APPLETALK_NETWORK (int)RADIUS_FRAMED_APPLETALK_ZONE (int)RADIUS_CHAP_CHALLENGE (int)RADIUS_NAS_PORT_TYPE (int)NAS port type, one of:
RADIUS_ASYNCRADIUS_SYNCRADIUS_ISDN_SYNCRADIUS_ISDN_ASYNC_V120RADIUS_ISDN_ASYNC_V110RADIUS_VIRTUALRADIUS_PIAFSRADIUS_HDLC_CLEAR_CHANNELRADIUS_X_25RADIUS_X_75RADIUS_G_3_FAXRADIUS_SDSLRADIUS_ADSL_CAPRADIUS_ADSL_DMTRADIUS_IDSLRADIUS_ETHERNETRADIUS_XDSLRADIUS_CABLERADIUS_WIRELESS_OTHERRADIUS_WIRELESS_IEEE_802_11RADIUS_PORT_LIMIT (int)RADIUS_LOGIN_LAT_PORT (int)RADIUS_CONNECT_INFO (int)RADIUS_ACCT_STATUS_TYPE (int)Accounting status type, one of:
RADIUS_ACCT_DELAY_TIME (int)RADIUS_ACCT_INPUT_OCTETS (int)RADIUS_ACCT_OUTPUT_OCTETS (int)RADIUS_ACCT_SESSION_ID (int)RADIUS_ACCT_AUTHENTIC (int)Accounting authentic, one of:
RADIUS_ACCT_SESSION_TIME (int)RADIUS_ACCT_INPUT_PACKETS (int)RADIUS_ACCT_OUTPUT_PACKETS (int)RADIUS_ACCT_TERMINATE_CAUSE (int)Accounting terminate cause, one of:
RADIUS_TERM_USER_REQUESTRADIUS_TERM_LOST_CARRIERRADIUS_TERM_LOST_SERVICERADIUS_TERM_IDLE_TIMEOUTRADIUS_TERM_SESSION_TIMEOUTRADIUS_TERM_ADMIN_RESETRADIUS_TERM_ADMIN_REBOOTRADIUS_TERM_PORT_ERRORRADIUS_TERM_NAS_ERRORRADIUS_TERM_NAS_REQUESTRADIUS_TERM_NAS_REBOOTRADIUS_TERM_PORT_UNNEEDEDRADIUS_TERM_PORT_PREEMPTEDRADIUS_TERM_PORT_SUSPENDEDRADIUS_TERM_SERVICE_UNAVAILABLERADIUS_TERM_CALLBACKRADIUS_TERM_USER_ERRORRADIUS_TERM_HOST_REQUESTRADIUS_ACCT_MULTI_SESSION_ID (int)RADIUS_ACCT_LINK_COUNT (int)RADIUS_LOGINRADIUS_FRAMEDRADIUS_CALLBACK_LOGINRADIUS_CALLBACK_FRAMEDRADIUS_OUTBOUNDRADIUS_ADMINISTRATIVERADIUS_NAS_PROMPTRADIUS_AUTHENTICATE_ONLYRADIUS_CALLBACK_NAS_PROMPTRADIUS_PPPRADIUS_SLIPRADIUS_ARAPRADIUS_GANDALFRADIUS_XYLOGICSRADIUS_COMP_NONERADIUS_COMP_VJRADIUS_COMP_IPXHDRRADIUS_COMP_STAC_LZSRADIUS_ASYNCRADIUS_SYNCRADIUS_ISDN_SYNCRADIUS_ISDN_ASYNC_V120RADIUS_ISDN_ASYNC_V110RADIUS_VIRTUALRADIUS_PIAFSRADIUS_HDLC_CLEAR_CHANNELRADIUS_X_25RADIUS_X_75RADIUS_G_3_FAXRADIUS_SDSLRADIUS_ADSL_CAPRADIUS_ADSL_DMTRADIUS_IDSLRADIUS_ETHERNETRADIUS_XDSLRADIUS_CABLERADIUS_WIRELESS_OTHERRADIUS_WIRELESS_IEEE_802_11RADIUS_STARTRADIUS_STOPRADIUS_ACCOUNTING_ONRADIUS_ACCOUNTING_OFFRADIUS_AUTH_RADIUSRADIUS_AUTH_LOCALRADIUS_AUTH_REMOTERADIUS_TERM_USER_REQUESTRADIUS_TERM_LOST_CARRIERRADIUS_TERM_LOST_SERVICERADIUS_TERM_IDLE_TIMEOUTRADIUS_TERM_SESSION_TIMEOUTRADIUS_TERM_ADMIN_RESETRADIUS_TERM_ADMIN_REBOOTRADIUS_TERM_PORT_ERRORRADIUS_TERM_NAS_ERRORRADIUS_TERM_NAS_REQUESTRADIUS_TERM_NAS_REBOOTRADIUS_TERM_PORT_UNNEEDEDRADIUS_TERM_PORT_PREEMPTEDRADIUS_TERM_PORT_SUSPENDEDRADIUS_TERM_CALLBACKRADIUS_TERM_USER_ERRORRADIUS_TERM_HOST_REQUEST