net.clackrouter.packets
Class RIPRoutingUpdate

java.lang.Object
  extended by net.clackrouter.protocol.data.VNSData
      extended by net.clackrouter.packets.VNSPacket
          extended by net.clackrouter.packets.RIPRoutingUpdate

public class RIPRoutingUpdate
extends VNSPacket

This is the packet type for a simple distance-vector protocol. Packets have no header and consist only of a list of 14-byte entries: < dest ip (4-bytes)> < dest mask (4-bytes) > < cost (4-bytes) > < ttl (2 - bytes) >.


Nested Class Summary
 class RIPRoutingUpdate.Entry
           
 
Field Summary
static int RIP_ENTRY_SIZE_BYTES
           
 
Fields inherited from class net.clackrouter.packets.VNSPacket
m_inputInterfaceName, m_length, m_level2Type, m_local_packet, m_nextHopIPAddr, m_nextHopMacAddr, m_outputInterfaceName, m_packetByteBuffer, mParentHeader
 
Constructor Summary
RIPRoutingUpdate()
          Create an empty RIP routing update, for use when building an update from scratch.
RIPRoutingUpdate(java.nio.ByteBuffer packetBuffer)
          Constructs an RIP packet from the supplied byte buffer, for use when extracting an update from a received IP packet
 
Method Summary
 void addEntry(java.net.InetAddress dest, java.net.InetAddress mask, int cost, short ttl)
          Adds a single entry to the list of prefixes contained in this update
 java.util.ArrayList getAllEntries()
          Retrieve all prefix entries contained within this update
 
Methods inherited from class net.clackrouter.packets.VNSPacket
addToPath, get16bit, get32bit, getByteBuffer, getInputInterfaceName, getLength, getLevel2Type, getNextHopIPAddress, getNextHopMacAddress, getOutputInterfaceName, getParentHeader, getStringBuffer, isPacket, needsSourceAddress, setByteBuffer, setInputInterfaceName, setLevel2Type, setNeedsSourceAddress, setNextHopIPAddress, setNextHopMacAddress, setOutputInterfaceName, setParentHeader, toString
 
Methods inherited from class net.clackrouter.protocol.data.VNSData
isBanner, isClose, isHWInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RIP_ENTRY_SIZE_BYTES

public static int RIP_ENTRY_SIZE_BYTES
Constructor Detail

RIPRoutingUpdate

public RIPRoutingUpdate()
Create an empty RIP routing update, for use when building an update from scratch.


RIPRoutingUpdate

public RIPRoutingUpdate(java.nio.ByteBuffer packetBuffer)
Constructs an RIP packet from the supplied byte buffer, for use when extracting an update from a received IP packet

Parameters:
packetBuffer - Byte buffer containing a RIP packet
Method Detail

addEntry

public void addEntry(java.net.InetAddress dest,
                     java.net.InetAddress mask,
                     int cost,
                     short ttl)
Adds a single entry to the list of prefixes contained in this update

Parameters:
dest -
mask -
cost -
ttl -

getAllEntries

public java.util.ArrayList getAllEntries()
Retrieve all prefix entries contained within this update

Returns:
arraylist of RIPRoutingUpdate.Entry objects