AXL Software™

com.theorem.radserver3.eap
Class EAPClient

Object
  extended byEAPClient
Direct Known Subclasses:
EAPMD5Client

public class EAPClient
extends Object

Class to handle EAP information for a client.


Constructor Summary
EAPClient(byte[] name, RADIUSClient rc, InetAddress nasIPAddress, String nasIdentifier)
          EAP client constructor.
EAPClient(RADIUSClient rc, AttributeList commonList)
          EAP client constructor.
 
Method Summary
 void addAttributes(AttributeList list)
          Add some attributes to be sent all the time.
 AttributeList getAttributes()
          Get the server response attributes.
 boolean getDebugIndicator()
          Get the debugging indicator value.
 EAPPacket getEAPPacket()
          Get the EAP message packet in the response from the server.
 void logToDebug(String msg)
          Log a message to the debug file or stdout if debugging hasn't been set up.
 void reset(byte[] name)
          Reset the client for a new EAP request.
 int send(AttributeList requestList)
          Perform an authentication with the given attributes.
 boolean setDebug(boolean debug)
          Set debugging on or off.
 void setDebug(boolean debug, String fileName)
          Set debugging on or off.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EAPClient

public EAPClient(byte[] name,
                 RADIUSClient rc,
                 InetAddress nasIPAddress,
                 String nasIdentifier)
          throws EAPException
EAP client constructor. One of the nasIPAddress or the nasIdentifier should exist. It is recommended that both not be defined.

Parameters:
name - User-Name attribute value.
rc - Existing RADIUSClient.
nasIPAddress - Client NAS-IP-Address value or null.
nasIdentifier - Client NAS-Identifier value or null.
Throws:
EAPException - if the server cannot be found.

EAPClient

public EAPClient(RADIUSClient rc,
                 AttributeList commonList)
          throws EAPException
EAP client constructor. One of the nasIPAddress or the nasIdentifier should exist. It is recommended that both not be defined.

Parameters:
rc - RADIUSClient.
commonList - List of common attributes (User-Name, NAS-IP-Address, NAS-Identifier and so on).
Throws:
EAPException - if the server cannot be found.
Method Detail

addAttributes

public final void addAttributes(AttributeList list)
Add some attributes to be sent all the time. By default the User-Name, NAS-IP-Address, Message-Authenticator and EAP-Message are sent. If there are additional attributes to be sent they're added here.

Parameters:
list - Attribute list holding extra attributes.

getAttributes

public final AttributeList getAttributes()
Get the server response attributes.

Returns:
response attributes.

getDebugIndicator

public final boolean getDebugIndicator()
Get the debugging indicator value.

Returns:
True if debugging is enabled, false otherwise.

getEAPPacket

public final EAPPacket getEAPPacket()
                             throws EAPException
Get the EAP message packet in the response from the server.

Returns:
EAPPacket.
Throws:
EAPException - if there are no response attributes.

logToDebug

public final void logToDebug(String msg)
Log a message to the debug file or stdout if debugging hasn't been set up. This is used to log message to the same place the RADIUSClient logs.

Parameters:
msg - Message to write.
See Also:
setDebug()

reset

public final void reset(byte[] name)
                 throws EAPException
Reset the client for a new EAP request. This resets the User-Name attribute and RADIUS client.

Throws:
EAPException - if the client cannot be started or reset.

send

public final int send(AttributeList requestList)
               throws EAPException
Perform an authentication with the given attributes. This method does not perform retries.

Parameters:
requestList - AttributeList containing EAP-Message and Message-Authenticator attributes.
Returns:
packet type from server, either PacketType.Access-Challenge,PacketType.Access-Reject,. or PacketType.Access-Accept.
Throws:
EAPException - if there's a problem.

setDebug

public final boolean setDebug(boolean debug)
Set debugging on or off. Debugging information is written to the standard output. The information includes the packet contents, attributes, and the reason for the Access_BadPacket result from the authenticate() and accounting() methods. The reason is in the title of the packet display. If the output is sent to a file the file is overwritten each time the class is instantiated.

Parameters:
debug - Use true to enable debugging, false to disable debugging.
Returns:
False if the standard output can't be opened.
See Also:
PacketType.Access_BadPacket

setDebug

public final void setDebug(boolean debug,
                           String fileName)
                    throws IOException
Set debugging on or off. Debugging information is written to a file or the standard output. The information includes the packet contents, attributes, and the reason for the Access_BadPacket result from the authenticate() and accounting() methods. The reason is in the title of the packet display.

Parameters:
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.
Throws:
IOException - if there's a problem opening the debugging output.
See Also:
logToDebug()

AXL Software™

Submit a bug report or feature request

Copyright 1998-2008 AXL Software™. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.