|
AXL RADIUS Server API V3 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectPacketInfo
Class providing information to an implementation class and returning packet information to the RADIUS server.
AccountingImpl,
ExtendedPacketImpl,
SnoopImpl,
EncryptImpl| Field Summary | |
static int |
AUTH_LENGTH
RADIUS authenticator length (value = 16). |
static byte |
AUTH_STATE_OBJECT
Code to set or get the State attribute object normally set by the AccessImpl class. |
| Method Summary | |
void |
addProxyTarget(ProxyTarget pt)
Add a proxy target to the target tables. |
AttributeList |
appendResponseAttributes(AttributeList aList)
Append response packet attributes. |
boolean |
cmp(byte[] passwordA,
byte[] passwordB)
Compare two byte arrays for equality. |
byte[] |
decode(byte[] password)
Decode an encoded password. |
byte[] |
encode(byte[] password)
Encode a plaintext password. |
boolean |
fromAccountingPort()
Determine if this packet arrived from the accounting port and therefore is probably an accounting packet. |
boolean |
fromAuthenticationPort()
Determine if this packet arrived from the authentication port and therefore is probably an authentication packet. |
byte[] |
getAuthenticator()
Get the authenticator's bytes. |
DatagramPacket |
getDatagram()
Get the original datagram for this packet. |
byte[] |
getDecodedUserPassword()
Get the decoded password from the User_Password attribute. |
String |
getHostRealm()
Get our own RADIUS server's realm Returns the realm of our own server which is useful in transparently directing packets to the local host in spite if what their realms might say. |
int |
getMaximumPacketSize()
Get the maximum RADIUS packet size. |
int |
getMessageID()
Get the packet Identifier (message ID). |
Object |
getModule(String moduleName,
Object obj)
Retrieves the module (ModuleRegister) object. |
String |
getName()
Return the User-Name attribute value stripped of any realm information. |
NAS |
getNAS()
Get the current NAS, if it's defined. |
int |
getPacketID()
Get the packet ID number. |
String |
getPacketTypeName(int packetType)
Get the name of a packet type. |
String |
getPrefix()
Return the prefix to the User-Name attribute. |
ProxyClient |
getProxyClient(boolean response,
int radiusPacketType,
AttributeList attrList,
Object proxyStateObject)
Create a client to send a particular packet to a realm. |
int |
getProxyStateAttributesLength()
Get Proxy-State's attributes length. |
ProxyTarget |
getProxyTargetByRealm(String realm)
Get a proxy target by realm. |
ProxyTarget[] |
getProxyTargets()
Get the list of proxy targets. |
RADIUSServer |
getRADIUSServer()
Get the server object. |
String |
getRealm()
Return the realm portion of the User-Name. |
Realm |
getRealmInfo(String realmName)
Return realm information. |
String[] |
getRealmList()
Return a list of the proxy realms. |
AttributeList |
getRequestAttributeList()
Get an attribute list |
Attribute[] |
getRequestAttributes()
Get an array of Attributes |
int |
getRequestType()
Get the request packet type |
String |
getRequestTypeName()
Get the name of the request packet type. |
AttributeList |
getResponseAttributeList()
Get return attributes. |
int |
getResponseType()
Get the response packet type |
String |
getResponseTypeName()
Get the name of the response packet type. |
byte[] |
getSecret()
Get the shared secret for this NAS. |
String |
getServerName()
Get the server's name. |
InetAddress |
getSourceAddress()
Get the packet's source IP address. |
int |
getSourcePort()
Get the packet's source UDP port. |
Object |
getStateObject(byte code)
Get the persistent State attribute object from the request attribute list. |
String |
getUserName()
Get the User-Name attribute value if available. |
byte[] |
getUserPassword()
Get the encoded password from the User_Password attribute. |
void |
removeProxyTarget(String targetName)
Remove a proxy target form the target tables This may be called at any time, before or after starting the server. |
void |
sendV2Trap(String msg)
Send a SNMP V2 trap message. |
void |
setResponseAttributes(Attribute[] aList)
Set response packet attributes. |
void |
setResponseAttributes(AttributeList aList)
Set response packet attributes. |
void |
setResponseType(int responseType)
Set the response packet type. |
void |
setStateObject(byte code,
Object o)
Set the persistent State object and create a State attribute tracking the object. |
void |
translateProxyId(boolean enable)
Force this proxy server to appear to be the actual client instead of the original client. |
byte[] |
trim(byte[] password)
Trim a decoded password of trailing zeroed bytes. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int AUTH_LENGTH
public static final byte AUTH_STATE_OBJECT
| Method Detail |
public void addProxyTarget(ProxyTarget pt)
throws RADIUSServerException
pt - proxy target information.
RADIUSServerException - if the proxy target name or address is missing.ProxyTargetpublic final AttributeList appendResponseAttributes(AttributeList aList)
aList - AttributeList to append.
public final boolean cmp(byte[] passwordA,
byte[] passwordB)
passwordA - Password to compare.passwordB - Password to compare.
public final byte[] decode(byte[] password)
password - Encoded password;
public final byte[] encode(byte[] password)
password - Encoded password;
public boolean fromAccountingPort()
public boolean fromAuthenticationPort()
public final byte[] getAuthenticator()
public final DatagramPacket getDatagram()
public final byte[] getDecodedUserPassword()
trim()public String getHostRealm()
public int getMaximumPacketSize()
public int getMessageID()
public Object getModule(String moduleName,
Object obj)
throws RADIUSServerException
For example, if you have a module called TEST use TEST t = ((TEST) getModule().test);
moduleName - Name of the module (e.g. "TEST").obj - Constructor argument or null if the default constructor is to be used.
RADIUSServerException - if the module exists but doesn't have the correct constructor.public final String getName()
somebody@somewhere.com only somebody is returned.
getRealm(),
getUserName()public final NAS getNAS()
public final int getPacketID()
public final String getPacketTypeName(int packetType)
packetType - Packet type.
public final String getPrefix()
xny556/somebody@somewhere.com only xny556 is returned.
getRealm(),
getUserName()
public ProxyClient getProxyClient(boolean response,
int radiusPacketType,
AttributeList attrList,
Object proxyStateObject)
throws RADIUSServerException,
AccessDropException
The packet containing the given attributes will be sent to a realm. This method allows separate packets to be sent to other servers for redundency (in the case of accounting) or for fail-over retries in the ProxyImpl class.
response - Set to true if this is a response packet like Access-Accept, Access-Challenge,
or false if it's a request like Accounting-Request or Access-Request.radiusPacketType - The type of packet, for example Access-Accept.attrList - Attribute list to be attached to the packet.proxyStateObject - The Object to be attached to proxy state.
See setProxyStateObject().
RADIUSServerException - if the packet type is unknown or the realm is unknown.
AccessDropException - if the realm is unknown. Generally this will be caught earlier
by the RADIUSServerException. It is possible for this to be thrown if there's a race condition
between sending the packet and removing the realm.
For an example see ProxyImpl/ProxyFailover.java and it's associated class ProxyImpl/ProxyPacketTimeout.java.
ProxyClientpublic int getProxyStateAttributesLength()
public ProxyTarget getProxyTargetByRealm(String realm)
This method searches all the proxy target primary names and their
synonyms. If a ProxyTarget has an empty string for a synonym
it will match empty realms (no realm information). Normally the the local server will
handle empty realms. If more than one ProxyTarget
has an empty synonym the results are unpredicatable.
If you are using the ProxyInfo.setTransparentProxy()
method use getHostRealm() to force the local server to handle the packet.
realm - The realm, usually from the User-Name attribute.
ProxyTarget or null if there are no matches for the realm
or the packet is for the local server.public ProxyTarget[] getProxyTargets()
public RADIUSServer getRADIUSServer()
RADIUSServerpublic final String getRealm()
somebody@somewhere.com only somewhere.com is returned.
getName(),
getUserName()
public Realm getRealmInfo(String realmName)
throws RADIUSServerException
realmName - Realm name (a.k.a. Proxy target).
RADUSServerException - if the realm cannot be found.
RADIUSServerExceptionpublic String[] getRealmList()
public final AttributeList getRequestAttributeList()
getRequestAttributes(),
setResponseAttributes(com.theorem.radserver3.AttributeList)public final Attribute[] getRequestAttributes()
getRequestAttributeList(),
setResponseAttributes(com.theorem.radserver3.AttributeList)public final int getRequestType()
public final String getRequestTypeName()
public final AttributeList getResponseAttributeList()
public final int getResponseType()
public final String getResponseTypeName()
public final byte[] getSecret()
public String getServerName()
public InetAddress getSourceAddress()
public int getSourcePort()
public Object getStateObject(byte code)
code - Code for the particular type of state object to retrieve.
public final String getUserName()
getRealm(),
getName()public final byte[] getUserPassword()
public void removeProxyTarget(String targetName)
throws RADIUSServerException
targetName - name of the target to remove.
RADIUSServerException - if SNMP isn't set up.public void sendV2Trap(String msg)
msg - Message.public final void setResponseAttributes(Attribute[] aList)
aList - Attribute array to return.public final void setResponseAttributes(AttributeList aList)
aList - AttributeList to return.public final void setResponseType(int responseType)
responseType - Reply packet type (e.g. Resource Query Response).
public void setStateObject(byte code,
Object o)
This is used to associate a State attribute with some locally held information. For example the expected EAP data like the identifier, perhaps the original MD5 challenge, and the anticipated EAP type the client must send. This call is generally for internal use where the code is known.
code - Code for this object.o - Object object to persist.RADIUSServer.setStateTTL(),
getStateObject(byte code)public void translateProxyId(boolean enable)
The default action is to use the value set in the server. The default action the server takes is to use the actual client's NAS-IP-Address and NAS-Identifier attribute values.
enable - Use true to enable proxy ID translation, false to disable it.RADIUSServer.translateProxyId(boolean)public final byte[] trim(byte[] password)
password - Password to be trimmed.
|
AXL RADIUS Server API V3 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||