AXL RADIUS Server API V3

com.theorem.radserver3
Class NAS

Object
  extended byNAS

public class NAS
extends Object

NAS (RADIUS Client) information. Class holding information about a NAS (Network Access Server, or RADIUS client).

See Also:
RADIUSServer.addNAS(com.theorem.radserver3.NAS)

Field Summary
 String NAS_Address
          The string version of the NAS IP address.
 InetAddress NASAddress
          The NAS IP Address.
 boolean NASIdEnforced
          Unused
 String NASIdentifier
          The NAS's name.
 String secret
          The secret shared by the NAS and RADIUS server Required.
 
Constructor Summary
NAS()
          Default constructor.
NAS(InetAddress addr, String secret)
          Constructor to fill the fields.
NAS(InetAddress addr, String id, String secret)
          Constructor to fill the fields.
 
Method Summary
 void addLongVendorSpecificTags(int vendorId)
          Enable the reception of long Vendor-Specific attribute tags for this NAS.
 boolean allowCoARequests()
          Determine if this NAS can recieve CoA requests..
 boolean allowDisconnectRequests()
          Determine if this NAS can recieve DM requests.
 void enableCoARequests(boolean enable)
          Enable a NAS to receive CoA-Requests.
 void enableDMRequests(boolean enable)
          Enable a NAS to receive Disconnect-Requests.
 boolean equals(Object obj)
          Determine if one NAS object is equal to this one.
 InetAddress getAddress()
          Get the NAS IP address.
 String getIdentifier()
          Get the NAS-Identifer value.
 byte[] getSecret()
          Get the secret.
 int hashCode()
          Get the hash code.
 boolean hasLongVendorSpecificTags(int vendorId)
          Determine if long attribute tags are enabled for this Vendor.
 String toString()
          Return a string representation of the NAS.
 boolean verify()
          Check this NAS entry for the necessities.
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAS_Address

public String NAS_Address
The string version of the NAS IP address. Set by the server for internal tables.


NASAddress

public InetAddress NASAddress
The NAS IP Address. Required.


NASIdEnforced

public boolean NASIdEnforced
Unused


NASIdentifier

public String NASIdentifier
The NAS's name. Optional, it may not have a name.


secret

public String secret
The secret shared by the NAS and RADIUS server Required.

Constructor Detail

NAS

public NAS()
Default constructor. Fields are expected to filled manually.


NAS

public NAS(InetAddress addr,
           String secret)
Constructor to fill the fields.

Parameters:
addr - NASAddress.
secret - Shared secret.
See Also:
NASAddress, secret

NAS

public NAS(InetAddress addr,
           String id,
           String secret)
Constructor to fill the fields.

Parameters:
addr - NASAddress.
id - NAS-Identifier
secret - Shared secret.
See Also:
NASAddress, secret
Method Detail

addLongVendorSpecificTags

public void addLongVendorSpecificTags(int vendorId)
Enable the reception of long Vendor-Specific attribute tags for this NAS. The default behavior is the disallow long VSA sub tag lengths.

Parameters:
vendorId - Permit long VSA tags for this Vendor-Id.
Since:
3.41
See Also:
hasLongVendorSpecificTags(int vendorId)

allowCoARequests

public boolean allowCoARequests()
Determine if this NAS can recieve CoA requests.. The default behavior is the disallow CoA requests.

Returns:
True if it does.

allowDisconnectRequests

public boolean allowDisconnectRequests()
Determine if this NAS can recieve DM requests. The default behavior is the disallow disconnect requests.

Returns:
True if it does.
Since:
3.40

enableCoARequests

public void enableCoARequests(boolean enable)
Enable a NAS to receive CoA-Requests. From RFC 3576.

Parameters:
enable - Set to true to enable CoA-Requests (Change-of-Authorization).
Since:
3.40

enableDMRequests

public void enableDMRequests(boolean enable)
Enable a NAS to receive Disconnect-Requests. From RFC 3576.

Parameters:
enable - Set to true to enable Disconnect-Requests.
Since:
3.40

equals

public boolean equals(Object obj)
Determine if one NAS object is equal to this one. Equality is based on the IP address and secret values.

Parameters:
obj - Object
Returns:
True if the NAS's are equal.

getAddress

public InetAddress getAddress()
Get the NAS IP address.

Returns:
NAS address.

getIdentifier

public String getIdentifier()
Get the NAS-Identifer value.

Returns:
NAS identifier or an empty string if none was assigned.

getSecret

public byte[] getSecret()
Get the secret.

Returns:
Secret.

hashCode

public int hashCode()
Get the hash code.

Returns:
hash code.

hasLongVendorSpecificTags

public boolean hasLongVendorSpecificTags(int vendorId)
Determine if long attribute tags are enabled for this Vendor.

This is commonly used with the Vendor-Specific class to extract or create long tags in the sub-attributes. For example this might be used in AccessImpl as:

 public void authenticate(AuthInfo auth)
 {
 	AttributeList inList = auth.getRequestAttributeList();
 	...
 	// Get the originating NAS information.
 	NAS n = auth.getNAS();
 	// Use the NAS information to extract the VSA sub-attributes
 	// depending on the vendor id.
 	VendorSpecific vs[] = inList.getVendorSpecific(2000,
 		 n.hasLongVendorSpecificTags(2000));
 	...
 }
 

Parameters:
vendorId - The vendor Id.
Returns:
True if long tags are enabled for this Vendor
Since:
3.41

toString

public String toString()
Return a string representation of the NAS.

Returns:
string.

verify

public boolean verify()
               throws RADIUSServerException
Check this NAS entry for the necessities.

Returns:
True if the NAS object is acceptable.
Throws:
RADIUSServerException - if the NAS object is missing it's NASAddress field or the secret is null.

AXL RADIUS Server API V3

Submit a bug report or feature request

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