|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.udp.UDPPacket
class UDPPacket
Basic delivery unit containing the datagram. This also maintains a cache of object instances to allow rapid reuse.
Field Summary | |
---|---|
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 |
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
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 MAX_PAYLOAD_TYPE
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
Method Detail |
---|
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()
public void requestInboundBandwidth()
public void requestOutboundBandwidth()
public FIFOBandwidthLimiter.Request getBandwidthRequest()
public String toString()
toString
in class Object
public static UDPPacket acquire(RouterContext ctx, boolean inbound)
inbound
- unusedpublic void drop()
drop
in interface CDQEntry
public void release()
public static void clearCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |