All Packages Class Hierarchy This Package Previous Next Index
Class magician.Node.TLVOption
java.lang.Object
|
+----magician.Node.TLVOption
- public class TLVOption
- extends Object
- implements ActiveNetsConstants
-
discardPacket
- whether to discard packet if option is unrecognized or to ignore it
default (false) is ignore
-
optionLength
- length of the entire TLV in 32 bit words
-
optionType
- type of option
-
privateOption
- option typeid specific?
-
value
- value of option
-
TLVOption(byte, short, byte[])
- creates a new TLVOption object of the specified type and value.
-
discardIfUnrecognized()
- tells whether to discard packet if option is unrecognized
or ignore option and continue processing the header
-
getLength()
- gives the total length of the TLV in 32 bit words
-
getOption()
- gets the type of the option
-
getValue()
- gives the value of the option
-
isPrivate()
- tells whether this option is private ie.
-
toByteArray()
- writes the TLV as a byte array suitable for transmission
privateOption
boolean privateOption
- option typeid specific?
discardPacket
boolean discardPacket
- whether to discard packet if option is unrecognized or to ignore it
default (false) is ignore
optionType
short optionType
- type of option
optionLength
int optionLength
- length of the entire TLV in 32 bit words
value
byte value[]
- value of option
TLVOption
public TLVOption(byte flags,
short type,
byte val[])
- creates a new TLVOption object of the specified type and value.
The flag bits have only two values possible, private and action
- Parameters:
- flags - byte representing the flag bits
- type - a byte array describing the option type
- val - a byte array containing the option
getOption
public int getOption()
- gets the type of the option
- Returns:
- a byte array describing the option type
getLength
public int getLength()
- gives the total length of the TLV in 32 bit words
- Returns:
- the length of the TLV
getValue
public byte[] getValue()
- gives the value of the option
- Returns:
- a byte array containing the value stored
isPrivate
public boolean isPrivate()
- tells whether this option is private ie. typeID specific
- Returns:
- true if option is private
discardIfUnrecognized
public boolean discardIfUnrecognized()
- tells whether to discard packet if option is unrecognized
or ignore option and continue processing the header
- Returns:
- true if packet is to be discarded and false if TLV is to be ignored
toByteArray
public byte[] toByteArray()
- writes the TLV as a byte array suitable for transmission
- Returns:
- a byte array representing the TLV option
All Packages Class Hierarchy This Package Previous Next Index