class RatchetPayload extends Object
| Modifier and Type | Class and Description |
|---|---|
static class | RatchetPayload.AckBlockAcknowledgment block for ratchet payload. |
static class | RatchetPayload.AckRequestBlockAcknowledgment request block for ratchet payload. |
static class | RatchetPayload.BlockBase class for blocks to be transmitted. |
static class | RatchetPayload.DateTimeBlockTimestamp block for ratchet payload synchronization and timing. |
static class | RatchetPayload.GarlicBlockGarlic clove block for embedding I2NP messages in ratchet payload. |
static class | RatchetPayload.NextKeyBlockNext session key block for ratchet key exchange operations. |
static class | RatchetPayload.OptionsBlockOptions block for ratchet protocol configuration and negotiation. |
static class | RatchetPayload.PaddingBlockPadding block for ratchet payload size alignment and obfuscation. |
static interface | RatchetPayload.PayloadCallbackFor all callbacks, recommend throwing exceptions only from the handshake. |
static class | RatchetPayload.PNBlockPacket number block for ratchet payload. |
static class | RatchetPayload.TerminationBlockTermination block for ratchet session closure with reason codes. |
| Modifier and Type | Field and Description |
|---|---|
static int | BLOCK_HEADER_SIZEBlock header size in bytes |
| Modifier and Type | Method and Description |
|---|---|
static int | processPayload(I2PAppContext ctx,
RatchetPayload.PayloadCallback cb,
byte[] payload,
int off,
int length,
boolean isHandshake)Process a ratchet payload, calling the callback for each block found. |
static int | writePayload(byte[] payload,
int off,
List<RatchetPayload.Block> blocks)Write blocks to a payload buffer. |
public static final int BLOCK_HEADER_SIZE
public static int processPayload(I2PAppContext ctx, RatchetPayload.PayloadCallback cb, byte[] payload, int off, int length, boolean isHandshake) throws IOException, DataFormatException
ctx - the I2P app contextcb - the payload callbackpayload - the payload dataoff - the offset into the payloadlength - the lengthisHandshake - true for handshake messagesIOException - on I/O errorDataFormatException - on data format errorpublic static int writePayload(byte[] payload,
int off,
List<RatchetPayload.Block> blocks)payload - writes to it starting at offoff - the starting offsetblocks - the blocks