net.jolsrv2.data
Class Tlv

java.lang.Object
  extended by net.jolsrv2.data.Tlv

public class Tlv
extends java.lang.Object

The class implements the TLV, as specified in OLSRv2.

Author:
Andreas Schjønhaug

Constructor Summary
Tlv(TlvTypes type)
          Constructor
 
Method Summary
 byte[] getBytes()
          Returns the bytes of the TLV
 int getIndexStart()
          Returns the index start
 int getIndexStop()
          Return the index stop
 int getSemantics()
          Returns the TLV semantics
 TlvTypes getType()
          Returns the TLV types
 byte[] getValue()
          Returns the TLV value as a byte stream
 boolean isValidForAddress(int i)
          Checks to see if a given index is valid for an IP address in an address block
 void setIndexStart(int indexStart)
          Sets the index start
 void setIndexStop(int indexStop)
          Sets the index stop
 void setSemantics(int semantics)
          Sets the TLV semantics
 void setValue(byte value)
          Sets the TLV value a single byte
 void setValue(byte[] value)
          Sets the TLV value as a byte stream
 void setValue(Values value)
          Sets the TLV value as a Value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tlv

public Tlv(TlvTypes type)
Constructor

Parameters:
type - the TLV type
Method Detail

getSemantics

public int getSemantics()
Returns the TLV semantics

Returns:
the TLV semantics

setSemantics

public void setSemantics(int semantics)
Sets the TLV semantics

Parameters:
semantics - the TLV semantics

getValue

public byte[] getValue()
Returns the TLV value as a byte stream

Returns:
the TLV value

setValue

public void setValue(byte[] value)
Sets the TLV value as a byte stream

Parameters:
value - the TLV value

setValue

public void setValue(Values value)
Sets the TLV value as a Value

Parameters:
value - the TLV value

setValue

public void setValue(byte value)
Sets the TLV value a single byte

Parameters:
value - the TLV as

getType

public TlvTypes getType()
Returns the TLV types

Returns:
the TLV types

getIndexStart

public int getIndexStart()
Returns the index start

Returns:
the index start

setIndexStart

public void setIndexStart(int indexStart)
Sets the index start

Parameters:
indexStart - the index start

getIndexStop

public int getIndexStop()
Return the index stop

Returns:
the index stop

setIndexStop

public void setIndexStop(int indexStop)
Sets the index stop

Parameters:
indexStop - the index stop

getBytes

public byte[] getBytes()
Returns the bytes of the TLV

Returns:
the bytes of the TLV

isValidForAddress

public boolean isValidForAddress(int i)
Checks to see if a given index is valid for an IP address in an address block

Parameters:
i - the index
Returns:
tue if the TLV is valid for the IP address
See Also:
AddressBlock