|
AXL Software | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectRADIUSDictionary
Class to read RADIUS dictionary files.
Note that the setVendorId(int vendorId) can change
how the default attributes and value are displayed.
Some examples are found in DictionaryExamples.java.
| Field Summary | |
static int |
ABINARY
The attribute is probably an 'abinary', Ascend's binary filter format - 8192. |
static int |
BYTE
The attribute is probably a 'byte', a one byte value - 16384. |
static int |
COMBO_IP
The attribute is probably either an ipaddr or a v6ipaddr value - 131072. |
static int |
DATE
The attribute is probably time - 8. |
static int |
ENCRYPT1
The attribute uses encryption type 1 -PAP encoding (can be OR'd with other values) - 64. |
static int |
ENCRYPT2
The attribute uses encryption type 2 - SALT encoding (can be OR'd with other values) - 128. |
static int |
ENCRYPT3
The attribute uses encryption type 3 - Ascend proprietary encoding (can be OR'd with other values) - 256. |
static int |
ETHER
The attribute is probably an 'ether' with the format of 16 octets: 'hh:hh:hh:hh:hh:hh' - 2048. |
static int |
IFID
The attribute is probably an 'ifid' - 4096. |
static int |
INTEGER
The attribute is probably an integer - 1. |
static int |
IPADDRESS
The attribute is probably an IP Address (v4 or V6) - 16. |
static int |
IPV6ADDRESS
The attribute is probably an IP Address (V6) - 512. |
static int |
IPV6PREFIX
The attribute is probably an IPV6 Prefix - 1024. |
static boolean |
LONG_TAGS
Vendor tag size format is long tags (16 bit) - true. |
static int |
OCTETS
The attribute is probably binary octets - 2. |
static int |
SHORT
The attribute is probably a 'short', a two byte integer value - 32768. |
static boolean |
SHORT_TAGS
Vendor tag size format is short tags (8 bit) - false. |
static int |
STRING
The attribute is probably a printable string - 4. |
static int |
TLV
The attribute is probably a 'tlv' a tag/length/value value - 65536. |
static int |
TUNNEL
The attribute is a tunnel attribute (can be OR'd with other values) - 32. |
static int |
UNKNOWN
The attribute type is unknown - 0. |
static int |
UNKNOWN_DATA_TYPE
No data type can be found - -1. |
static int |
UNKNOWN_VENDOR
No vendor name can be found - -1. |
| Constructor Summary | |
RADIUSDictionary()
Dictionary constructor. |
|
RADIUSDictionary(String sourceName)
Dictionary constructor. |
|
| Method Summary | |
void |
addAttribute(String name,
int tag,
int type)
Add an attribute to the dictionary. |
void |
addAttribute(String name,
int tag,
int type,
int vendorId)
Add an attribute to the dictionary. |
void |
addAttribute(String name,
int tag,
int type,
int vendorId,
boolean isTunnel)
Add an attribute to the dictionary. |
void |
addAttribute(String name,
String tag,
String type,
String vendorId)
Add an attribute to the dictionary. |
void |
addAttribute(String name,
String tag,
String type,
String vendorId,
boolean isTunnel)
Add an attribute to the dictionary. |
void |
addVendor(String name,
int vendorNumber)
Add a vendor name number. |
Iterator |
attributeIterator()
Get a list of Vendor-Specific sub-attributes. |
Iterator |
attributeIterator(int vendorId)
Get a list of Vendor-Specific sub-attributes. |
Attribute |
createAttribute(int vendorId,
int tag,
byte[] value)
Create an attribute for a vendor with the given byte array value. |
Attribute |
createAttribute(int vendorId,
String attrName,
byte[] value)
Create an attribute for a vendor with the given byte array value. |
Attribute |
createAttribute(int vendorId,
String attrName,
int value)
Create an attribute for a vendor with the given integer value. |
Attribute |
createAttribute(int vendorId,
String attrName,
String symbolicValue)
Create an attribute for a vendor with the given integer value matching the symbolic name as the stringValue argument. |
Attribute |
createAttribute(String attrName,
byte[] value)
Create an attribute for a vendor with the given byte array value. |
Attribute |
createAttribute(String attrName,
InetAddress value)
Create an attribute for a vendor with the given byte array value. |
Attribute |
createAttribute(String attrName,
int value)
Create an attribute for a vendor with the given byte array value. |
Attribute |
createAttribute(String attrName,
String symbolicValue)
Create an attribute with the given integer value. |
boolean |
equals(Object obj)
Indicates whether this dictionary equals another. |
String[] |
getAllValueNames(int vendorId,
String vendorAttributeName)
Get a list of all named values for an attribute. |
String[] |
getAllValueNames(String attributeName)
Get a list of all named values for an attribute. |
int |
getDataType(int attribute)
Get the data type for this attribute. |
int |
getDataType(int vendorId,
int attribute)
Get the data type for this attribute. |
int |
getDataTypeFlags(int attributeTag)
Get the flags associated with the attribute, if any. |
int |
getDataTypeFlags(int vendorId,
int attributeTag)
Get the flags associated with the attribute, if any. |
String |
getDataTypeName(int dataType)
Get the data type's name. |
int |
getEncryptionType(int attributeTag)
Get the encryption type for this attribute. |
int |
getEncryptionType(int vendorId,
int attributeTag)
Get the encryption type for this attribute. |
int |
getIntValue(int vendorId,
int tag,
String valueName)
Given the vendor number, attribute tag and value name return the value's integer equivalent. |
int |
getIntValue(int attribute,
String valueName)
Given the value number from the dictionary VALUE name. |
String |
getName(int attributeTag)
Given the tag number of an attribute return it's name. |
String |
getName(int vendorId,
int attributeTag)
Given the tag number of an attribute return it's name. |
int |
getTag(int vendorId,
String name)
Given the name of the attribute return it's tag value. |
int |
getTag(String name)
Given the name of the attribute return it's tag value. |
String |
getValueName(int attribute,
int value)
Given the attribute number get the name of the particular attribute's integer value field return the name of that integer value. |
String |
getValueName(int vendorId,
int attribute,
int value)
Given the attribute number get the name of the particular attribute's integer value field return the name of that integer value. |
int |
getVendorId()
Get the default vendorId. |
int |
getVendorId(String vendorName)
Get the vendor number from the name. |
String |
getVendorName(int vendorId)
Get a vendor name from a vendor id number. |
String[] |
getVendorNames()
Return an array of Vendor names |
boolean |
getVendorTagLength()
Get the vendor tag size format - either long or short tags. |
boolean |
getVendorTagLength(int vendorId)
Get the vendor tag size format - either long or short tags. |
int |
hashCode()
Get the hashcode for this dictionary. |
boolean |
hasValue(int attributeTag)
Determine if there are known constants (symbolic names) for this attribute. |
boolean |
hasValue(int vendorId,
int attributeTag)
Determine if there are known constants (symbolic names) for this VSA sub-attribute. |
boolean |
hasValue(String attrName)
Determine if there are known constants (symbolic names) for this attribute. |
boolean |
isTunnel(int attribute)
Determine if this attribute is a tunnel attribute. |
boolean |
isTunnel(int vendorId,
int attribute)
Determine if this attribute is a tunnel attribute. |
boolean |
isVSA(int attribute)
Determine if this attribute is a Vendor-Specific attribute (VSA). |
boolean |
isVSA(String attributeName)
Determine if this attribute is a Vendor-Specific attribute (VSA). |
void |
merge(RADIUSDictionary dict)
Merge another dictionary with this one. |
void |
read()
Read the dictionary file. |
void |
setEncryptionType(int attributeTag,
int encType)
Set the encryption type for this attribute. |
void |
setEncryptionType(int vendorId,
int attributeTag,
int encType)
Set the encryption type for this attribute. |
void |
setSymbolicIntValue(int vendorId,
String attributeName,
String symbolicName,
int value)
Set a symbolic attribute value for and attribute. |
void |
setSymbolicIntValue(String attributeName,
String symbolicName,
int value)
Set a symbolic attribute value for and attribute. |
void |
setTunnel(int attribute)
Set the tunnel flag for this attribute. |
void |
setTunnel(int vendorId,
int attribute)
Set the tunnel flag for this attribute. |
void |
setVendorId(int vendorId)
Override the Vendor Id for all non-vendor Id lookups. |
void |
setVendorTagLength(boolean longOrShort)
Set the vendor tag size format - either long or short tags. |
void |
setVendorTagLength(int vendorId,
boolean longOrShort)
Set the vendor tag size format - either long or short tags. |
String |
toString()
String version of this class. |
String |
toVerboseString()
Produce a vebose string of vendors and all attributes and values. |
| Methods inherited from class Object |
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int ABINARY
public static final int BYTE
public static final int COMBO_IP
public static final int DATE
public static final int ENCRYPT1
public static final int ENCRYPT2
public static final int ENCRYPT3
public static final int ETHER
public static final int IFID
public static final int INTEGER
public static final int IPADDRESS
public static final int IPV6ADDRESS
public static final int IPV6PREFIX
public static final boolean LONG_TAGS
public static final int OCTETS
public static final int SHORT
public static final boolean SHORT_TAGS
public static final int STRING
public static final int TLV
public static final int TUNNEL
public static final int UNKNOWN
public static final int UNKNOWN_DATA_TYPE
public static final int UNKNOWN_VENDOR
| Constructor Detail |
public RADIUSDictionary()
public RADIUSDictionary(String sourceName)
sourceName - Source of the dictionary (usually a file).| Method Detail |
public void addAttribute(String name,
int tag,
int type)
name - Attribute tag name like "Message_Authenticator".tag - Attributes value like 80. Tags larger than 255 may be used
for internal purposes. No packet attribute will have a value larger than 255.type - Attribute type, like RADIUSDictionary.OCTETS.
public void addAttribute(String name,
int tag,
int type,
int vendorId)
name - Attribute tag name like "Message_Authenticator".tag - Attributes value like 80. Tags larger than 255 may be used
for internal purposes. No packet attribute will have a value larger than 255.type - Attribute type, like RADIUSDictionary.OCTETS.vendorId - Vendor identifier number or 0 for standard attributes that do not
have a vendor.
public void addAttribute(String name,
int tag,
int type,
int vendorId,
boolean isTunnel)
name - Attribute tag name like "Message_Authenticator".tag - Attributes value like 80. Tags larger than 255 may be used
for internal purposes. No packet attribute will have a value larger than 255.type - Attribute type, like RADIUSDictionary.OCTETS.vendorId - Vendor identifier number or 0 for standard attributes that do not
have a vendor.isTunnel - Set to true if this is a tunnel attribute.
public void addAttribute(String name,
String tag,
String type,
String vendorId)
throws IOException
name - Attribute tag name like "Message_Authenticator".tag - Attributes value like "80". Tags larger than 255 may be used
for internal purposes. No packet attribute will have a value larger than 255.type - Attribute type, like "OCTETS".vendorId - Vendor identifier number or "0" for standard attributes that do not
have a vendor.
IOException - if there's a problem decoding the string values.
public void addAttribute(String name,
String tag,
String type,
String vendorId,
boolean isTunnel)
throws IOException
name - Attribute tag name like "Message_Authenticator".tag - Attributes value like "80". Tags larger than 255 may be used
for internal purposes. No attributes to be placed in packets man have a value larger than 255.type - Attribute type, like "OCTETS".vendorId - Vendor identifier number or "0" for standard attributes that do not
have a vendor.isTunnel - Set to true if this is a tunnel attribute.
IOException - if there's a problem decoding the string values.
public void addVendor(String name,
int vendorNumber)
name - Vendor name.vendorNumber - Vendor number.public Iterator attributeIterator()
public Iterator attributeIterator(int vendorId)
vendorId - Vendor Id.
public Attribute createAttribute(int vendorId,
int tag,
byte[] value)
vendorId - Vendor Id numbertag - Attribute tag value.value - Attribute value
public Attribute createAttribute(int vendorId,
String attrName,
byte[] value)
vendorId - Vendor Id number.attrName - Attribute name.value - Attribute value
public Attribute createAttribute(int vendorId,
String attrName,
int value)
vendorId - Vendor Id number.attrName - Attribute name.value - Attribute value as an IP address (Ipv4 or Ipv6)
setVendorId(int vendorId)
public Attribute createAttribute(int vendorId,
String attrName,
String symbolicValue)
For actual string values convert the string to a byte array and
use createAttribute(String attrName, byte[] value).
E.g.createAttribute(456, "Framed-Compression", "IPX-Header-Compression")
creates the same result as new Attribute(Attribute.Framed_Compression, 2);
vendorId - Vendor Id number.attrName - Attribute name.symbolicValue - Attribute's symbolic value
public Attribute createAttribute(String attrName,
byte[] value)
attrName - Attribute name.value - Attribute value
setVendorId(int vendorId)
public Attribute createAttribute(String attrName,
InetAddress value)
attrName - Attribute name.value - Attribute value as an IP address (Ipv4 or Ipv6)
setVendorId(int vendorId)
public Attribute createAttribute(String attrName,
int value)
attrName - Attribute name.value - Attribute value as an integer.
setVendorId(int vendorId)
public Attribute createAttribute(String attrName,
String symbolicValue)
For actual string values convert the string to a byte array and
use createAttribute(String attrName, byte[] value).
attrName - Attribute name.
This can be a vendor specific attribute if the
name contains the vendor name like "Microsoft.MS-CHAP-Response".symbolicValue - Attribute's symbolic value
setVendorId(int vendorId)public boolean equals(Object obj)
public String[] getAllValueNames(int vendorId,
String vendorAttributeName)
vendorId - The vendorId.vendorAttributeName - Vendor attribute name.
public String[] getAllValueNames(String attributeName)
attributeName - Attribute name, for example 'Acct-Status-Type'.
public int getDataType(int attribute)
attribute - Attribute tag
UNKNOWN,
INTEGER,
OCTETS,
STRING,
DATE,
IPADDRESS,
IPV6ADDRESS,
TUNNEL,
ENCRYPT1,
ENCRYPT2.
Note that TUNNEL may be OR'd with any other type. Tunnel attributes are relatively rare.
setVendorId(int vendorId)
public int getDataType(int vendorId,
int attribute)
vendorId - Vendor Id.attribute - Attribute tag
UNKNOWN,
INTEGER,
OCTETS,
STRING,
DATE,
IPADDRESS,
IPV6ADDRESS,
TUNNEL.
Note that TUNNEL may be OR'd with any other type. Tunnel attributes are relatively rare.
public int getDataTypeFlags(int attributeTag)
attributeTag - Attribute tag value.
public int getDataTypeFlags(int vendorId,
int attributeTag)
vendorId - Vendor Id.attributeTag - Attribute tag value.
public String getDataTypeName(int dataType)
getDataType(int, int) for the meaning of the data type.
dataType - Data type.
public int getEncryptionType(int attributeTag)
attributeTag - Attribute tag value.
ENCRYPT1, ENCRYPT2, or 0 for no encryption.
public int getEncryptionType(int vendorId,
int attributeTag)
vendorId - Vendor Id.attributeTag - Attribute tag value.
ENCRYPT1, ENCRYPT2, or 0 for no encryption.
public int getIntValue(int vendorId,
int tag,
String valueName)
For example return the value for (Bay-Networks, Annex-User-Server-Location, "local") should be 1.
vendorId - Vendor Identifier number.tag - Attribute tag valuevalueName - Name of value to set.
public int getIntValue(int attribute,
String valueName)
attribute - Attribute tag number.valueName - Name of value (E.g."PPP");
public String getName(int attributeTag)
attributeTag - Attribute tag value.
setVendorId(int vendorId)
public String getName(int vendorId,
int attributeTag)
vendorId - Vendor Id.attributeTag - Attribute tag value.
public int getTag(int vendorId,
String name)
vendorId - Vendor Id.name - Attribute name.
public int getTag(String name)
name - Attribute name.
setVendorId(int vendorId)
public String getValueName(int attribute,
int value)
attribute - Attribute number.value - number of the attribute value.
public String getValueName(int vendorId,
int attribute,
int value)
attribute - Attribute number.value - number of the attribute value.
public int getVendorId()
setVendorId(int vendorId).
public int getVendorId(String vendorName)
vendorName - Vendor name.
UNKNOWN_VENDOR if the vendor name can't be found.public String getVendorName(int vendorId)
vendorId - Vendor Identifier.
public String[] getVendorNames()
public boolean getVendorTagLength()
SHORT_TAGS or LONG_TAGS.public boolean getVendorTagLength(int vendorId)
vendorId - Vendor Id.
SHORT_TAGS or LONG_TAGS.public int hashCode()
public boolean hasValue(int attributeTag)
attributeTag - Attribute tag.
setVendorId(int vendorId)
public boolean hasValue(int vendorId,
int attributeTag)
vendorId - Vendor Id.attributeTag - Attribute tag.
public boolean hasValue(String attrName)
attrName - Attribute name.
setVendorId(int vendorId)public boolean isTunnel(int attribute)
attribute - Attribute tag number.
public boolean isTunnel(int vendorId,
int attribute)
vendorId - Vendor Identifier number.attribute - Attribute tag number.
public boolean isVSA(int attribute)
attribute - Attribute.
public boolean isVSA(String attributeName)
attributeName - Attribute name.
public void merge(RADIUSDictionary dict)
dict - Dictionary to merge.
public void read()
throws IOException
IOException - if there's a problem reading or parsing the file.
public void setEncryptionType(int attributeTag,
int encType)
attributeTag - Attribute tag value.encType - One of ENCRYPT1, ENCRYPT2, or 0 for no encoding.
The default is no encoding.
public void setEncryptionType(int vendorId,
int attributeTag,
int encType)
vendorId - Vendor Id.attributeTag - Attribute tag value.encType - One of ENCRYPT1, ENCRYPT2, or 0 for no encryption.
The default is no encoding.
public void setSymbolicIntValue(int vendorId,
String attributeName,
String symbolicName,
int value)
vendorId - Vendor ID.attributeName - The attribute's symbolic name.symbolicName - The name of the value.value - The integer value for the symbolic name.
public void setSymbolicIntValue(String attributeName,
String symbolicName,
int value)
attributeName - The attribute's symbolic name.symbolicName - The name of the value.value - The integer value for the symbolic name.public void setTunnel(int attribute)
attribute - Attribute tag number.
public void setTunnel(int vendorId,
int attribute)
vendorId - Vendor Identifier number.attribute - Attribute tag number.public void setVendorId(int vendorId)
This causes all methods that don't specifiy a particular vendorId to use this vendorId. In normal operation such methods will return information about standard RADIUS attributes.
vendorId - The Vendor Id to use in default lookups. Setting this to
zero (0) will restore the default behavior of looking up standard RADIUS
attributes.public void setVendorTagLength(boolean longOrShort)
longOrShort - - one of SHORT_TAGS or LONG_TAGS.
public void setVendorTagLength(int vendorId,
boolean longOrShort)
vendorId - Vendor Id.longOrShort - - one of SHORT_TAGS or LONG_TAGS.public String toString()
public String toVerboseString()
|
AXL Software | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||