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_LOGIN
RADIUS_FRAMED
RADIUS_CALLBACK_LOGIN
RADIUS_CALLBACK_FRAMED
RADIUS_OUTBOUND
RADIUS_ADMINISTRATIVE
RADIUS_NAS_PROMPT
RADIUS_AUTHENTICATE_ONLY
RADIUS_CALLBACK_NAS_PROMPT
RADIUS_PPP
RADIUS_SLIP
RADIUS_ARAP
RADIUS_GANDALF
RADIUS_XYLOGICS
RADIUS_COMP_NONE
RADIUS_COMP_VJ
RADIUS_COMP_IPXHDR
RADIUS_COMP_STAC_LZS
RADIUS_ASYNC
RADIUS_SYNC
RADIUS_ISDN_SYNC
RADIUS_ISDN_ASYNC_V120
RADIUS_ISDN_ASYNC_V110
RADIUS_VIRTUAL
RADIUS_PIAFS
RADIUS_HDLC_CLEAR_CHANNEL
RADIUS_X_25
RADIUS_X_75
RADIUS_G_3_FAX
RADIUS_SDSL
RADIUS_ADSL_CAP
RADIUS_ADSL_DMT
RADIUS_IDSL
RADIUS_ETHERNET
RADIUS_XDSL
RADIUS_CABLE
RADIUS_WIRELESS_OTHER
RADIUS_WIRELESS_IEEE_802_11
RADIUS_START
RADIUS_STOP
RADIUS_ACCOUNTING_ON
RADIUS_ACCOUNTING_OFF
RADIUS_AUTH_RADIUS
RADIUS_AUTH_LOCAL
RADIUS_AUTH_REMOTE
RADIUS_TERM_USER_REQUEST
RADIUS_TERM_LOST_CARRIER
RADIUS_TERM_LOST_SERVICE
RADIUS_TERM_IDLE_TIMEOUT
RADIUS_TERM_SESSION_TIMEOUT
RADIUS_TERM_ADMIN_RESET
RADIUS_TERM_ADMIN_REBOOT
RADIUS_TERM_PORT_ERROR
RADIUS_TERM_NAS_ERROR
RADIUS_TERM_NAS_REQUEST
RADIUS_TERM_NAS_REBOOT
RADIUS_TERM_PORT_UNNEEDED
RADIUS_TERM_PORT_PREEMPTED
RADIUS_TERM_PORT_SUSPENDED
RADIUS_TERM_CALLBACK
RADIUS_TERM_USER_ERROR
RADIUS_TERM_HOST_REQUEST