net.clackrouter.packets
Class RIPRoutingUpdate
java.lang.Object
net.clackrouter.protocol.data.VNSData
net.clackrouter.packets.VNSPacket
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) >.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RIP_ENTRY_SIZE_BYTES
public static int RIP_ENTRY_SIZE_BYTES
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
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