java.lang.Object
net.i2p.i2ptunnel.I2PTunnelIRCClient.DCC
- All Implemented Interfaces:
DCCHelper
- Enclosing class:
I2PTunnelIRCClient
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]Address advertised to the local IRC client.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionintacceptIncoming(int port) An incoming ACCEPT response.intacceptOutgoing(int port) An outgoing ACCEPT response.Base32 hostname advertised in DCC offers.byte[]Local IP advertised in DCC offers.booleanWhether DCC handling is enabled.intnewIncoming(String b32, int port, String type) Starts the DCC client manager if needed and relays an incoming request.intnewOutgoing(byte[] ip, int port, String type) Starts the DCC server if needed and relays an outgoing request.intresumeIncoming(int port) An incoming RESUME request.intresumeOutgoing(int port) Forwards the resume request to the DCC client manager, or -1 if not started.
Field Details
_localAddr
private final byte[] _localAddrAddress 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
getB32Hostname
Base32 hostname advertised in DCC offers.- Specified by:
getB32Hostnamein interfaceDCCHelper- Returns:
- the b32 hostname
getLocalAddress
public byte[] getLocalAddress()Local IP advertised in DCC offers.- Specified by:
getLocalAddressin interfaceDCCHelper- Returns:
- the local address
newOutgoing
Starts the DCC server if needed and relays an outgoing request.- Specified by:
newOutgoingin interfaceDCCHelper- Parameters:
ip- local irc client IPport- local irc client porttype- string- Returns:
- local DCC server i2p port or -1 on error
newIncoming
Starts the DCC client manager if needed and relays an incoming request.- Specified by:
newIncomingin interfaceDCCHelper- Parameters:
b32- remote dcc server b32 addressport- remote dcc server I2P porttype- 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:
resumeOutgoingin interfaceDCCHelper- 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:DCCHelperAn incoming RESUME request.- Specified by:
resumeIncomingin interfaceDCCHelper- 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:DCCHelperAn outgoing ACCEPT response.- Specified by:
acceptOutgoingin interfaceDCCHelper- 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:DCCHelperAn incoming ACCEPT response.- Specified by:
acceptIncomingin interfaceDCCHelper- Parameters:
port- remote dcc server I2P port- Returns:
- local DCC client tunnel port or -1 on error