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, 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, xor32
public InboundEstablishState(RouterContext ctx, NTCPTransport transport, NTCPConnection con)
public void receive(ByteBuffer src)
receive
in interface EstablishState
receive
in class EstablishBase
public int getVersion()
getVersion
in interface EstablishState
getVersion
in class EstablishBase
public void gotRI(RouterInfo ri, boolean isHandshake, boolean flood) throws DataFormatException
gotRI
in interface NTCP2Payload.PayloadCallback
isHandshake
- always trueri
- will already be validatedDataFormatException
- 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.PayloadCallback
isHandshake
- true only for message 3 part 2public void gotPadding(int paddingLength, int frameLength)
NTCP2Payload.PayloadCallback
gotPadding
in interface NTCP2Payload.PayloadCallback
paddingLength
- 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.PayloadCallback
lastReceived
- in theory could wrap around to negative, but very unlikelypublic void gotUnknown(int type, int len)
gotUnknown
in interface NTCP2Payload.PayloadCallback
public void gotDateTime(long time)
gotDateTime
in interface NTCP2Payload.PayloadCallback
public void gotI2NP(I2NPMessage msg)
gotI2NP
in interface NTCP2Payload.PayloadCallback
protected void fail(String reason, Exception e, boolean bySkew)
EstablishBase
fail
in class EstablishBase
protected void releaseBufs(boolean isVerified)
releaseBufs
in class EstablishBase