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

Variable Index

 o discardPacket
whether to discard packet if option is unrecognized or to ignore it default (false) is ignore
 o optionLength
length of the entire TLV in 32 bit words
 o optionType
type of option
 o privateOption
option typeid specific?
 o value
value of option

Constructor Index

 o TLVOption(byte, short, byte[])
creates a new TLVOption object of the specified type and value.

Method Index

 o discardIfUnrecognized()
tells whether to discard packet if option is unrecognized or ignore option and continue processing the header
 o getLength()
gives the total length of the TLV in 32 bit words
 o getOption()
gets the type of the option
 o getValue()
gives the value of the option
 o isPrivate()
tells whether this option is private ie.
 o toByteArray()
writes the TLV as a byte array suitable for transmission

Variables

 o privateOption
 boolean privateOption
option typeid specific?

 o discardPacket
 boolean discardPacket
whether to discard packet if option is unrecognized or to ignore it default (false) is ignore

 o optionType
 short optionType
type of option

 o optionLength
 int optionLength
length of the entire TLV in 32 bit words

 o value
 byte value[]
value of option

Constructors

 o 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

Methods

 o getOption
 public int getOption()
gets the type of the option

Returns:
a byte array describing the option type
 o getLength
 public int getLength()
gives the total length of the TLV in 32 bit words

Returns:
the length of the TLV
 o getValue
 public byte[] getValue()
gives the value of the option

Returns:
a byte array containing the value stored
 o isPrivate
 public boolean isPrivate()
tells whether this option is private ie. typeID specific

Returns:
true if option is private
 o 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
 o 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
1