Package net.i2p.router.transport.udp
Interface SSU2Payload.PayloadCallback
-
- All Known Implementing Classes:
InboundEstablishState2,OutboundEstablishState2,PeerState2,PeerStateDestroyed
- Enclosing class:
- SSU2Payload
public static interface SSU2Payload.PayloadCallbackFor all callbacks, recommend throwing exceptions only from the handshake. Exceptions will get thrown out of processPayload() and prevent processing of succeeding blocks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidgotACK(long ackThru, int acks, byte[] ranges)voidgotAddress(byte[] ip, int port)voidgotDateTime(long time)voidgotFragment(byte[] data, int off, int len, long messageID, int frag, boolean isLast)Data must be copied out in this method.voidgotI2NP(I2NPMessage msg)voidgotOptions(byte[] options, boolean isHandshake)voidgotPathChallenge(RemoteHostId from, byte[] data)voidgotPathResponse(RemoteHostId from, byte[] data)voidgotPeerTest(int msg, int status, Hash h, byte[] data)voidgotRelayIntro(Hash aliceHash, byte[] data)voidgotRelayRequest(byte[] data)voidgotRelayResponse(int status, byte[] data)voidgotRelayTag(long tag)voidgotRelayTagRequest()voidgotRI(RouterInfo ri, boolean isHandshake, boolean flood)voidgotRIFragment(byte[] data, boolean isHandshake, boolean flood, boolean isGzipped, int frag, int totalFrags)voidgotTermination(int reason, long lastReceived)voidgotToken(long token, long expires)
-
-
-
Method Detail
-
gotDateTime
void gotDateTime(long time) throws DataFormatException- Throws:
DataFormatException
-
gotI2NP
void gotI2NP(I2NPMessage msg) throws I2NPMessageException
- Throws:
I2NPMessageException
-
gotFragment
void gotFragment(byte[] data, int off, int len, long messageID, int frag, boolean isLast) throws DataFormatExceptionData must be copied out in this method. Data starts at the 9 byte header for fragment 0.- Parameters:
off- offset in datalen- length of data to copy- Throws:
DataFormatException
-
gotACK
void gotACK(long ackThru, int acks, byte[] ranges)- Parameters:
ranges- null if none
-
gotOptions
void gotOptions(byte[] options, boolean isHandshake) throws DataFormatException- Parameters:
isHandshake- true only for message 3 part 2- Throws:
DataFormatException
-
gotRI
void gotRI(RouterInfo ri, boolean isHandshake, boolean flood) throws DataFormatException
- Parameters:
ri- will already be validatedisHandshake- true only for message 3 part 2- Throws:
DataFormatException
-
gotRIFragment
void gotRIFragment(byte[] data, boolean isHandshake, boolean flood, boolean isGzipped, int frag, int totalFrags)- Parameters:
data- is first gzipped and then fragmentedisHandshake- true only for message 3 part 2
-
gotAddress
void gotAddress(byte[] ip, int port)
-
gotRelayTagRequest
void gotRelayTagRequest()
-
gotRelayTag
void gotRelayTag(long tag)
-
gotRelayRequest
void gotRelayRequest(byte[] data)
- Parameters:
data- excludes flag, includes signature
-
gotRelayResponse
void gotRelayResponse(int status, byte[] data)- Parameters:
status- 0 = accept, 1-255 = rejectdata- excludes flag, includes signature
-
gotRelayIntro
void gotRelayIntro(Hash aliceHash, byte[] data)
- Parameters:
data- excludes flag, includes signature
-
gotPeerTest
void gotPeerTest(int msg, int status, Hash h, byte[] data)- Parameters:
msg- 1-7status- 0 = accept, 1-255 = rejecth- Alice or Charlie hash for msg 2 and 4, null for msg 1, 3, 5-7data- excludes flag, includes signature
-
gotToken
void gotToken(long token, long expires)
-
gotTermination
void gotTermination(int reason, long lastReceived)- Parameters:
lastReceived- in theory could wrap around to negative, but very unlikely
-
gotPathChallenge
void gotPathChallenge(RemoteHostId from, byte[] data)
- Parameters:
from- null if unknown- Since:
- 0.9.55
-
gotPathResponse
void gotPathResponse(RemoteHostId from, byte[] data)
- Parameters:
from- null if unknown- Since:
- 0.9.55
-
-