java.lang.Object
net.i2p.i2ptunnel.I2PTunnelIRCClient.DCC
All Implemented Interfaces:
DCCHelper
Enclosing class:
I2PTunnelIRCClient

private class I2PTunnelIRCClient.DCCextends Object implements DCCHelper
Rewrites DCC lines between the local client and I2P.
  • Field Details

    • _localAddr

      private final byte[] _localAddr
      Address advertised to the local IRC client.
  • Constructor Details

    • DCC

      public DCC(byte[] local)
      Creates DCC state with the local address.
      Parameters:
      local - Our IP address, from the IRC client's perspective
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Whether DCC handling is enabled.
      Specified by:
      isEnabled in interface DCCHelper
      Returns:
      true if the DCC option was set on this client
    • getB32Hostname

      public String getB32Hostname()
      Base32 hostname advertised in DCC offers.
      Specified by:
      getB32Hostname in interface DCCHelper
      Returns:
      the b32 hostname
    • getLocalAddress

      public byte[] getLocalAddress()
      Local IP advertised in DCC offers.
      Specified by:
      getLocalAddress in interface DCCHelper
      Returns:
      the local address
    • newOutgoing

      public int newOutgoing(byte[] ip, int port, String type)
      Starts the DCC server if needed and relays an outgoing request.
      Specified by:
      newOutgoing in interface DCCHelper
      Parameters:
      ip - local irc client IP
      port - local irc client port
      type - string
      Returns:
      local DCC server i2p port or -1 on error
    • newIncoming

      public int newIncoming(String b32, int port, String type)
      Starts the DCC client manager if needed and relays an incoming request.
      Specified by:
      newIncoming in interface DCCHelper
      Parameters:
      b32 - remote dcc server b32 address
      port - remote dcc server I2P port
      type - string
      Returns:
      local DCC client tunnel port or -1 on error
    • resumeOutgoing

      public int resumeOutgoing(int port)
      Forwards the resume request to the DCC client manager, or -1 if not started.
      Specified by:
      resumeOutgoing in interface DCCHelper
      Parameters:
      port - local DCC client tunnel port
      Returns:
      remote DCC server i2p port or -1 on error
    • resumeIncoming

      public int resumeIncoming(int port)
      Description copied from interface: DCCHelper
      An incoming RESUME request.
      Specified by:
      resumeIncoming in interface DCCHelper
      Parameters:
      port - local dcc server I2P port
      Returns:
      local IRC client DCC port or -1 on error
    • acceptOutgoing

      public int acceptOutgoing(int port)
      Description copied from interface: DCCHelper
      An outgoing ACCEPT response.
      Specified by:
      acceptOutgoing in interface DCCHelper
      Parameters:
      port - local irc client DCC port
      Returns:
      local DCC server i2p port or -1 on error
    • acceptIncoming

      public int acceptIncoming(int port)
      Description copied from interface: DCCHelper
      An incoming ACCEPT response.
      Specified by:
      acceptIncoming in interface DCCHelper
      Parameters:
      port - remote dcc server I2P port
      Returns:
      local DCC client tunnel port or -1 on error