java.lang.Object
net.i2p.router.tunnel.TunnelGateway
net.i2p.router.tunnel.TunnelGatewayZeroHop

class TunnelGatewayZeroHopextends TunnelGateway
Serve as the gatekeeper for a tunnel with no hops, either inbound or outbound.
  • Field Details

  • Constructor Details

    • TunnelGatewayZeroHop

      public TunnelGatewayZeroHop(RouterContext context, TunnelCreatorConfig config)
      Create a zero-hop gateway for the specified tunnel.
      Parameters:
      context - the router context passed to the superclass and to the message distributor
      config - the tunnel's configuration, which determines the direction and destination
  • Method Details

    • add

      public boolean add(TunnelGatewayMessage msg)
      Add a message to be sent down the tunnel, where we are the inbound gateway. This requires converting the message included in the TGM from an UnknownI2NPMessage to the correct message class. See TunnelGatewayMessage for details.
      Overrides:
      add in class TunnelGateway
      Parameters:
      msg - message received to be sent through the tunnel
      Returns:
      true if the message was accepted, false on conversion failure
    • add

      public boolean add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel)
      Add a message to be sent down the tunnel (immediately forwarding it to the InboundMessageDistributor or OutboundMessageDistributor, as necessary).
      Overrides:
      add in class TunnelGateway
      Parameters:
      msg - message to be sent through the tunnel
      toRouter - router to send to after the endpoint (or null for endpoint processing)
      toTunnel - tunnel to send to after the endpoint (or null for endpoint or router processing)
      Returns:
      true always, as zero-hop gateways forward immediately