net.i2p.router.crypto.ratchet

## Interface RatchetPayload.PayloadCallback

- Enclosing class:
    RatchetPayload

      public static interface RatchetPayload.PayloadCallback

  For all callbacks, recommend throwing exceptions only from the handshake. Exceptions will get thrown out of processPayload() and prevent processing of succeeding blocks.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `gotAck(int id, int n)`
    `void` | `gotAckRequest()`
    `void` | `gotDateTime(long time)`
    `void` | `gotGarlic(GarlicClove clove)`
    `void` | `gotNextKey(NextSessionKey nextKey)`
    `void` | `gotOptions(byte[] options, boolean isHandshake)`
    `void` | `gotPadding(int paddingLength, int frameLength)` For stats.
    `void` | `gotPN(int pn)`
    `void` | `gotTermination(int reason)`
    `void` | `gotUnknown(int type, int len)`

- - ### Method Detail

    - #### gotAck

          void gotAck(int id,
                      int n)

    - #### gotAckRequest

          void gotAckRequest()

    - #### gotDateTime

          void gotDateTime(long time)
                    throws DataFormatException

      Throws:
        `DataFormatException`

    - #### gotGarlic

          void gotGarlic(GarlicClove clove)

    - #### gotNextKey

          void gotNextKey(NextSessionKey nextKey)

      Parameters:
        `nextKey` - the next one

    - #### gotOptions

          void gotOptions(byte[] options,
                          boolean isHandshake)
                   throws DataFormatException

      Parameters:
        `isHandshake` - true only for message 3 part 2
      Throws:
        `DataFormatException`

    - #### 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

    - #### gotPN

          void gotPN(int pn)

      Parameters:
        `pn` - 0-65535

    - #### gotTermination

          void gotTermination(int reason)

      Parameters:
        `reason` - 0-255

    - #### gotUnknown

          void gotUnknown(int type,
                          int len)