class InboundEstablishState extends EstablishBase implements NTCP2Payload.PayloadCallback
EstablishBase.State_con, _context, _curDecrypted, _dh, _e_bobSig, _e_hXY_tsB, _hX_xor_bobIdentHash, _log, _peerSkew, _prevEncrypted, _received, _state, _stateLock, _transport, _tsA, _tsB, _X, _Y, AES_SIZE, FAILED, HXY_SIZE, HXY_TSB_PAD_SIZE, MAX_RI_SIZE, MIN_RI_SIZE, STATES_DONE, VERIFIED, XY_SIZE| Constructor and Description |
|---|
InboundEstablishState(RouterContext ctx,
NTCPTransport transport,
NTCPConnection con) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
fail(String reason,
Exception e,
boolean bySkew)
Caller must synch.
|
int |
getVersion()
Get the NTCP version
|
void |
gotDateTime(long time) |
void |
gotI2NP(I2NPMessage msg) |
void |
gotOptions(byte[] options,
boolean isHandshake) |
void |
gotPadding(int paddingLength,
int frameLength)
For stats.
|
void |
gotRI(RouterInfo ri,
boolean isHandshake,
boolean flood)
Get "s" static key out of RI, compare to what we got in the handshake.
|
void |
gotTermination(int reason,
long lastReceived) |
void |
gotUnknown(int type,
int len) |
void |
receive(ByteBuffer src)
Parse the contents of the buffer as part of the handshake.
|
protected void |
releaseBufs(boolean isVerified)
Only call once.
|
_x, changeState, close, fail, fail, isComplete, isCorrupt, prefix, prepareOutbound, toString, xor32public InboundEstablishState(RouterContext ctx, NTCPTransport transport, NTCPConnection con)
public void receive(ByteBuffer src)
receive in interface EstablishStatereceive in class EstablishBasepublic int getVersion()
getVersion in interface EstablishStategetVersion in class EstablishBasepublic void gotRI(RouterInfo ri, boolean isHandshake, boolean flood) throws net.i2p.data.DataFormatException
gotRI in interface NTCP2Payload.PayloadCallbackisHandshake - always trueri - will already be validatednet.i2p.data.DataFormatException - on bad sig, unknown SigType, no static key,
static key mismatch, IP checks in verifyInbound()public void gotOptions(byte[] options,
boolean isHandshake)
gotOptions in interface NTCP2Payload.PayloadCallbackisHandshake - true only for message 3 part 2public void gotPadding(int paddingLength,
int frameLength)
NTCP2Payload.PayloadCallbackgotPadding in interface NTCP2Payload.PayloadCallbackpaddingLength - the number of padding bytes, not including the 3-byte block headerframeLength - the total size of the frame, including all blocks and block headerspublic void gotTermination(int reason,
long lastReceived)
gotTermination in interface NTCP2Payload.PayloadCallbacklastReceived - in theory could wrap around to negative, but very unlikelypublic void gotUnknown(int type,
int len)
gotUnknown in interface NTCP2Payload.PayloadCallbackpublic void gotDateTime(long time)
gotDateTime in interface NTCP2Payload.PayloadCallbackpublic void gotI2NP(I2NPMessage msg)
gotI2NP in interface NTCP2Payload.PayloadCallbackprotected void fail(String reason, Exception e, boolean bySkew)
EstablishBasefail in class EstablishBaseprotected void releaseBufs(boolean isVerified)
releaseBufs in class EstablishBase