net.jolsrv2.data
Class Message

java.lang.Object
  extended by net.jolsrv2.data.Message
Direct Known Subclasses:
ParsedPacket

public class Message
extends java.lang.Object

The class implements the messages, as specified in OLSRv2.

Author:
Andreas Schjønhaug

Constructor Summary
Message()
          Constructor
 
Method Summary
 void addAddressBlock(AddressBlock addressBlock)
          Adds an address block to the message
 void addTlvBlock(TlvBlock tlvBlock)
          Adds a TLV block to the message
 java.util.ArrayList<AddressBlock> getAddressBlocks()
          Return the address blocks
 byte[] getBytes()
          Returns the bytes of the message
 int getHopCount()
          Gets the hop count
 int getHopLimit()
          Returns the hop limit
 java.util.ArrayList<Tlv> getMessageTlvs()
          Return the message TLVs
 java.net.InetAddress getOriginatorAddress()
          Returns the originator IP address
 int getSequenceNumber()
          Returns the message sequence number
 java.util.ArrayList<TlvBlock> getTlvBlocks()
          Returns the TLV blocks
 MessageTypes getType()
          Returns the message type
 void setHopCount(int hopCount)
          Sets the hop count
 void setHopLimit(int hopLimit)
          Sets the hop limit
 void setMessageTlvBlock(TlvBlock messageTlvBlock)
          Sets the message TLV block
 void setOriginatorAddress(java.net.InetAddress inetAddress)
          Sets the originator address
 void setSemantics(int semantics)
          Sets the message semantics
 void setSequenceNumber(int sequenceNumber)
           
 void setType(MessageTypes type)
          Sets the message type
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message()
Constructor

Method Detail

getType

public MessageTypes getType()
Returns the message type

Returns:
the message type

setType

public void setType(MessageTypes type)
Sets the message type

Parameters:
type - the message type

getAddressBlocks

public java.util.ArrayList<AddressBlock> getAddressBlocks()
Return the address blocks

Returns:
the address blocks

getTlvBlocks

public java.util.ArrayList<TlvBlock> getTlvBlocks()
Returns the TLV blocks

Returns:
the TLV blocks

getMessageTlvs

public java.util.ArrayList<Tlv> getMessageTlvs()
Return the message TLVs

Returns:
the message TLVs

getOriginatorAddress

public java.net.InetAddress getOriginatorAddress()
Returns the originator IP address

Returns:
the originator IP address

setOriginatorAddress

public void setOriginatorAddress(java.net.InetAddress inetAddress)
Sets the originator address

Parameters:
inetAddress - the originator IP address

setMessageTlvBlock

public void setMessageTlvBlock(TlvBlock messageTlvBlock)
Sets the message TLV block

Parameters:
messageTlvBlock - the message TLV block

addAddressBlock

public void addAddressBlock(AddressBlock addressBlock)
Adds an address block to the message

Parameters:
addressBlock - the address block

addTlvBlock

public void addTlvBlock(TlvBlock tlvBlock)
Adds a TLV block to the message

Parameters:
tlvBlock - the TLV block

setSemantics

public void setSemantics(int semantics)
Sets the message semantics

Parameters:
semantics - the message semantics

getHopLimit

public int getHopLimit()
Returns the hop limit

Returns:
the hop limit

setHopLimit

public void setHopLimit(int hopLimit)
Sets the hop limit

Parameters:
hopLimit - the hop limit

getSequenceNumber

public int getSequenceNumber()
Returns the message sequence number

Returns:
the message sequence number

setSequenceNumber

public void setSequenceNumber(int sequenceNumber)

getHopCount

public int getHopCount()
Gets the hop count

Returns:
the hop count

setHopCount

public void setHopCount(int hopCount)
Sets the hop count

Parameters:
hopCount - the hop count

getBytes

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

Returns:
the bytes of the message