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 classRIP.CmdType 
- 
Field Summary
Fields Modifier and Type Field Description protected RIPV2AuthEntryauthEntryprotected bytecmdTypestatic intMIN_HEADER_LENGTHRouting Information Protocol packet.protected byte[]rawDataprotected shortreservedprotected java.util.List<RIPV2Entry>rtEntriesprotected byteversion- 
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.booleanequals(java.lang.Object obj)RIPV2AuthEntrygetAuthEntry()bytegetCmdType()byte[]getRawData()shortgetReserved()java.util.List<RIPV2Entry>getRtEntries()bytegetVersion()inthashCode()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.RIPsetCmdType(byte cmdType)RIPsetReserved(short reserved)RIPsetRtEntries(java.util.List<RIPV2Entry> entries)RIPsetVersion(byte version)java.lang.StringtoString()- 
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:IPacketSets 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:
 hashCodein classBasePacket
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classBasePacket
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -