Class RIP

  • All Implemented Interfaces:
    IPacket

    public class RIP
    extends BasePacket
    Implements RIP Packet format, according to RFC 2453.
    • 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
      • rawData

        protected byte[] rawData
    • Constructor Detail

      • RIP

        public RIP()
    • 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
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class BasePacket
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object