Package net.i2p.router.transport.udp
Class UDPPacketReader
- java.lang.Object
-
- net.i2p.router.transport.udp.UDPPacketReader
-
class UDPPacketReader extends Object
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 Classes Modifier and Type Class Description classUDPPacketReader.DataReaderparse out the data messageclassUDPPacketReader.PeerTestReaderHelp read the PeerTest payloadclassUDPPacketReader.ReaderBaseclassUDPPacketReader.RelayIntroReaderHelp read the RelayIntro payloadclassUDPPacketReader.RelayRequestReaderHelp read the RelayRequest payloadclassUDPPacketReader.RelayResponseReaderHelp read the RelayResponse payloadclassUDPPacketReader.SessionConfirmedReaderparse out the confirmed messageclassUDPPacketReader.SessionCreatedReaderHelp read the SessionCreated payloadclassUDPPacketReader.SessionRequestReaderHelp read the SessionRequest payload
-
Constructor Summary
Constructors Constructor Description UDPPacketReader(I2PAppContext ctx)
-
Method Summary
-
-
-
Constructor Detail
-
UDPPacketReader
public UDPPacketReader(I2PAppContext ctx)
-
-
Method Detail
-
initialize
public void initialize(UDPPacket packet)
-
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 public byte[] 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
public UDPPacketReader.SessionRequestReader getSessionRequestReader()
-
getSessionCreatedReader
public UDPPacketReader.SessionCreatedReader getSessionCreatedReader()
-
getSessionConfirmedReader
public UDPPacketReader.SessionConfirmedReader getSessionConfirmedReader()
-
getDataReader
public UDPPacketReader.DataReader getDataReader()
-
getPeerTestReader
public UDPPacketReader.PeerTestReader getPeerTestReader()
-
getRelayRequestReader
public UDPPacketReader.RelayRequestReader getRelayRequestReader()
-
getRelayIntroReader
public UDPPacketReader.RelayIntroReader getRelayIntroReader()
-
getRelayResponseReader
public UDPPacketReader.RelayResponseReader getRelayResponseReader()
-
toRawString
public void toRawString(StringBuilder buf)
-
-