Modifier and Type | Field and Description |
---|---|
static byte |
BITFIELD_CONTINUATION |
static byte |
DATA_FLAG_ACK_BITFIELDS |
static byte |
DATA_FLAG_ECN
unused
|
static byte |
DATA_FLAG_EXPLICIT_ACK |
static byte |
DATA_FLAG_EXTENDED
unused
|
static byte |
DATA_FLAG_WANT_ACKS |
static byte |
DATA_FLAG_WANT_REPLY |
static byte |
HEADER_FLAG_EXTENDED_OPTIONS
Defined in the spec from the beginning, Used starting in 0.9.24
|
static byte |
HEADER_FLAG_REKEY
Defined in the spec from the beginning, Unused
|
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 |
MAX_PAYLOAD_TYPE |
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 |
static int |
SESS_REQ_EXT_FLAG_REQUEST_RELAY_TAG
set to 1 to request a session tag, i.e.
|
static int |
SESS_REQ_MIN_EXT_OPTIONS_LENGTH |
Modifier and Type | Method and Description |
---|---|
static UDPPacket |
acquire(RouterContext 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
|
FIFOBandwidthLimiter.Request |
getBandwidthRequest()
So that we can compete with NTCP, we want to request bandwidth
in parallel, on the way into the queue, not on the way out.
|
long |
getBegin() |
long |
getEnqueueTime()
For CDQ
|
(package private) int |
getFragmentCount()
only for debugging and stats
|
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 |
requestInboundBandwidth()
Deprecated.
unused
|
void |
requestOutboundBandwidth()
So that we can compete with NTCP, we want to request bandwidth
in parallel, on the way into the queue, not on the way out.
|
void |
resetBegin() |
void |
setEnqueueTime(long now)
For CDQ
|
(package private) void |
setFragmentCount(int count)
only for debugging and stats
|
(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 int MAX_PAYLOAD_TYPE
public static final byte HEADER_FLAG_REKEY
public static final byte HEADER_FLAG_EXTENDED_OPTIONS
public static final int SESS_REQ_MIN_EXT_OPTIONS_LENGTH
public static final int SESS_REQ_EXT_FLAG_REQUEST_RELAY_TAG
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 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()
@Deprecated public void requestInboundBandwidth()
public void requestOutboundBandwidth()
public FIFOBandwidthLimiter.Request getBandwidthRequest()
public String toString()
public static UDPPacket acquire(RouterContext ctx, boolean inbound)
inbound
- unusedpublic void release()
public static void clearCache()