Package org.onlab.packet
Class RIP
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.RIP
-
- All Implemented Interfaces:
IPacket
public class RIP extends BasePacket
Implements RIP Packet format, according to RFC 2453.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RIP.CmdType
-
Field Summary
Fields Modifier and Type Field Description protected RIPV2AuthEntry
authEntry
protected byte
cmdType
static int
MIN_HEADER_LENGTH
Routing Information Protocol packet.protected byte[]
rawData
protected short
reserved
protected java.util.List<RIPV2Entry>
rtEntries
protected byte
version
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description RIP()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<RIP>
deserializer()
Deserializer function for RIP packets.boolean
equals(java.lang.Object obj)
RIPV2AuthEntry
getAuthEntry()
byte
getCmdType()
byte[]
getRawData()
short
getReserved()
java.util.List<RIPV2Entry>
getRtEntries()
byte
getVersion()
int
hashCode()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.RIP
setCmdType(byte cmdType)
RIP
setReserved(short reserved)
RIP
setRtEntries(java.util.List<RIPV2Entry> entries)
RIP
setVersion(byte version)
java.lang.String
toString()
-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
MIN_HEADER_LENGTH
public static final int MIN_HEADER_LENGTH
Routing Information Protocol packet. ------------------------------------------ |cmdType (1) | version(1) | ------------------------------------------ |reserved (2) | ------------------------------------------ | route entries (n*20) | ------------------------------------------- See Also:
- Constant Field Values
-
cmdType
protected byte cmdType
-
version
protected byte version
-
reserved
protected short reserved
-
rtEntries
protected java.util.List<RIPV2Entry> rtEntries
-
authEntry
protected RIPV2AuthEntry authEntry
-
rawData
protected byte[] rawData
-
-
Method Detail
-
getCmdType
public byte getCmdType()
- Returns:
- the cmdType
-
setCmdType
public RIP setCmdType(byte cmdType)
- Parameters:
cmdType
- the cmdType to set- Returns:
- this
-
getVersion
public byte getVersion()
- Returns:
- the version
-
setVersion
public RIP setVersion(byte version)
- Parameters:
version
- the version to set- Returns:
- this
-
getReserved
public short getReserved()
- Returns:
- the reserved short
-
setReserved
public RIP setReserved(short reserved)
- Parameters:
reserved
- the reserved short to set- Returns:
- this
-
getRtEntries
public java.util.List<RIPV2Entry> getRtEntries()
- Returns:
- the route entries
-
setRtEntries
public RIP setRtEntries(java.util.List<RIPV2Entry> entries)
- Parameters:
entries
- the route entries to set- Returns:
- this
-
getAuthEntry
public RIPV2AuthEntry getAuthEntry()
- Returns:
- the authentication entry
-
getRawData
public byte[] getRawData()
- Returns:
- the raw data of whole RIP packet (after RIP header)
-
serialize
public byte[] serialize()
Description copied from interface:IPacket
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.- Returns:
- a byte[] containing this packet and payloads
-
deserializer
public static Deserializer<RIP> deserializer()
Deserializer function for RIP packets.- Returns:
- deserializer function
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBasePacket
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classBasePacket
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-