|
AXL RADIUS Server API V3 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectRADIUSClient
RADIUS Client for applications. This provides a platform independent way to authenticate and perform accounting for an entity. The RADIUS client is in compliance with RFC 2138 & 2139.
Each different authentication, accounting, or extended packet MUST use a new constructor
OR call the reset method (reset()).
If a back up server is contacted the same constructor may be used.
Retries because of timeouts MUST use the same constructor and NOT use the reset() method between retries.
This is required to maintain the same packet Identifier and socket for retries. A different packet identifier
is required for a new request. A different socket may be required if more than 256 outstanding radius
requests are created.
Provides full Access-Request/Access-Accept and Access-Challenge authentication. Access-Accounting is also fully supported.
| Field Summary | |
static int |
Access_Accept
Access_Accept is returned if an authentication succeeded, value = 2. |
static int |
Access_BadPacket
Access_BadPacket is returned for a number of reasons, value = 0. |
static int |
Access_Challenge
Access_Challenge is returned if an authentication is challenged, value = 11. |
static int |
Access_Reject
Access_Reject is returned if an authentication failed, value = 3. |
static int |
Access_Request
Access_Request is the packet type for authentication, value = 1. |
static int |
Accounting_Request
Accounting_Request packet type, value = 4. |
static int |
Accounting_Response
Accounting_Response packet type, value = 5. |
static int |
ACCT_PORT
Port number (1813) for RADIUS Accounting |
static int |
ALT_ACCT_PORT
Original RADIUS Accounting port number (1646) still in use on non-standard servers. |
static int |
ALT_AUTH_PORT
Original RADIUS Authentication port number (1645) still in use on non-standard servers. |
static int |
AUTH_PORT
Port number (1812) for RADIUS Authentication |
static int |
CoA_ACK
Acknowledgement of a Change-of-Authorization request, value = 44. |
static int |
CoA_NAK
Refusal of a Change-of-Authorization request, value = 45. |
static int |
CoA_Request
Change-of-Authorization request packet, value = 43. |
static int |
Disconnect_ACK
Client response to a Disconnect-Request acknowledging the disconnect message, value = 41. |
static int |
Disconnect_NAK
Client response to a Disconnect-Request refusing the disconnect message request, value = 42. |
static int |
Disconnect_Request
Disconnect-Request - request that a client disconnect message, value = 40. |
static int |
DMCOA_PORT
The Disconnect-Request port UDP port 3799. |
static int |
ERROR_AUTHENTICATOR
Access_BadPacket Reason: Bad authenticator = 5. |
static int |
ERROR_CORRUPT
Access_BadPacket Reason: Attribute data is corrupt = 4. |
static int |
ERROR_DES
Access_BadPacket Reason: DES encoding has a problem - key length, unable to locate the DES algorithm, etc. = 9. |
static int |
ERROR_DUPLICATE
Access_BadPacket Reason: Duplicate packet received = 1. |
static int |
ERROR_MESSAGE_AUTHENTICATOR
Access_BadPacket Reason: Bad Message-Authenticator attribute = 6. |
static int |
ERROR_MISMATCHED_ID
Access_BadPacket Reason: Packet identifier sent doesn't match the received identifier = 3. |
static int |
ERROR_MISSING_USER_NAME
Access_BadPacket Reason: Packet being sent has a User-Name of null = 2. |
static int |
ERROR_NONE
Access_BadPacket Reason: No error = 0. |
static int |
ERROR_PACKET_SIZE
Access_BadPacket Reason: The packet size is incorrect - too small or physical size is smaller than stated size = 8. |
static int |
ERROR_WRONG_HOST
Access_BadPacket Reason: The reply packet did not arrive from the correct host. |
static int |
MAX_PACKET_SIZE
Maximum packet size (4096) as specified in the RFC. |
ClientModule |
module
Access to the module methods. |
static int |
SOCKET_TIMEOUT
Default RADIUS timeout, value = 10000 ms. |
static String |
Version
Client software version number ("3.43p") |
| Constructor Summary | |
RADIUSClient(InetAddress rHost,
int port,
byte[] secret,
int timeout)
Class constructor creates the RADIUS Client. |
|
RADIUSClient(InetAddress rHost,
int port,
String secret)
Class constructor creates the RADIUS Client. |
|
RADIUSClient(InetAddress rHost,
int port,
String secret,
int timeout)
Class constructor creates the RADIUS Client. |
|
RADIUSClient(String rHost,
int port,
String secret)
Class constructor creates the RADIUS Client. |
|
RADIUSClient(String rHost,
int port,
String secret,
int timeout)
Class constructor creates the RADIUS Client. |
|
| Method Summary | |
int |
accounting(AttributeList alist)
Send Accounting information. |
int |
accounting(int packetType,
AttributeList alist)
Send Accounting information. |
void |
addDictionary(RADIUSDictionary dict)
Add a dictionary to the RADIUS client's knowledge of vendor Id's and attribute names / types. |
void |
allowEmptyAttributes(boolean enable)
Allow empty attributes. |
int |
authenticate(AttributeList alist)
Actually perform the authentication. |
int |
authenticate(byte[] packetData)
Send authentication information using raw packet data. |
int |
authenticate(byte[] password,
AttributeList alist)
Send CHAP Authentication information. |
int |
authenticate(int packetType,
AttributeList alist)
Send an authentication request with a particular packet type. |
int |
authenticate(String password,
AttributeList alist)
Send CHAP Authentication information. |
int |
authenticate(String name,
String password,
AttributeList alist)
Send PAP Authentication information. |
void |
bind(InetAddress localAddr)
Bind the radius client to a particular local address. |
void |
bind(InetAddress localAddr,
int bindPort)
Bind the radius client to a particular local address and port. |
void |
bind(String localAddr)
Bind the radius client to a particular local address. |
static boolean |
checkAccountingAuthenticator(byte[] radiusRecvBuf,
int radiusRecvBufLen,
byte[] radiusAuthenticator,
byte[] radiusSecretBytes)
The Authenticator field in an Accounting-Response packet is called the Response Authenticator, and contains a one-way MD5 hash calculated over a stream of octets consisting of the Accounting- Response Code, Identifier, Length, the Request Authenticator field from the Accounting-Request packet being replied to, and the response attributes if any, followed by the shared secret. |
static boolean |
checkAuthenticator(byte[] radiusRecvBuf,
int radiusRecvBufLen,
byte[] radiusAuthenticator,
byte[] radiusSecretBytes)
Check an authentication authenticator on a packet. |
void |
close()
End the authentication session |
boolean |
cmpMSCHAP2(byte[] name,
byte[] password,
AttributeList list)
Compare an MS-CHAP V2 response to the request to determine if the authentication worked and we aren't being fooled by a rogue RADIUS Server. |
byte[] |
createChallenge16()
Create random 16 byte challenge. |
byte[] |
createChallenge8()
Create random 8 byte challenge. |
void |
createCHAP(byte[] password,
AttributeList list)
Create a CHAP password from a plain text password. |
void |
createMSCHAP(byte[] password,
AttributeList list)
Create an MS-CHAP password from a non-plain text (or plain text) password. |
void |
createMSCHAP2(byte[] name,
byte[] password,
AttributeList list)
Create an MS-CHAP V2 password from a non-plain text (or plain text) password. |
byte[] |
decode(byte[] pwdBytes)
Decode a PAP password. |
int |
dmcoa(int packetType,
AttributeList alist)
Send a Disconnect-Request or CoA-Request packet to be used when simulating a server sending a DM/COA message. |
byte[] |
encryptPassword(byte[] pwdBytes)
Encrypt the password. |
AttributeList |
getAttributes()
Return attribute list from an authentication or accounting response. |
static byte[] |
getBytes(String str)
Encode a string using UTF8 encoding. |
boolean |
getDebugIndicator()
Get the debugging indicator value. |
int |
getError()
Get the error value when an Access-BadPacket is returned from the authenticate() or accounting() methods |
String |
getErrorString()
Get the name of the Access_BadPacket error. |
int |
getMaximumPacketSize()
Get the maximum packet size. |
Object |
getModuleInstance(String moduleName,
Object obj)
Instantiate a client support module. |
MPPE |
getMSCHAPMPPE(boolean encrypted)
Get the MS-CHAP V1 / V2 MPPE key information from the response packet. |
int |
getPacketType()
Get the packet type returned by an authentication or accounting request. |
String |
getPacketTypeName()
Get the name of the packet type returned by an authentication or accounting request. |
String |
getPacketTypeName(int packetType)
Get the name of the packet type returned by an authentication or accounting request. |
byte[] |
getPassword()
Get the User-Password/Chap-Password as a binary value. |
AttributeList |
getRequestAttributes()
Explicitly get the original request attribute list. |
byte[] |
getRequestAuthenticator()
Get the Access-Request Authenticator. |
byte[] |
getSecret()
Get the NAS secret. |
InetAddress |
getServer()
Get the RADIUS server address. |
byte[] |
getTunnelPassword(int tag)
Decode a Tunnel-Password. |
void |
logToDebug(String msg)
Log a message to the debug file or stdout if debugging hasn't been set up. |
void |
reset()
Reset the client for a new request. |
int |
retry()
Retry sending a packet. |
int |
sendRawPacket(byte[] packetData)
Send RADIUS packet information using raw packet data. |
boolean |
setDebug(boolean debug)
Set debugging on or off. |
void |
setDebug(boolean debug,
String fileName)
Set debugging on or off. |
void |
setMaximumPacketSize(int maxPacketSize)
Set the maximum packet size. |
static boolean |
testEnc(String enc)
Test a character encoding scheme. |
String |
toString()
Return representation of the RADIUS connection. |
byte[] |
trim(byte[] pwdBytes)
Trim trailing nulls from a decrypted password. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int Access_Accept
authenticate(),
Constant Field Valuespublic static final int Access_BadPacket
Reasons:
getError() and
getErrorString() methods.
public static final int Access_Challenge
authenticate(),
accounting(),
Constant Field Valuespublic static final int Access_Reject
authenticate(),
Constant Field Valuespublic static final int Access_Request
public static final int Accounting_Request
public static final int Accounting_Response
accounting(),
Constant Field Valuespublic static final int ACCT_PORT
accounting(),
Constant Field Valuespublic static final int ALT_ACCT_PORT
accounting(),
Constant Field Valuespublic static final int ALT_AUTH_PORT
authenticate(),
Constant Field Valuespublic static final int AUTH_PORT
authenticate(),
Constant Field Valuespublic static final int CoA_ACK
authenticate(int packetType, AttributeList alist),
Constant Field Valuespublic static final int CoA_NAK
authenticate(int packetType, AttributeList alist),
Constant Field Valuespublic static final int CoA_Request
authenticate(int packetType, AttributeList alist),
Constant Field Valuespublic static final int Disconnect_ACK
authenticate(int packetType, AttributeList alist),
Constant Field Valuespublic static final int Disconnect_NAK
authenticate(int packetType, AttributeList alist),
Constant Field Valuespublic static final int Disconnect_Request
authenticate(int packetType, AttributeList alist),
Constant Field Valuespublic static final int DMCOA_PORT
public static final int ERROR_AUTHENTICATOR
public static final int ERROR_CORRUPT
public static final int ERROR_DES
public static final int ERROR_DUPLICATE
public static final int ERROR_MESSAGE_AUTHENTICATOR
public static final int ERROR_MISMATCHED_ID
public static final int ERROR_MISSING_USER_NAME
public static final int ERROR_NONE
public static final int ERROR_PACKET_SIZE
public static final int ERROR_WRONG_HOST
public static final int MAX_PACKET_SIZE
setMaximumPacketSize().
The server receiving the packet must be able to handle a larger size.
public transient ClientModule module
public static final int SOCKET_TIMEOUT
public static final String Version
| Constructor Detail |
public RADIUSClient(InetAddress rHost,
int port,
byte[] secret,
int timeout)
throws SocketException
rHost - The RADIUS host name or address.port - Port number for the RADIUS host.secret - The shared secret between this client and the RADIUS server.timeout - Socket timeout in milliseconds.
SocketException - Socket creation problems.
public RADIUSClient(InetAddress rHost,
int port,
String secret)
throws SocketException
rHost - The RADIUS host address.port - Port number for the RADIUS host.secret - The shared secret between this client and the RADIUS server.
SocketException - Socket creation problems.
public RADIUSClient(InetAddress rHost,
int port,
String secret,
int timeout)
throws SocketException
rHost - The RADIUS host name or address.port - Port number for the RADIUS host.secret - The shared secret between this client and the RADIUS server.timeout - Socket timeout in milliseconds.
SocketException - Socket creation problems.
public RADIUSClient(String rHost,
int port,
String secret)
throws SocketException,
UnknownHostException
rHost - The RADIUS host name or address.port - Port number for the RADIUS host.secret - The shared secret between this client and the RADIUS server.
SocketException - Socket creation problems.
UnknownHostException - Can't find the RADIUS host.
public RADIUSClient(String rHost,
int port,
String secret,
int timeout)
throws SocketException,
UnknownHostException
rHost - The RADIUS host name or address.port - Port number for the RADIUS host.secret - The shared secret between this client and the RADIUS server.timeout - Socket timeout in milliseconds.
SocketException - Socket creation problems.
UnknownHostException| Method Detail |
public int accounting(AttributeList alist)
throws ClientSendException,
ClientReceiveException
Note: the accounting method only tries once to contact the RADIUS host. The UDP authentication packet may be lost or the response may be lost. Catching a ClientSendException or ClientReceiveException lets you know which one of the UDP packets was lost. Catching an IOException will catch both exceptions. The calling program must supply the retry algorithm or contact a backup RADIUS server.
Any returned accounting attributes can be acquired by using the getAttributes method.
alist - List of attributes to send.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.getAttributes(),
Accounting_Response,
Access_BadPacket,
getError()
public int accounting(int packetType,
AttributeList alist)
throws ClientSendException,
ClientReceiveException
Note: the accounting method only tries once to contact the RADIUS host. The UDP authentication packet may be lost or the response may be lost. Catching a ClientSendException or ClientReceiveException lets you know which one of the UDP packets was lost. Catching an IOException will catch both exceptions. The calling program must supply the retry algorithm or contact a backup RADIUS server.
Any returned accounting attributes can be acquired by using the getAttributes method.
packetType - The packet type to send. This would generally be an extended packet type.alist - List of attributes to send.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.getAttributes(),
Accounting_Response,
Access_BadPacket,
getError()public void addDictionary(RADIUSDictionary dict)
The dictionary aids the server in displaying attribute names and values.
dict - RADIUSDictionary.public void allowEmptyAttributes(boolean enable)
enable - True allows empty attributes, False disallows them.
The default is to disallow empty attributes and produce the error ERROR_CORRUPT.
public int authenticate(AttributeList alist)
throws ClientSendException,
ClientReceiveException
alist - List of Attributes.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.getError()
public int authenticate(byte[] packetData)
throws ClientSendException,
ClientReceiveException
Note: the authenticate method only tries once to contact the RADIUS host. Either the UDP authentication or reply packet may be lost, or the server may have chosen not to answer. Catching a ClientSendException or ClientReceiveException lets you know which one of the UDP packets was lost. Catching an IOException will catch both exceptions. The calling program must supply the retry algorithm or contact a backup RADIUS server.
packetData - Raw data to be sent as a packet.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.Access_Accept,
Access_Reject,
Access_Challenge,
Access_BadPacket,
getError()
public int authenticate(byte[] password,
AttributeList alist)
throws ClientSendException,
ClientReceiveException
Note: the authenticate method only tries once to contact the RADIUS host. Either the UDP authentication or reply packet may be lost, or the server may have chosen not to answer. Catching a ClientSendException or ClientReceiveException lets you know which one of the UDP packets was lost. Catching an IOException will catch both exceptions. The calling program must supply the retry algorithm or contact a backup RADIUS server.
The User-Name attribute is expected to be set.
password - Plain text password.alist - List of request attributes.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.Access_Accept,
Access_Reject,
Access_Challenge,
Access_BadPacket,
getError()
public int authenticate(int packetType,
AttributeList alist)
throws ClientSendException,
ClientReceiveException
packetType - The packet type to send. This would generally be an extended packet type.alist - List of Attributes.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.getError()
public int authenticate(String password,
AttributeList alist)
throws ClientSendException,
ClientReceiveException
Note: the authenticate method only tries once to contact the RADIUS host. Either the UDP authentication or reply packet may be lost, or the server may have chosen not to answer. Catching a ClientSendException or ClientReceiveException lets you know which one of the UDP packets was lost. Catching an IOException will catch both exceptions. The calling program must supply the retry algorithm or contact a backup RADIUS server.
The class RADIUSEncrypt may be useful to encode a returning password for comparison to the original in an Access-Challenge response.
The User-Name attribute is expected to be set.
password - Password which may be null or empty.
If the password is null no User-Password attribute will be generated.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.Access_Accept,
Access_Reject,
Access_Challenge,
Access_BadPacket,
getError()
public int authenticate(String name,
String password,
AttributeList alist)
throws ClientSendException,
ClientReceiveException
Note: the authenticate method only tries once to contact the RADIUS host. Either the UDP authentication or reply packet may be lost, or the server may have chosen not to answer. Catching a ClientSendException or ClientReceiveException lets you know which one of the UDP packets was lost. Catching an IOException will catch both exceptions. The calling program must supply the retry algorithm or contact a backup RADIUS server.
The class RADIUSEncrypt may be useful to encode a returning password for comparison to the original in an Access-Challenge response.
name - Entity name to authenticate.password - Password for the entity name.
If the password is null no User-Password attribute will be generated.alist - AttributeList List of additional attributes.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.Access_Accept,
Access_Reject,
Access_Challenge,
Access_BadPacket,
getError()
public void bind(InetAddress localAddr)
throws SocketException
localAddr - Local address.
SocketException - if the socket can't be bound to the local address.
public void bind(InetAddress localAddr,
int bindPort)
throws SocketException
localAddr - Local address.bindPort - local port.
SocketException - if the socket can't be bound to the local address.
public void bind(String localAddr)
throws SocketException,
UnknownHostException
localAddr - Local address.
SocketException - if the socket can't be bound to the local address.
UnknownHostException - if the local address is unknown.
public static boolean checkAccountingAuthenticator(byte[] radiusRecvBuf,
int radiusRecvBufLen,
byte[] radiusAuthenticator,
byte[] radiusSecretBytes)
radiusRecvBuf - Buffer containing the entire radius packet.radiusRecvBufLen - Length of actual data in the radiusRecvBuf.radiusAuthenticator - Authenticator from the request packet.radiusSecretBytes - Shared secret.
public static boolean checkAuthenticator(byte[] radiusRecvBuf,
int radiusRecvBufLen,
byte[] radiusAuthenticator,
byte[] radiusSecretBytes)
radiusRecvBuf - packet data.radiusRecvBufLen - packet data.lengthradiusAuthenticator - Radius request authenticator.radiusSecretBytes - Shared secret bytes.public void close()
public boolean cmpMSCHAP2(byte[] name,
byte[] password,
AttributeList list)
throws RADIUSException
name - User-Name attribute value, generally stripped of realm information. It must not be
in encoded in UNICODE format. The default UTF8 encoding is sufficient.password - Plain text password to encode. It should be encoded from a string as UTF8.list - Attribute list containing the response.
RADIUSException - if there's a problem running DES encoding.
See getError() or the RADIUSException for the reason.public byte[] createChallenge16()
public byte[] createChallenge8()
public void createCHAP(byte[] password,
AttributeList list)
password - Plain text password to encode. It should be encoded from a string as UTF8.list - Attribute Add the CHAP attributes to this list.
public void createMSCHAP(byte[] password,
AttributeList list)
throws RADIUSException
Some servers like their MS VSA's separate so we will observe this anomally. Each MS-CHAP VSA will hold one sub-attribute.
password - Plain text password to encode. It must not be
in encoded in UNICODE format. The default UTF8 encodings is sufficient.list - Attribute Add the CHAP attributes to this list.
RADIUSException - if there's a problem running DES encoding.
See getError() or the RADIUSException for the reason.
public void createMSCHAP2(byte[] name,
byte[] password,
AttributeList list)
throws RADIUSException
cmpMSCHAP2()
to authenticate the server's response before the authentication is finally accepted. A result
of Access-Accept is not sufficient.
name - User-Name attribute value, generally stripped of realm information. It must not be
in encoded in UNICODE format. The default UTF8 encoding is sufficient as it will be translated to
UNICODE when necessary.password - Plain text password to encode. It should be encoded from a string as UTF8.list - Attribute Add the CHAP attributes to this list.
RADIUSException - if there's a problem running DES encoding.
See getError() or the RADIUSException for the reason.public byte[] decode(byte[] pwdBytes)
pwdBytes - Password bytes to decode / encode.
public int dmcoa(int packetType,
AttributeList alist)
throws ClientSendException,
ClientReceiveException
After the creation of the RADIUSClient the method bind(InetAddress bindAddr, int bindPort)
must be called to bind the client to the DM/COA port. This binds the DM/COA
port and address so that the client's response will return to the waiting port. The
DM/COA protocol requires both the client and server to use the same port (3799).
Any returned accounting attributes can be acquired by using the getAttributes method.
packetType - The packet type to send.alist - List of attributes to send.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.getAttributes(),
Accounting_Response,
Access_BadPacket,
getError()public byte[] encryptPassword(byte[] pwdBytes)
RFC 2138: The NAS and RADIUS server share a secret. That shared secret followed by the Request Authenticator is put through a one-way MD5 hash to create a 16 octet digest value which is xored with the password entered by the user, and the xored result placed in the User-Password attribute in the Access-Request packet. See the entry for User-Password in the section on Attributes for a more detailed description. If the password is longer than 16 characters, a second one-way MD5 hash is calculated over a stream of octets consisting of the shared secret followed by the result of the first xor. That hash is XORed with the second 16 octet segment of the password and placed in the second 16 octets of the String field of the User- Password Attribute. If necessary, this operation is repeated, with each xor result being used along with the shared secret to generate the next hash to xor the next segment of the password, to no more than 128 characters.
pwdBytes - The password to encrypt. May be empty.
public AttributeList getAttributes()
If a Access_BadPacket result was returned the attributes may be from the
response or the request depending on the error.
public static byte[] getBytes(String str)
str - String to encode.
public boolean getDebugIndicator()
public int getError()
ERROR_NONE,
ERROR_DUPLICATE,
ERROR_MISSING_USER_NAME,
ERROR_MISMATCHED_ID,
ERROR_CORRUPT,
ERROR_AUTHENTICATOR,
ERROR_MESSAGE_AUTHENTICATOR,
ERROR_PACKET_SIZEpublic String getErrorString()
public int getMaximumPacketSize()
public Object getModuleInstance(String moduleName,
Object obj)
throws RADIUSModuleException
moduleName - Name of module to instantiate.
The module name may either be relative to the module package or a fully qualified
class path. In some cases the class loader doesn't provide the necessary package
information so even where the class is relative to the module packate it will be necessary
to use a full path to the class.obj - Object to pass to the module's constructor. If null the default contructor
will be used.
RADIUSModuleException - if there's a problem registering the module.public MPPE getMSCHAPMPPE(boolean encrypted)
encrypted - True if the keys are expected to be encrypted, false if they're
in plain text. Unless debugging the keys must always be encrypted.
public int getPacketType()
public String getPacketTypeName()
public String getPacketTypeName(int packetType)
packetType - Packet type to look up.
public byte[] getPassword()
public AttributeList getRequestAttributes()
public byte[] getRequestAuthenticator()
public byte[] getSecret()
public InetAddress getServer()
public byte[] getTunnelPassword(int tag)
tag - Tunnel tag for this password.
public void logToDebug(String msg)
msg - Message to write.setDebug()
public void reset()
throws SocketException
SocketException - if there's a problem creating the datagram socket or if the client is
bound to an address and there are no free ports.
public int retry()
throws ClientSendException,
ClientReceiveException
This is used if a packet experienced a timeout receiving a packet.
A ClientReceiveException is thrown when a timeout occurs. Other errors
may cause the ClientReceiveException but in all cases a retry is in order.
The original request attributes are resent with the original packet identifier and authenticator.
This method performs one retry and does not provide delays.
ClientSendException - will be thrown if the original packet has not been sent (nothing to retry).
In other words a retry without an original try will fail.
ClientReceiveException - if there's a problem receiving the data.
public int sendRawPacket(byte[] packetData)
throws ClientSendException,
ClientReceiveException
Note: the method only tries once to contact the RADIUS host. Either the UDP authentication or reply packet may be lost, or the server may have chosen not to answer. Catching a ClientSendException or ClientReceiveException lets you know which one of the UDP packets was lost. Catching an IOException will catch both exceptions. The calling program must supply the retry algorithm or contact a backup RADIUS server.
packetData - Raw data to be sent as a packet.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.Access_Accept,
Access_Reject,
Access_Challenge,
Access_BadPacket,
getError()public boolean setDebug(boolean debug)
debug - Use true to enable debugging, false to disable debugging.
The standard output is used.
Access_BadPacket
public void setDebug(boolean debug,
String fileName)
throws IOException
debug - Use true to enable debugging, false to disable debugging.fileName - Debugging information will be written to this file. If the file name is null
the standard output is used.
IOException - if there's a problem opening the debugging output.Access_BadPacket,
logToDebug()public void setMaximumPacketSize(int maxPacketSize)
maxPacketSize - New packet size.public static boolean testEnc(String enc)
enc - The character encoding name.
public String toString()
public byte[] trim(byte[] pwdBytes)
pwdBytes - Password bytes returned from decode().
|
AXL RADIUS Server API V3 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||