Class OutboundTunnelBuildReplyMessage

  • All Implemented Interfaces:
    I2NPMessage

    public class OutboundTunnelBuildReplyMessage
    extends TunnelBuildReplyMessage
    Sent from the OBEP to the tunnel creator via an inbound tunnel. Contains one plaintext variable-sized reply record for the creator and a variable number of encrypted records for the following hops. This message must be garlic-encrypted to hide the contents from the OBGW. Preliminary, see proposal 157.
    Since:
    0.9.50
    • Constructor Detail

      • OutboundTunnelBuildReplyMessage

        public OutboundTunnelBuildReplyMessage​(I2PAppContext context)
        zero record count, will be set with readMessage()
      • OutboundTunnelBuildReplyMessage

        public OutboundTunnelBuildReplyMessage​(I2PAppContext context,
                                               int records)
    • Method Detail

      • setPlaintextRecord

        public void setPlaintextRecord​(int slot,
                                       byte[] data)
        Set the slot and data for the plaintext record.
        Throws:
        IllegalArgumentException - on bad slot or data length.
      • getPlaintextSlot

        public int getPlaintextSlot()
        Get the slot for the plaintext record. getRecord() for this slot will return null.
      • getPlaintextRecord

        public byte[] getPlaintextRecord()
        Get the data for the plaintext record.
      • readMessage

        public void readMessage​(byte[] data,
                                int offset,
                                int dataSize,
                                int type)
                         throws I2NPMessageException
        Description copied from interface: I2NPMessage
        Read the body into the data structures, after the initial type byte and the uniqueId / expiration, using the current class's format as defined by the I2NP specification
        Specified by:
        readMessage in interface I2NPMessage
        Overrides:
        readMessage in class TunnelBuildMessageBase
        Parameters:
        data - data to read from
        offset - where to start in the data array
        dataSize - how long into the data to read
        type - I2NP message type
        Throws:
        I2NPMessageException - if the stream doesn't contain a valid message that this class can read.