Package net.i2p.router.transport.udp
Class UDPPacketReader
java.lang.Object
net.i2p.router.transport.udp.UDPPacketReader
To read a packet, initialize this reader with the data and fetch out
the appropriate fields. If the interesting bits are in message specific
elements, grab the appropriate subreader.
Many of the methods here and in the subclasses will throw AIOOBE on
malformed packets, that should be caught also.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
parse out the data messageclass
Help read the PeerTest payloadclass
Baseclass
Help read the RelayIntro payloadclass
Help read the RelayRequest payloadclass
Help read the RelayResponse payloadclass
parse out the confirmed messageclass
Help read the SessionCreated payloadclass
Help read the SessionRequest payload -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(UDPPacket packet) boolean
Does this packet include extended options in the header?boolean
Does this packet include rekeying data in the header? Unused, should always be false.byte[]
Returns extended option data, 0-255 bytes, or null if none.byte[]
Deprecated.unusedint
what type of payload is in here?long
void
toRawString
(StringBuilder buf) toString()
-
Constructor Details
-
UDPPacketReader
- Parameters:
ctx
- unused
-
-
Method Details
-
initialize
-
readPayloadType
public int readPayloadType()what type of payload is in here? -
isRekeyingIncluded
public boolean isRekeyingIncluded()Does this packet include rekeying data in the header? Unused, should always be false. -
isExtendedOptionsIncluded
public boolean isExtendedOptionsIncluded()Does this packet include extended options in the header? -
readTimestamp
public long readTimestamp()- Returns:
- seconds
-
readKeyingMaterial
Deprecated.unusedReturns rekeying data (64 bytes), or null if none. Unused, should always return null. -
readExtendedOptions
public byte[] readExtendedOptions()Returns extended option data, 0-255 bytes, or null if none. Returned array does NOT include the length byte.- Returns:
- extended options or null if none is included
- Since:
- 0.9.24
-
getSessionRequestReader
-
getSessionCreatedReader
-
getSessionConfirmedReader
-
getDataReader
-
getPeerTestReader
-
getRelayRequestReader
-
getRelayIntroReader
-
getRelayResponseReader
-
toString
-
toRawString
-