Modifier and Type | Field and Description |
---|---|
static byte |
BITFIELD_CONTINUATION |
static byte |
DATA_FLAG_ACK_BITFIELDS |
static byte |
DATA_FLAG_ECN |
static byte |
DATA_FLAG_EXPLICIT_ACK |
static byte |
DATA_FLAG_EXTENDED |
static byte |
DATA_FLAG_WANT_ACKS |
static byte |
DATA_FLAG_WANT_REPLY |
static int |
IV_SIZE |
static int |
MAC_SIZE |
(package private) static int |
MAX_PACKET_SIZE
Actually it is one less than this, we assume
if a received packet is this big it is truncated.
|
static int |
PAYLOAD_TYPE_DATA |
static int |
PAYLOAD_TYPE_RELAY_INTRO |
static int |
PAYLOAD_TYPE_RELAY_REQUEST |
static int |
PAYLOAD_TYPE_RELAY_RESPONSE |
static int |
PAYLOAD_TYPE_SESSION_CONFIRMED |
static int |
PAYLOAD_TYPE_SESSION_CREATED |
static int |
PAYLOAD_TYPE_SESSION_DESTROY |
static int |
PAYLOAD_TYPE_SESSION_REQUEST
Message types, 4 bits max
|
static int |
PAYLOAD_TYPE_TEST |
Modifier and Type | Method and Description |
---|---|
static UDPPacket |
acquire(I2PAppContext ctx,
boolean inbound) |
static void |
clearCache()
Call at shutdown/startup to not hold ctx refs
|
void |
decrypt(SessionKey cipherKey)
Decrypt this valid packet, overwriting the _data buffer's payload
with the decrypted data (leaving the MAC and IV unaltered)
|
void |
drop()
For CDQ
|
long |
getBegin() |
long |
getEnqueueTime()
For CDQ
|
long |
getExpiration() |
(package private) int |
getFragmentCount() |
long |
getLifetime() |
int |
getMarkedType()
flag this packet as a particular type for accounting purposes, with
1 implying the packet is an ACK, otherwise it is a data packet
|
(package private) int |
getMessageType()
only for debugging and stats, does not go on the wire
|
DatagramPacket |
getPacket() |
short |
getPriority() |
(package private) RemoteHostId |
getRemoteHost() |
(package private) long |
getTimeSinceReceived()
a packet handler has pulled it off the inbound queue
|
void |
markType(int type)
flag this packet as a particular type for accounting purposes
|
(package private) void |
received()
a packet handler has pulled it off the inbound queue
|
void |
release() |
void |
resetBegin() |
void |
setEnqueueTime(long now)
For CDQ
|
(package private) void |
setFragmentCount(int count) |
(package private) void |
setMessageType(int type)
only for debugging and stats, does not go on the wire
|
String |
toString()
how many times we tried to validate the packet
|
boolean |
validate(SessionKey macKey)
Validate the packet against the MAC specified, returning true if the
MAC matches, false otherwise.
|
static final int MAX_PACKET_SIZE
public static final int IV_SIZE
public static final int MAC_SIZE
public static final int PAYLOAD_TYPE_SESSION_REQUEST
public static final int PAYLOAD_TYPE_SESSION_CREATED
public static final int PAYLOAD_TYPE_SESSION_CONFIRMED
public static final int PAYLOAD_TYPE_RELAY_REQUEST
public static final int PAYLOAD_TYPE_RELAY_RESPONSE
public static final int PAYLOAD_TYPE_RELAY_INTRO
public static final int PAYLOAD_TYPE_DATA
public static final int PAYLOAD_TYPE_TEST
public static final int PAYLOAD_TYPE_SESSION_DESTROY
public static final byte DATA_FLAG_EXPLICIT_ACK
public static final byte DATA_FLAG_ACK_BITFIELDS
public static final byte DATA_FLAG_ECN
public static final byte DATA_FLAG_WANT_ACKS
public static final byte DATA_FLAG_WANT_REPLY
public static final byte DATA_FLAG_EXTENDED
public static final byte BITFIELD_CONTINUATION
public DatagramPacket getPacket()
public short getPriority()
public long getExpiration()
public long getBegin()
public long getLifetime()
public void resetBegin()
public void markType(int type)
public int getMarkedType()
int getMessageType()
void setMessageType(int type)
int getFragmentCount()
void setFragmentCount(int count)
RemoteHostId getRemoteHost()
public boolean validate(SessionKey macKey)
public void decrypt(SessionKey cipherKey)
public void setEnqueueTime(long now)
setEnqueueTime
in interface CDQEntry
void received()
public long getEnqueueTime()
getEnqueueTime
in interface CDQEntry
long getTimeSinceReceived()
public String toString()
public static UDPPacket acquire(I2PAppContext ctx, boolean inbound)
inbound
- unusedpublic void release()
public static void clearCache()