java.lang.Object
net.i2p.router.tunnel.InboundMessageDistributor
All Implemented Interfaces:
GarlicMessageReceiver.CloveReceiver

class InboundMessageDistributorextends Object implements GarlicMessageReceiver.CloveReceiver
When a message arrives at the inbound tunnel endpoint, this distributor honors the instructions (safely).
  • Field Details

    • _context

      private final RouterContext _context
      The router the tunnel terminates on.
    • _log

      private final Log _log
      Logger for this class.
    • _client

      private final Hash _client
      The client at the end of the tunnel.
    • _receiver

      private final GarlicMessageReceiver _receiver
      Where garlic messages are handed on.
    • _clientNickname

      private final String _clientNickname
      Client name shown in the logs.
    • _msgIDBloomXor

      private final long _msgIDBloomXor
      Xor mask for this tunnel's message ids.
  • Constructor Details

    • InboundMessageDistributor

      public InboundMessageDistributor(RouterContext ctx, Hash client)
      Create a new inbound message distributor.
      Parameters:
      ctx - the router context
      client - null for router tunnel
  • Method Details

    • distribute

      public void distribute(I2NPMessage msg, Hash target)
      Distribute the message to the target, with no tunnel ID.
      Parameters:
      msg - the message unwrapped from the garlic clove
      target - the router or client destination hash named by the delivery instructions
    • distribute

      public void distribute(I2NPMessage msg, Hash target, TunnelId tunnel)
      Distribute the message to the target, giving the tunnel ID for remote delivery.
      Parameters:
      msg - the message unwrapped from the garlic clove
      target - the router or client destination hash named by the delivery instructions
      tunnel - the tunnel to deliver down, or null for local delivery at this router
    • handleClove

      public void handleClove(DeliveryInstructions instructions, I2NPMessage data)
      Handle a clove removed from the garlic message.
      Specified by:
      handleClove in interface GarlicMessageReceiver.CloveReceiver
      Parameters:
      instructions - Delivery instructions associated with the clove.
      data - The I2NPMessage data carried by the clove.