All Known Implementing Classes:
ECIESAEADEngine.PLCallback
Enclosing class:
RatchetPayload

public static interface RatchetPayload.PayloadCallback
For all callbacks, recommend throwing exceptions only from the handshake. Exceptions will get thrown out of RatchetPayload.processPayload(I2PAppContext, RatchetPayload.PayloadCallback, byte[], int, int, boolean) and prevent processing of succeeding blocks.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    void
    gotAck(int id, int n)
    Receive an ACK block.
    void
    Receive an ACK request block.
    void
    gotDateTime(long time)
    Receive a datetime block.
    void
    Receive a garlic clove block.
    void
    Receive a next key block.
    void
    gotOptions(byte[] options, boolean isHandshake)
    Receive an options block.
    void
    gotPadding(int paddingLength, int frameLength)
    For stats.
    void
    gotPN(int pn)
    Receive a packet number block.
    void
    gotTermination(int reason)
    Receive a termination block.
    void
    gotUnknown(int type, int len)
    Receive an unknown block.
  • Method Details

    • gotDateTime

      void gotDateTime(long time) throws DataFormatException
      Receive a datetime block.
      Parameters:
      time - the peer's expiry timestamp, in ms since the epoch
      Throws:
      DataFormatException - on bad data
    • gotGarlic

      void gotGarlic(GarlicClove clove)
      Receive a garlic clove block.
      Parameters:
      clove - the garlic clove
    • gotOptions

      void gotOptions(byte[] options, boolean isHandshake) throws DataFormatException
      Receive an options block.
      Parameters:
      options - the option bytes
      isHandshake - true only for message 3 part 2
      Throws:
      DataFormatException - on bad data
    • gotTermination

      void gotTermination(int reason)
      Receive a termination block.
      Parameters:
      reason - 0-255
    • gotPN

      void gotPN(int pn)
      Receive a packet number block.
      Parameters:
      pn - 0-65535
    • gotNextKey

      void gotNextKey(NextSessionKey nextKey)
      Receive a next key block.
      Parameters:
      nextKey - the next one
    • gotAck

      void gotAck(int id, int n)
      Receive an ACK block.
      Parameters:
      id - the key ID
      n - the message count acknowledged for that key
    • gotAckRequest

      void gotAckRequest()
      Receive an ACK request block.
    • gotPadding

      void gotPadding(int paddingLength, int frameLength)
      For stats.
      Parameters:
      paddingLength - the number of padding bytes, not including the 3-byte block header
      frameLength - the total size of the frame, including all blocks and block headers
    • gotUnknown

      void gotUnknown(int type, int len)
      Receive an unknown block.
      Parameters:
      type - the block type
      len - the block length