Class Routing

    • Field Detail

      • FIXED_ROUTING_DATA_LENGTH

        public static final byte FIXED_ROUTING_DATA_LENGTH
        See Also:
        Constant Field Values
      • nextHeader

        protected byte nextHeader
      • headerExtLength

        protected byte headerExtLength
      • routingType

        protected byte routingType
      • segmentsLeft

        protected byte segmentsLeft
      • routingData

        protected byte[] routingData
    • Constructor Detail

      • Routing

        public Routing()
    • Method Detail

      • setNextHeader

        public Routing setNextHeader​(byte nextHeader)
        Description copied from interface: IExtensionHeader
        Sets the type of next header.
        Specified by:
        setNextHeader in interface IExtensionHeader
        Parameters:
        nextHeader - the next header to set
        Returns:
        this
      • getHeaderExtLength

        public byte getHeaderExtLength()
        Gets the extension length of this header.
        Returns:
        header length
      • setHeaderExtLength

        public Routing setHeaderExtLength​(byte headerExtLength)
        Sets the extension length of this header.
        Parameters:
        headerExtLength - the header length to set
        Returns:
        this
      • getRoutingType

        public byte getRoutingType()
        Gets the routing type of this header.
        Returns:
        routing type
      • setRoutingType

        public Routing setRoutingType​(byte routingType)
        Sets the routing type of this header.
        Parameters:
        routingType - the routing type to set
        Returns:
        this
      • getSegmentsLeft

        public byte getSegmentsLeft()
        Gets the number of remaining route segments of this header.
        Returns:
        number of remaining route segments
      • setSegmntsLeft

        public Routing setSegmntsLeft​(byte segmentsLeft)
        Sets the number of remaining route segments of this header.
        Parameters:
        segmentsLeft - the number of remaining route segments to set
        Returns:
        this
      • getRoutingData

        public byte[] getRoutingData()
        Gets the routing data.
        Returns:
        the routing data
      • setRoutingData

        public Routing setRoutingData​(byte[] routingData)
        Sets the routing data.
        Parameters:
        routingData - the routing data to set
        Returns:
        this
      • serialize

        public byte[] serialize()
        Description copied from interface: IPacket
        Sets all payloads parent packet if applicable, then serializes this packet and all payloads.
        Specified by:
        serialize in interface IPacket
        Returns:
        a byte[] containing this packet and payloads
      • equals

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

        public static Deserializer<Routing> deserializer()
        Deserializer function for routing headers.
        Returns:
        deserializer function
      • toString

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