Package net.i2p.router.transport.ntcp
Class InboundEstablishState
- java.lang.Object
- 
- net.i2p.router.transport.ntcp.EstablishBase
- 
- net.i2p.router.transport.ntcp.InboundEstablishState
 
 
- 
- All Implemented Interfaces:
- EstablishState,- NTCP2Payload.PayloadCallback
 
 class InboundEstablishState extends EstablishBase implements NTCP2Payload.PayloadCallback NTCP 2. We are Bob.- Since:
- 0.9.35 pulled out of EstablishState
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class net.i2p.router.transport.ntcp.EstablishBaseEstablishBase.State
 
- 
 - 
Field Summary- 
Fields inherited from class net.i2p.router.transport.ntcp.EstablishBase_con, _context, _curDecrypted, _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 SummaryConstructors Constructor Description InboundEstablishState(RouterContext ctx, NTCPTransport transport, NTCPConnection con)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfail(String reason, Exception e, boolean bySkew)Caller must synch.intgetVersion()Get the NTCP versionvoidgotDateTime(long time)voidgotI2NP(I2NPMessage msg)voidgotOptions(byte[] options, boolean isHandshake)voidgotPadding(int paddingLength, int frameLength)For stats.voidgotRI(RouterInfo ri, boolean isHandshake, boolean flood)Get "s" static key out of RI, compare to what we got in the handshake.voidgotTermination(int reason, long lastReceived)voidgotUnknown(int type, int len)voidreceive(ByteBuffer src)Parse the contents of the buffer as part of the handshake.protected voidreleaseBufs(boolean isVerified)Only call once.- 
Methods inherited from class net.i2p.router.transport.ntcp.EstablishBase_x, changeState, close, fail, fail, isComplete, isCorrupt, prefix, prepareOutbound, toString, xor32
 
- 
 
- 
- 
- 
Constructor Detail- 
InboundEstablishStatepublic InboundEstablishState(RouterContext ctx, NTCPTransport transport, NTCPConnection con) 
 
- 
 - 
Method Detail- 
receivepublic void receive(ByteBuffer src) Parse the contents of the buffer as part of the handshake. All data must be copied out of the buffer as Reader.processRead() will return it to the pool. If there are additional data in the buffer after the handshake is complete, the EstablishState is responsible for passing it to NTCPConnection.- Specified by:
- receivein interface- EstablishState
- Overrides:
- receivein class- EstablishBase
 
 - 
getVersionpublic int getVersion() Get the NTCP version- Specified by:
- getVersionin interface- EstablishState
- Specified by:
- getVersionin class- EstablishBase
- Returns:
- 1, 2, or 0 if unknown
- Since:
- 0.9.35
 
 - 
gotRIpublic void gotRI(RouterInfo ri, boolean isHandshake, boolean flood) throws DataFormatException Get "s" static key out of RI, compare to what we got in the handshake. Tell NTCPConnection who it is.- Specified by:
- gotRIin interface- NTCP2Payload.PayloadCallback
- Parameters:
- isHandshake- always true
- ri- will already be validated
- Throws:
- DataFormatException- on bad sig, unknown SigType, no static key, static key mismatch, IP checks in verifyInbound()
- Since:
- 0.9.36
 
 - 
gotOptionspublic void gotOptions(byte[] options, boolean isHandshake)- Specified by:
- gotOptionsin interface- NTCP2Payload.PayloadCallback
- isHandshake- true only for message 3 part 2
- Since:
- 0.9.36
 
 - 
gotPaddingpublic void gotPadding(int paddingLength, int frameLength)Description copied from interface:NTCP2Payload.PayloadCallbackFor stats.- Specified by:
- gotPaddingin interface- NTCP2Payload.PayloadCallback
- Parameters:
- paddingLength- the number of padding bytes, not including the 3-byte block header
- frameLength- the total size of the frame, including all blocks and block headers
- Since:
- 0.9.36
 
 - 
gotTerminationpublic void gotTermination(int reason, long lastReceived)- Specified by:
- gotTerminationin interface- NTCP2Payload.PayloadCallback
- lastReceived- in theory could wrap around to negative, but very unlikely
- Since:
- 0.9.36
 
 - 
gotUnknownpublic void gotUnknown(int type, int len)- Specified by:
- gotUnknownin interface- NTCP2Payload.PayloadCallback
- Since:
- 0.9.36
 
 - 
gotDateTimepublic void gotDateTime(long time) - Specified by:
- gotDateTimein interface- NTCP2Payload.PayloadCallback
- Since:
- 0.9.36
 
 - 
gotI2NPpublic void gotI2NP(I2NPMessage msg) - Specified by:
- gotI2NPin interface- NTCP2Payload.PayloadCallback
- Since:
- 0.9.36
 
 - 
failprotected void fail(String reason, Exception e, boolean bySkew) Description copied from class:EstablishBaseCaller must synch.- Overrides:
- failin class- EstablishBase
- Since:
- 0.9.16
 
 - 
releaseBufsprotected void releaseBufs(boolean isVerified) Only call once. Caller must synch.- Overrides:
- releaseBufsin class- EstablishBase
- Since:
- 0.9.16
 
 
- 
 
-