|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jradius.packet.RadiusFormat
public class RadiusFormat
Default RadiusPacket/RadiusAttribute format class. This class formats and parses UDP RADIUS Packets. Derived classes implement other formats.
Nested Class Summary | |
---|---|
protected class |
RadiusFormat.AttributeParseContext
|
Field Summary | |
---|---|
static int |
VSA_HEADER_LENGTH
|
Constructor Summary | |
---|---|
RadiusFormat()
|
Method Summary | |
---|---|
static RadiusFormat |
getInstance()
|
void |
packAttribute(java.io.OutputStream out,
RadiusAttribute a)
Packs a RadiusAttribute into a DataOutputStream |
byte[] |
packAttributeList(AttributeList attrs)
Packs an AttributeList into a byte array |
void |
packHeader(java.io.OutputStream out,
RadiusAttribute a)
Packs a RadiusAttribute header into a DataOutputStream |
void |
packHeader(java.io.OutputStream out,
RadiusPacket p,
byte[] attributeBytes)
Packs the RadiusPacket into a DataOutputStream |
void |
packHeader(java.io.OutputStream out,
VSAttribute a)
Packs a VSAttribute header into a DataOutputStream |
byte[] |
packPacket(RadiusPacket packet)
Packs a RadiusPacket into a byte array |
static int |
readUnsignedByte(java.io.InputStream in)
|
static long |
readUnsignedInt(java.io.InputStream in)
|
static int |
readUnsignedShort(java.io.InputStream in)
|
static void |
setAttributeBytes(RadiusPacket packet,
byte[] bAttributes)
Parses attributes and places them in a RadiusPacket |
protected int |
unpackAttributeHeader(java.io.InputStream in,
RadiusFormat.AttributeParseContext ctx)
Unpacks the header of a RadiusAttribute from a DataInputStream |
void |
unpackAttributes(AttributeList attrs,
byte[] bytes,
int bLength)
Unpacks RadiusAttributes from a byte array into an AttributeList |
static void |
writeUnsignedByte(java.io.OutputStream out,
int b)
|
static void |
writeUnsignedInt(java.io.OutputStream out,
long i)
|
static void |
writeUnsignedShort(java.io.OutputStream out,
int s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int VSA_HEADER_LENGTH
Constructor Detail |
---|
public RadiusFormat()
Method Detail |
---|
public static RadiusFormat getInstance()
public static void setAttributeBytes(RadiusPacket packet, byte[] bAttributes)
packet
- The RadiusPacket to parse attributes intobAttributes
- The attribute bytes to parsepublic byte[] packPacket(RadiusPacket packet)
packet
- The RadiusPacket to pack
public byte[] packAttributeList(AttributeList attrs)
attrs
- The AttributeList to pack
public void packAttribute(java.io.OutputStream out, RadiusAttribute a) throws java.io.IOException
out
- The DataOutputStream to write attibutes toa
- The RadiusAttribute to pack
java.io.IOException
public void packHeader(java.io.OutputStream out, RadiusPacket p, byte[] attributeBytes) throws java.io.IOException
out
- The DataOutputStream to write top
- The RadiusPacket to packattributeBytes
- The RadiusPacket attributes
java.io.IOException
public void packHeader(java.io.OutputStream out, RadiusAttribute a) throws java.io.IOException
out
- The DataOutputStream to write toa
- The RadiusAttribute to pack
java.io.IOException
public void packHeader(java.io.OutputStream out, VSAttribute a) throws java.io.IOException
out
- The DataOutputStream to write toa
- The VSAttribute to pack
java.io.IOException
public void unpackAttributes(AttributeList attrs, byte[] bytes, int bLength)
attrs
- The AttributeList to put unpacked attributesbytes
- The bytes to be unpackedbLength
- The length of the bytes to be unpackedprotected int unpackAttributeHeader(java.io.InputStream in, RadiusFormat.AttributeParseContext ctx) throws java.io.IOException
in
- The DataInputStream to read fromctx
- The Attribute Parser Context
java.io.IOException
public static long readUnsignedInt(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static int readUnsignedShort(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static int readUnsignedByte(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static void writeUnsignedByte(java.io.OutputStream out, int b) throws java.io.IOException
java.io.IOException
public static void writeUnsignedShort(java.io.OutputStream out, int s) throws java.io.IOException
java.io.IOException
public static void writeUnsignedInt(java.io.OutputStream out, long i) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |