|
AXL RADIUS Server API V3 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectAttributeList
VendorSpecific
Vendor-Specific attribute handler.
Vendor-Specific attributes (VSA) are used to encapsulate attributes peculiar to a vendor. Usually only one vendor sub-attribute is attached to the VSA, but this will vary with servers and clients.
The Vendor Id is found in the table of Private Enterprise Numbers
which can be found on the internet. Vendors offer dictionaries containing the
sub-attribute numbers, data types, and formats. These
dictionaries are usually provided with the hardware. Please see the RADIUSDictionary class
for more information on dictionaries.
Some vendors are introducing a new style of sub-attribute. These have longer tags to increase the number of sub-attribute types. The normal tags are 8 bits in length allowing 256 values while the long tags are 16 bits allowing 65535 values. For client applications long tags can only be used with servers that are configured to handle long tags.
Some vendors require long attribute tags within a VSA, notably Ascend. These are supported using
the VendorSpecific(int vendorID, boolean longTags) method.
The client and server must agree that long tags will be used in VSA's.
Since this class extends the AttributeList class all addAttribute() methods available. For examples of VendorSpecific activities see VSExamples.java.
AttributeList,
Serialized Form| Field Summary | |
static boolean |
LONG_TAGS
Use long tags (16 bit) -true. |
static boolean |
SHORT_TAGS
Use short tags (8 bit - the default) -false. |
| Constructor Summary | |
VendorSpecific(Attribute vs)
Constructor to extract sub-attributes from a Vendor-Specific attribute. |
|
VendorSpecific(byte[] attrData)
Constructor for creating Vendor-Specific sub-attributes from the attribute data value. |
|
VendorSpecific(byte[] attrData,
boolean longTags)
Constructor for extracting Vendor-Specific attribute(s) from the attribute data field with long or short tags. |
|
VendorSpecific(int vendorID)
Constructor for creating a Vendor-Specific attribute using standard short tags. |
|
VendorSpecific(int vendorID,
boolean longTags)
Constructor forcreating a Vendor-Specific attribute using either long or short tags. |
|
| Method Summary | |
static void |
addVendor(String className,
int vendorID)
Add a Vendor-Specific definition class for debugging. |
byte[] |
createRadiusAttributeBlock()
Create the RADIUS attribute block. |
Attribute |
getAttribute()
Return the completed attribute. |
byte[] |
getRawData()
Get the raw data content of the Vendor-Specific attribute. |
int |
getVendorID()
Get the vendor ID for this attribute. |
boolean |
hasVendorAttributes()
Determine if there are valid vendor attributes. |
Attribute |
setData(byte[] data)
Set the data portion of the attribute. |
VendorSpecific |
setLongTag()
Set the Vendor-Specific sub-attribute to use long tags. |
VendorSpecific |
setLongTag(boolean longTags)
Set the Vendor-Specific sub-attribute to use a particular type of tag. |
String |
toString()
Return the string representation of a VendorSpecific attribute. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final boolean LONG_TAGS
public static final boolean SHORT_TAGS
| Constructor Detail |
public VendorSpecific(Attribute vs)
vs - Vendor-Specific attribute.public VendorSpecific(byte[] attrData)
attrData - Bytes specifying the value portion of the Vendor-Specific attribute.
public VendorSpecific(byte[] attrData,
boolean longTags)
attrData - Bytes specifying the value portion of the Vendor-Specific attribute.longTags - If set to true use long (16 bit) tags.
Normally tags are 8 bits. Some vendors are using long tags to increase the number
of attribute types they can define.public VendorSpecific(int vendorID)
vendorID - Vendor-ID for this attribute.
public VendorSpecific(int vendorID,
boolean longTags)
vendorID - Vendor-ID for this attribute.longTags - If set to true use long (16 bit) tags.
Normally tags are 8 bits. Some vendors are using long tags to increase the number
of attribute types they can define.| Method Detail |
public static void addVendor(String className,
int vendorID)
RADIUSDictionary.
This adds a new Vendor-Specific class to the existing list for the VendorSpecific.toString() method
as well as the AttributeList.toString() method.
This class must contain a VENDORID definition like this:
public static final int VENDORID = nnn;
where nnn is the vendor ID. All other similar definitions will be taken to be attribute tag types.
For an example of this see Microsoft.java or Cisco.java. If you follow these examples to produce MyCompanyVS.java you can more easily include your Vendor-Specific definitions using the statement: new MyCompanyVS().
To use this method explicitly:
VendorSpecific.addVendor("com.myCompany,MyCompanyVS",
MyCompanyVS.VENDORID);
For example, the Cisco class is added like this:
add("com.theorem.radserver.Cisco", Cisco.VENDORID);
For more vendor ID's see the IANA Private Enterprise Numbers
className - Class namevendorID - Vendor number.public byte[] createRadiusAttributeBlock()
createRadiusAttributeBlock in class AttributeListAttributeList.loadRadiusAttributes(byte[], int, int)public Attribute getAttribute()
public byte[] getRawData()
public int getVendorID()
public boolean hasVendorAttributes()
public Attribute setData(byte[] data)
For example the old Telebit_Login_Command data just passed a String.
Once set no accumulated attributes using addAttribute() methods will be used.
data - Raw data to be used for the attribute data portion.
public VendorSpecific setLongTag()
Setting this after using any constructor other than VendorSpecific(int vendorID)
will cause further conversions to or from RADIUS data blocks to use the new format.
In the case of the VendorSpecific(int vendorID) constructor the method
loadRadiusAttributes()
the attributes will be loaded with the given tag type (the default is to use short tags).
This can be used to convert types after loading a VSA.
If set to false or SHORT_TAGS normal tags of 8 bits.
Some vendors are using long tags to increase the number
of sub-attribute types they can define.
public VendorSpecific setLongTag(boolean longTags)
Setting this after using any constructor other than VendorSpecific(int vendorID)
will cause further conversions to or from RADIUS data blocks to use the new format.
In the case of the VendorSpecific(int vendorID) constructor the method
loadRadiusAttributes()
the attributes will be loaded with the given tag type (the default is to use short tags).
This can be used to convert types after loading a VSA.
longTags - If set to true or LONG_TAGS use long (16 bit) tags.
If set to false or SHORT_TAGS normal tags of 8 bits.
Some vendors are using long tags to increase the number
of sub-attribute types they can define.public String toString()
toString in class AttributeList
|
AXL RADIUS Server API V3 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||