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
  • Constructor Details

  • Method Details

    • receive

      public 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:
      receive in interface EstablishState
      Overrides:
      receive in class EstablishBase
    • getVersion

      public int getVersion()
      Get the NTCP version
      Specified by:
      getVersion in interface EstablishState
      Specified by:
      getVersion in class EstablishBase
      Returns:
      1, 2, or 0 if unknown
      Since:
      0.9.35
    • gotRI

      public 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:
      gotRI in interface NTCP2Payload.PayloadCallback
      Parameters:
      ri - will already be validated
      isHandshake - always true
      Throws:
      DataFormatException - on bad sig, unknown SigType, no static key, static key mismatch, IP checks in verifyInbound()
      Since:
      0.9.36
    • gotOptions

      public void gotOptions(byte[] options, boolean isHandshake)
      Specified by:
      gotOptions in interface NTCP2Payload.PayloadCallback
      Parameters:
      isHandshake - true only for message 3 part 2
      Since:
      0.9.36
    • gotPadding

      public void gotPadding(int paddingLength, int frameLength)
      Description copied from interface: NTCP2Payload.PayloadCallback
      For stats.
      Specified by:
      gotPadding in 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
    • gotTermination

      public void gotTermination(int reason, long lastReceived)
      Specified by:
      gotTermination in interface NTCP2Payload.PayloadCallback
      Parameters:
      lastReceived - in theory could wrap around to negative, but very unlikely
      Since:
      0.9.36
    • gotUnknown

      public void gotUnknown(int type, int len)
      Specified by:
      gotUnknown in interface NTCP2Payload.PayloadCallback
      Since:
      0.9.36
    • gotDateTime

      public void gotDateTime(long time)
      Specified by:
      gotDateTime in interface NTCP2Payload.PayloadCallback
      Since:
      0.9.36
    • gotI2NP

      public void gotI2NP(I2NPMessage msg)
      Specified by:
      gotI2NP in interface NTCP2Payload.PayloadCallback
      Since:
      0.9.36
    • fail

      protected void fail(String reason, Exception e, boolean bySkew)
      Description copied from class: EstablishBase
      Caller must synch.
      Overrides:
      fail in class EstablishBase
      Since:
      0.9.16
    • releaseBufs

      protected void releaseBufs(boolean isVerified)
      Only call once. Caller must synch.
      Overrides:
      releaseBufs in class EstablishBase
      Since:
      0.9.16