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
Nested ClassesModifier and TypeClassDescriptionclassparse out the data messageclassHelp read the PeerTest payloadclassBaseclassHelp read the RelayIntro payloadclassHelp read the RelayRequest payloadclassHelp read the RelayResponse payloadclassparse out the confirmed messageclassHelp read the SessionCreated payloadclassHelp read the SessionRequest payload -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(UDPPacket packet) booleanDoes this packet include extended options in the header?booleanDoes 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.unusedintwhat type of payload is in here?longvoidtoRawString(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
-