java.lang.Object
net.i2p.router.tunnel.InboundGatewayReceiver
All Implemented Interfaces:
TunnelGateway.Receiver

class InboundGatewayReceiverextends Object implements TunnelGateway.Receiver
Handle messages at the IBGW. Not used for zero-hop IBGWs.
  • Field Details

    • _context

      private final RouterContext _context
      The router context.
    • _config

      private final HopConfig _config
      The hop config of this gateway.
    • _target

      private RouterInfo _target
      The router info of the next hop.
    • MAX_LOOKUP_TIME

      private static final long MAX_LOOKUP_TIME
      Most time spent looking up the target.
      See Also:
    • PRIORITY

      private static final int PRIORITY
      The priority of the participating messages.
      See Also:
  • Constructor Details

    • InboundGatewayReceiver

      public InboundGatewayReceiver(RouterContext ctx, HopConfig cfg)
      Binds the router context and hop configuration.
      Parameters:
      ctx - the router context
      cfg - the hop configuration
  • Method Details

    • receiveEncrypted

      public long receiveEncrypted(byte[] encrypted)
      Queue the encrypted data for delivery to the next hop.
      Specified by:
      receiveEncrypted in interface TunnelGateway.Receiver
      Parameters:
      encrypted - the I2P message received on the inbound tunnel
      Returns:
      the message unique ID
    • receiveEncrypted

      public long receiveEncrypted(byte[] encrypted, boolean alreadySearched)
      Queue the encrypted data for delivery, with the netDb lookup already done.
      Parameters:
      encrypted - the I2P message received on the inbound tunnel
      alreadySearched - true if the caller has already looked the next hop up in the network database, so no further lookup and stat accounting is needed here
      Returns:
      the message unique ID, or -1 if the next hop's RouterInfo is not yet known and an asynchronous lookup was started instead
    • getSendTo

      public Hash getSendTo()
      The next hop.
      Specified by:
      getSendTo in interface TunnelGateway.Receiver
      Returns:
      non-null