public abstract class RadiusPacket extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected AttributeList |
attributes |
protected byte[] |
authenticator |
protected int |
code |
protected int |
identifier |
static int |
MAX_PACKET_LENGTH |
static int |
MIN_PACKET_LENGTH |
static short |
RADIUS_HEADER_LENGTH |
protected boolean |
recyclable |
protected boolean |
recycled |
| Constructor and Description |
|---|
RadiusPacket()
Default Constructor
|
RadiusPacket(AttributeList list)
Constructs a RadiusPacket with an AttributeList
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(RadiusAttribute attribute)
Adds an attribute to a RadiusPacket (without overriding any
existing attributes)
|
void |
addAttributes(AttributeList list)
Adds the contents of an AttributeList to a RadiusPacket
|
byte[] |
createAuthenticator(byte[] attributes,
int offset,
int attributsLength,
String sharedSecret)
Derived RadiusRequest classes must override this
|
RadiusAttribute |
findAttribute(long type) |
RadiusAttribute |
findAttribute(String aName) |
Object[] |
findAttributes(long type) |
AttributeList |
getAttributes()
Get the attributes of a RadiusPacket
|
Object |
getAttributeValue(long type) |
Object |
getAttributeValue(String aName) |
byte[] |
getAuthenticator() |
byte[] |
getAuthenticator(byte[] attributes,
int offset,
int attributesLength,
String sharedSecret) |
byte[] |
getAuthenticator(byte[] attributes,
String sharedSecret)
Get (or generate) the RADIUS Authenticator
|
int |
getCode() |
int |
getIdentifier()
Get the Identifier of the RadiusPacket (creating one if needed)
|
boolean |
isRecyclable() |
void |
overwriteAttribute(RadiusAttribute attribute)
Adds an attribute to a RadiusPacket overwriting any existing attribute
|
void |
removeAttribute(long attributeType)
Removes an attribute
|
void |
removeAttribute(RadiusAttribute attribute)
Removes an attribute
|
void |
setAuthenticator(byte[] authenticator) |
void |
setCode(int code) |
void |
setIdentifier(int i)
Set the Identifier byte of a RadiusPacket
|
String |
toString() |
String |
toString(boolean nonStandardAtts,
boolean unknownAttrs)
Formats the RadiusPacket into a String
|
boolean |
verifyAuthenticator(String sharedSecret) |
public static final int MIN_PACKET_LENGTH
public static final int MAX_PACKET_LENGTH
public static final short RADIUS_HEADER_LENGTH
protected int code
protected int identifier
protected byte[] authenticator
protected final AttributeList attributes
protected boolean recyclable
protected boolean recycled
public RadiusPacket()
public RadiusPacket(AttributeList list)
list - Initial AttributeListpublic void setCode(int code)
code - The code to setpublic int getCode()
public void addAttribute(RadiusAttribute attribute)
attribute - The attribute to addpublic void overwriteAttribute(RadiusAttribute attribute)
attribute - The attribute to addpublic void addAttributes(AttributeList list)
list - The attributes to addpublic void removeAttribute(RadiusAttribute attribute)
attribute - The RadiusAttribute to be removedpublic void removeAttribute(long attributeType)
attributeType - The attribute type to be removedpublic int getIdentifier()
public void setIdentifier(int i)
i - The new Identifierpublic AttributeList getAttributes()
public byte[] createAuthenticator(byte[] attributes,
int offset,
int attributsLength,
String sharedSecret)
attributes - public boolean verifyAuthenticator(String sharedSecret)
public void setAuthenticator(byte[] authenticator)
authenticator - The authenticator to set.public byte[] getAuthenticator()
public byte[] getAuthenticator(byte[] attributes,
String sharedSecret)
attributes - public byte[] getAuthenticator(byte[] attributes,
int offset,
int attributesLength,
String sharedSecret)
public RadiusAttribute findAttribute(long type)
type - The attribute typepublic Object[] findAttributes(long type)
type - The integer type of the attribute to findpublic RadiusAttribute findAttribute(String aName) throws UnknownAttributeException
aName - The name of the attribute to findUnknownAttributeExceptionpublic Object getAttributeValue(long type)
type - The integer type of the attribute to findpublic Object getAttributeValue(String aName) throws UnknownAttributeException
aName - The name of the attribute to findUnknownAttributeExceptionpublic String toString(boolean nonStandardAtts, boolean unknownAttrs)
public boolean isRecyclable()
Copyright © 2017. All rights reserved.