java.lang.Object
net.i2p.i2ptunnel.ui.TunnelConfig

public class TunnelConfigextends Object
Helper class to generate a valid TunnelController configuration from provided settings.

This class is also used by Android. Maintain as a stable API and take care not to break Android.

  • Field Details

    • SHARED_CLIENT_NICKNAME

      public static final String SHARED_CLIENT_NICKNAME
      Nickname for the shared client tunnel config.
      See Also:
    • OPT

      private static final String OPT
      Prefix shared by the tunnel option keys.
      See Also:
    • _context

      protected final I2PAppContext _context
      App context, for the global context and key generation.
    • _type

      private String _type
      The tunnel type name.
    • _name

      private String _name
      The tunnel's display name.
    • _description

      private String _description
      The tunnel's description.
    • _i2cpHost

      private String _i2cpHost
      Host of the I2CP router.
    • _i2cpPort

      private String _i2cpPort
      Port of the I2CP router.
    • _tunnelDepth

      private int _tunnelDepth
      Inbound tunnel depth, -1 for the default.
    • _tunnelQuantity

      private int _tunnelQuantity
      Inbound tunnel count, -1 for the default.
    • _tunnelVariance

      private int _tunnelVariance
      Inbound tunnel variance, -4 for the default.
    • _tunnelBackupQuantity

      private int _tunnelBackupQuantity
      Backup inbound tunnels, -1 for the default.
    • _tunnelDepthOut

      private int _tunnelDepthOut
      Outbound tunnel depth, -1 for the default.
    • _tunnelQuantityOut

      private int _tunnelQuantityOut
      Outbound tunnel count, -1 for the default.
    • _tunnelVarianceOut

      private int _tunnelVarianceOut
      Outbound tunnel variance, -4 for the default.
    • _tunnelBackupQuantityOut

      private int _tunnelBackupQuantityOut
      Backup outbound tunnels, -1 for the default.
    • _connectDelay

      private boolean _connectDelay
      Whether the tunnel starts with a delay.
    • _customOptions

      private String _customOptions
      Extra I2CP options typed by the user.
    • _proxyList

      private String _proxyList
      Proxy list for the browsing proxy.
    • _port

      private int _port
      Local port the tunnel listens on.
    • _reachableBy

      private String _reachableBy
      Restriction on who may connect to the tunnel.
    • _targetDestination

      private String _targetDestination
      Destination of the peer tunnel, for client tunnels.
    • _targetHost

      private String _targetHost
      Host the client tunnel connects to.
    • _targetPort

      private int _targetPort
      Port the client tunnel connects to.
    • _spoofedHost

      private String _spoofedHost
      Host name the server tunnel claims.
    • _privKeyFile

      private String _privKeyFile
      File holding the tunnel's private keys.
    • _profile

      private String _profile
      Advanced profile name for the tunnel.
    • _startOnLoad

      private boolean _startOnLoad
      Whether the tunnel starts when the router boots.
    • _sharedClient

      private boolean _sharedClient
      Whether the client tunnel is shared.
    • _startupDelayMin

      private int _startupDelayMin
      Minimum startup delay in seconds for server tunnels @since 0.9.68+.
    • _startupDelayMax

      private int _startupDelayMax
      Maximum startup delay in seconds for server tunnels @since 0.9.68+.
    • _shutdownDelayMin

      private int _shutdownDelayMin
      Minimum shutdown delay in seconds for server tunnels @since 0.9.68+.
    • _shutdownDelayMax

      private int _shutdownDelayMax
      Maximum shutdown delay in seconds for server tunnels @since 0.9.68+.
    • _booleanOptions

      private final Set<String> _booleanOptions
      On/off options read from the config.
    • _otherOptions

      private final Map<String,String> _otherOptions
      Valued options read from the config.
    • _newProxyUser

      private String _newProxyUser
      User name for the proxy's basic auth.
    • _newProxyPW

      private String _newProxyPW
      Password for the proxy's basic auth.
    • _dest

      private Destination _dest
      The tunnel's destination, for server tunnels.
    • _filterDefinition

      private String _filterDefinition
      Access filter definition for the tunnel.
    • _encryptMode

      private int _encryptMode
      Encryption level requested for the tunnel.
    • _clientNames

      private String[] _clientNames
      Client authorization names, base64.
    • _clientKeys

      private String[] _clientKeys
      Client authorization keys, base64.
    • _clientRevocations

      private Set<Integer> _clientRevocations
      Indices of the client entries to remove.
    • _newClientName

      private String _newClientName
      Name for a newly added client entry.
    • _newClientKey

      private String _newClientKey
      Key for a newly added client entry.
    • _addClientAuth

      private boolean _addClientAuth
      Whether a new client entry was submitted.
    • PROP_ENABLE_ACCESS_LIST

      protected static final String PROP_ENABLE_ACCESS_LIST
      Enables the access list as a whitelist, servers only.
      See Also:
    • PROP_ENABLE_BLACKLIST

      protected static final String PROP_ENABLE_BLACKLIST
      Enables the access list as a blacklist, servers only.
      See Also:
    • PROP_MAX_CONNS_MIN

      public static final String PROP_MAX_CONNS_MIN
      Streaming connection limit properties, moved from IndexBean.
      See Also:
    • PROP_MAX_CONNS_HOUR

      public static final String PROP_MAX_CONNS_HOUR
      Hourly connection limit.
      See Also:
    • PROP_MAX_CONNS_DAY

      public static final String PROP_MAX_CONNS_DAY
      Daily connection limit.
      See Also:
    • PROP_MAX_TOTAL_CONNS_MIN

      public static final String PROP_MAX_TOTAL_CONNS_MIN
      Minute total connection limit, across all peers.
      See Also:
    • PROP_MAX_TOTAL_CONNS_HOUR

      public static final String PROP_MAX_TOTAL_CONNS_HOUR
      Hourly total connection limit, across all peers.
      See Also:
    • PROP_MAX_TOTAL_CONNS_DAY

      public static final String PROP_MAX_TOTAL_CONNS_DAY
      Daily total connection limit, across all peers.
      See Also:
    • PROP_MAX_STREAMS

      public static final String PROP_MAX_STREAMS
      Concurrent stream limit.
      See Also:
    • _noShowOpts

      private static final String[] _noShowOpts
      Options hidden from the tunnel config form.
    • _booleanClientOpts

      private static final String[] _booleanClientOpts
      On/off options shown for client tunnels.
    • _booleanProxyOpts

      private static final String[] _booleanProxyOpts
      On/off options shown for proxy tunnels.
    • _booleanServerOpts

      private static final String[] _booleanServerOpts
      On/off options shown for server tunnels.
    • _otherClientOpts

      private static final String[] _otherClientOpts
      Valued options shown for client tunnels.
    • _otherServerOpts

      private static final String[] _otherServerOpts
      Valued options shown for server tunnels.
    • _httpServerOpts

      private static final String[] _httpServerOpts
      Options specific to the http server tunnel.
    • _otherProxyOpts

      private static final String[] _otherProxyOpts
      Do NOT add these to noShoOpts, we must leave them in for HTTPClient, Connect, and SOCKS so they will get migrated to MD5 / SHA256 digest authentication.
    • _noShowSet

      static final Set<String> _noShowSet
      No show set.
    • _nonProxyNoShowSet

      static final Set<String> _nonProxyNoShowSet
      Non proxy no show set.
  • Constructor Details

    • TunnelConfig

      public TunnelConfig()
      Creates an empty config, using the global context.
  • Method Details

    • setType

      public void setType(String type)
      What type of tunnel (httpclient, ircclient, client, or server). This is required when adding a new tunnel.
      Parameters:
      type - the internal tunnel type
    • getType

      public String getType()
      The type of tunnel.
      Returns:
      the internal tunnel type, one of the values set by setType(String)
    • setName

      public void setName(String name)
      Short name of the tunnel.
      Parameters:
      name - name shown in the tunnel list
    • setDescription

      public void setDescription(String description)
      One line description.
      Parameters:
      description - free text, '#' is replaced by a space
    • setClientHost

      public void setClientHost(String host)
      I2CP host the router is on, ignored when in router context.
      Parameters:
      host - hostname of the I2CP router, ignored in router context
    • setClientPort

      public void setClientPort(String port)
      I2CP port the router is on, ignored when in router context.
      Parameters:
      port - I2CP port, ignored in router context
    • setTunnelDepth

      public void setTunnelDepth(int tunnelDepth)
      How many hops to use for inbound tunnels In or both in/out.
      Parameters:
      tunnelDepth - hops per tunnel, negative for the default
    • setTunnelQuantity

      public void setTunnelQuantity(int tunnelQuantity)
      How many parallel inbound tunnels to use In or both in/out.
      Parameters:
      tunnelQuantity - tunnels to maintain, negative for the default
    • setTunnelVariance

      public void setTunnelVariance(int tunnelVariance)
      How much randomisation to apply to the depth of tunnels In or both in/out.
      Parameters:
      tunnelVariance - depth spread, -2 or higher is meaningful
    • setTunnelBackupQuantity

      public void setTunnelBackupQuantity(int tunnelBackupQuantity)
      How many tunnels to hold in reserve to guard against failures In or both in/out.
      Parameters:
      tunnelBackupQuantity - spare tunnels, negative for the default
    • setTunnelDepthOut

      public void setTunnelDepthOut(int tunnelDepth)
      How many hops to use for outbound tunnels.
      Parameters:
      tunnelDepth - hops per tunnel, negative copies the inbound depth
    • setTunnelQuantityOut

      public void setTunnelQuantityOut(int tunnelQuantity)
      How many parallel outbound tunnels to use.
      Parameters:
      tunnelQuantity - tunnels to maintain, negative copies the inbound quantity
    • setTunnelVarianceOut

      public void setTunnelVarianceOut(int tunnelVariance)
      How much randomisation to apply to the depth of outbound tunnels.
      Parameters:
      tunnelVariance - depth spread, below -2 copies the inbound variance
    • setTunnelBackupQuantityOut

      public void setTunnelBackupQuantityOut(int tunnelBackupQuantity)
      How many tunnels to hold in reserve to guard against failures.
      Parameters:
      tunnelBackupQuantity - spare tunnels, negative copies the inbound count
    • setCustomOptions

      public void setCustomOptions(String customOptions)
      What I2P session overrides should be used.
      Parameters:
      customOptions - space-separated key=value overrides, all tunnels
    • setProxyList

      public void setProxyList(String proxyList)
      What HTTP outproxies should be used (httpclient specific).
      Parameters:
      proxyList - comma-separated outproxies, highest priority first
    • setPort

      public void setPort(int port)
      What port should this client/httpclient/ircclient listen on.
      Parameters:
      port - local listen port, negative to leave unset
    • setReachableBy

      public void setReachableBy(String reachableBy)
      What interface should this client/httpclient/ircclient listen on.
      Parameters:
      reachableBy - interface address, or "" for all interfaces
    • setTargetDestination

      public void setTargetDestination(String dest)
      What peer does this client tunnel point at.
      Parameters:
      dest - Base64 or Base32 destination
    • setTargetHost

      public void setTargetHost(String host)
      What host does this server tunnel point at.
      Parameters:
      host - target hostname, IPv4 or IPv6 address
    • setTargetPort

      public void setTargetPort(int port)
      What port does this server tunnel point at.
      Parameters:
      port - target port, negative to leave unset
    • setSpoofedHost

      public void setSpoofedHost(String host)
      What host does this http server tunnel spoof.
      Parameters:
      host - Host header sent to the web browser
    • setPrivKeyFile

      public void setPrivKeyFile(String file)
      Set the private key filename for this server tunnel. Absolute paths and paths containing ".." are rejected to prevent writes outside the config directory.
      Parameters:
      file - the private key filename, or null to clear
    • getPrivKeyFile

      public String getPrivKeyFile()
      The filename of the private key file.
      Returns:
      the priv key file
    • setAltPrivKeyFile

      public void setAltPrivKeyFile(String file)
      What filename is this server tunnel's alternate private keys stored in.
      Parameters:
      file - key file path used only if the primary one is unusable
    • setStartOnLoad

      public void setStartOnLoad(boolean val)
      If called with any value, we want this tunnel to start whenever it is loaded (aka right now and whenever the router is started up).
      Parameters:
      val - true to start the tunnel on load
    • setShared

      public void setShared(boolean val)
      Share the private key with other client tunnels.
      Parameters:
      val - true to share the private key with other client tunnels
    • setStartupDelayMin

      public void setStartupDelayMin(int val)
      The minimum startup delay in seconds for server tunnels.
      Parameters:
      val - the minimum startup delay in seconds for server tunnels
    • getStartupDelayMin

      public int getStartupDelayMin()
      Returns the configured minimum startup delay.
      Returns:
      the delay, in seconds
    • setStartupDelayMax

      public void setStartupDelayMax(int val)
      The maximum startup delay in seconds for server tunnels.
      Parameters:
      val - the maximum startup delay in seconds for server tunnels
    • getStartupDelayMax

      public int getStartupDelayMax()
      Returns the configured maximum startup delay.
      Returns:
      the delay, in seconds
    • setShutdownDelayMin

      public void setShutdownDelayMin(int val)
      The minimum shutdown delay in seconds for server tunnels.
      Parameters:
      val - the minimum shutdown delay in seconds for server tunnels
    • getShutdownDelayMin

      public int getShutdownDelayMin()
      Returns the configured minimum shutdown delay.
      Returns:
      the delay, in seconds
    • setShutdownDelayMax

      public void setShutdownDelayMax(int val)
      The maximum shutdown delay in seconds for server tunnels.
      Parameters:
      val - the maximum shutdown delay in seconds for server tunnels
    • getShutdownDelayMax

      public int getShutdownDelayMax()
      Returns the configured maximum shutdown delay.
      Returns:
      the delay, in seconds
    • setConnectDelay

      public void setConnectDelay(boolean val)
      Delay the connection to the target until the first client connects.
      Parameters:
      val - true to delay the connection to the target until the first client connects
    • setProfile

      public void setProfile(String profile)
      Streaming profile, only "interactive" has an effect.
      Parameters:
      profile - profile name, anything but "interactive" clears it
    • setReduce

      public void setReduce(boolean val)
      Reduce the number of connections when idle.
      Parameters:
      val - true to reduce while idle, false to leave the setting unset
    • setClose

      public void setClose(boolean val)
      Close connections when idle.
      Parameters:
      val - true to close while idle, false to leave the setting unset
    • setEncrypt

      public void setEncrypt(boolean val)
      Encrypt the lease set.
      Parameters:
      val - true to encrypt, false to leave the setting unset
    • setEncryptMode

      public void setEncryptMode(int mode)
      Set the lease set encryption mode.
      Parameters:
      mode - 0 for none, 1 for LS1, 2 for blinded, 3-9 blinded with a secret or keys
    • setBlindedPassword

      public void setBlindedPassword(String s)
      Set the secret required to decrypt hidden encrypted LeaseSets.
      Parameters:
      s - password shared with clients, blank to clear
    • addClientNames

      public void addClientNames(String[] s)
      Multiple entries in form.
      Parameters:
      s - display names, paired with the client keys
    • addClientKeys

      public void addClientKeys(String[] s)
      Multiple entries in form Handles either order addClientName/addClientKey.
      Parameters:
      s - Base64 32 byte keys, paired with the client names
    • revokeClients

      public void revokeClients(String[] s)
      Multiple entries in form.
      Parameters:
      s - indexes of the client entries to revoke
    • newClientName

      public void newClientName(String s)
      Handles either order newClientName/newClientKey.
      Parameters:
      s - display name for the extra client, blank to auto-name it
    • newClientKey

      public void newClientKey(String s)
      Handles either order newClientName/newClientKey.
      Parameters:
      s - Base64 32 byte key for the extra client, blank to generate one
    • setAddClient

      public void setAddClient(boolean val)
      Generate an extra per-client key, as for encrypt modes 6-9.
      Parameters:
      val - true to add another client key
    • setDCC

      public void setDCC(boolean val)
      Allow DCC in IRC clients.
      Parameters:
      val - true to permit DCC, false to leave the setting unset
    • setUseSSL

      public void setUseSSL(boolean val)
      Use SSL on the server port.
      Parameters:
      val - true to terminate TLS, false to leave the setting unset
    • setRejectInproxy

      public void setRejectInproxy(boolean val)
      Reject requests from inproxies.
      Parameters:
      val - true to refuse forwarding headers, false to leave unset
    • setRejectReferer

      public void setRejectReferer(boolean val)
      Reject requests carrying a Referer header.
      Parameters:
      val - true to refuse Referer requests, false to leave unset
    • setRejectUserAgents

      public void setRejectUserAgents(boolean val)
      Reject requests whose User-Agent matches the blocklist.
      Parameters:
      val - true to apply the blocklist, false to leave unset
    • setUserAgents

      public void setUserAgents(String val)
      Set the User-Agent blocklist.
      Parameters:
      val - comma-separated substrings to refuse; "none" blocks a blank header
    • setUniqueLocal

      public void setUniqueLocal(boolean val)
      Assign unique local hostnames for destination lookup.
      Parameters:
      val - true to assign unique names, false to leave unset
    • setAccessMode

      public void setAccessMode(int mode)
      Controls how other tunnels are checked for access.

      The list used for whitelisting/blacklisting can be set with setAccessList(String).

      Parameters:
      mode - 0 for no control, 1 for whitelist, 2 for blacklist
    • setFilterDefinition

      public void setFilterDefinition(String filterDefinition)
      Set the filter definition.
      Parameters:
      filterDefinition - filter definition string, servers only
    • setDelayOpen

      public void setDelayOpen(boolean val)
      Delay opening to the target until the first client connects.
      Parameters:
      val - true to delay the connect, false to leave the setting unset
    • setNewDest

      public void setNewDest(int mode)
      Controls how ephemeral the I2P Destination of a client tunnel is.

      If setClose(boolean) is set to false then mode 1 == mode 0.

      Parameters:
      mode - 0 for new dest on restart, 1 for new dest on resume from idle, 2 for persistent key
    • setReduceTime

      public void setReduceTime(int val)
      Idle time in minutes before reducing connections.
      Parameters:
      val - minutes of idleness before reducing
    • setReduceCount

      public void setReduceCount(int val)
      Number of connections to reduce to when idle.
      Parameters:
      val - connections left open while idle
    • setEncryptKey

      public void setEncryptKey(String val)
      Key for encrypting the lease set.
      Parameters:
      val - Base64 lease set encryption key, servers only
    • setAccessList

      public void setAccessList(String val)
      Comma-separated list of destinations to whitelist or blacklist.
      Parameters:
      val - destinations, read as allow or deny per the access mode
    • setJumpList

      public void setJumpList(String val)
      Comma-separated list of HTTP outproxy jump servers.
      Parameters:
      val - jump servers for multi-hop outproxying
    • setCloseTime

      public void setCloseTime(int val)
      Idle time in minutes before closing connections.
      Parameters:
      val - minutes of idleness before closing
    • setAllowUserAgent

      public void setAllowUserAgent(boolean val)
      Allow the User-Agent header to pass through the HTTP client.
      Parameters:
      val - true to forward the header, false to leave the setting unset
    • setAllowReferer

      public void setAllowReferer(boolean val)
      Allow the Referer header to pass through the HTTP client.
      Parameters:
      val - true to forward the header, false to leave the setting unset
    • setAllowAccept

      public void setAllowAccept(boolean val)
      Allow the Accept header to pass through the HTTP client.
      Parameters:
      val - true to forward the header, false to leave the setting unset
    • setAllowInternalSSL

      public void setAllowInternalSSL(boolean val)
      Allow SSL connections through the HTTP client.
      Parameters:
      val - true to forward SSL requests, false to leave the setting unset
    • setMultihome

      public void setMultihome(boolean val)
      Bundle reply info for multihoming.
      Parameters:
      val - true to bundle reply info, false to leave the setting unset
    • setProxyAuth

      public void setProxyAuth(String authType)
      Sets whether authentication should be used for client proxy tunnels. Supported authentication types: "basic", "digest".
      Parameters:
      authType - the authentication type, or "false" for no authentication
    • setProxyUsername

      public void setProxyUsername(String s)
      Username for client proxy authentication.
      Parameters:
      s - username presented to the outproxy
    • setProxyPassword

      public void setProxyPassword(String s)
      Password for client proxy authentication.
      Parameters:
      s - password presented to the outproxy
    • setOutproxyAuth

      public void setOutproxyAuth(boolean val)
      Sets whether authentication is required for any of the configured outproxies.
      Parameters:
      val - true if authentication is required, false otherwise
    • setOutproxyUsername

      public void setOutproxyUsername(String s)
      Username for outproxy authentication.
      Parameters:
      s - username presented to each outproxy
    • setOutproxyPassword

      public void setOutproxyPassword(String s)
      Password for outproxy authentication.
      Parameters:
      s - password presented to each outproxy
    • setSslProxies

      public void setSslProxies(String s)
      Comma-separated list of SSL-capable outproxies.
      Parameters:
      s - outproxies reachable over SSL, for 3-hop tunnels
    • setUseOutproxyPlugin

      public void setUseOutproxyPlugin(boolean val)
      Use the outproxy plugin for HTTP requests.
      Parameters:
      val - true to use the plugin, false to leave the setting unset
    • setOutproxyType

      public void setOutproxyType(String s)
      Set the type of the outproxy.
      Parameters:
      s - "connect" or "socks"
    • setLimitMinute

      public void setLimitMinute(int val)
      Max connections per minute.
      Parameters:
      val - connections allowed per minute, 0 for unlimited
    • setLimitHour

      public void setLimitHour(int val)
      Max connections per hour.
      Parameters:
      val - connections allowed per hour, 0 for unlimited
    • setLimitDay

      public void setLimitDay(int val)
      Max connections per day.
      Parameters:
      val - connections allowed per day, 0 for unlimited
    • setTotalMinute

      public void setTotalMinute(int val)
      Max total connections per minute.
      Parameters:
      val - connections allowed for all peers per minute, 0 for unlimited
    • setTotalHour

      public void setTotalHour(int val)
      Max total connections per hour.
      Parameters:
      val - connections allowed for all peers per hour, 0 for unlimited
    • setTotalDay

      public void setTotalDay(int val)
      Max total connections per day.
      Parameters:
      val - connections allowed for all peers per day, 0 for unlimited
    • setMaxStreams

      public void setMaxStreams(int val)
      Max concurrent streams.
      Parameters:
      val - streams allowed concurrently, 0 for unlimited
    • setPostMax

      public void setPostMax(int val)
      POST limits.
      Parameters:
      val - POST or PUT requests allowed per peer per check window
    • setPostTotalMax

      public void setPostTotalMax(int val)
      Max total POST requests in the check window.
      Parameters:
      val - requests allowed for all peers, 0 for unlimited
    • setPostCheckTime

      public void setPostCheckTime(int val)
      POST check window in minutes.
      Parameters:
      val - minutes per window, converted to seconds on the way out
    • setPostBanTime

      public void setPostBanTime(int val)
      POST ban duration in minutes.
      Parameters:
      val - minutes to ban a peer for a per-peer overrun
    • setPostTotalBanTime

      public void setPostTotalBanTime(int val)
      Total POST ban duration in minutes.
      Parameters:
      val - minutes to ban everyone for a window overrun
    • setSigType

      public void setSigType(String val)
      Signature type for the destination.
      Parameters:
      val - SigType code, or the default if null
    • setEncType

      public void setEncType(String val)
      Adds to existing, comma separated.
      Parameters:
      val - encryption type to append to the lease set encryption list
    • setInboundRandomKey

      public void setInboundRandomKey(String s)
      Random key for inbound tunnels.
      Parameters:
      s - Base64 persistent key, servers and persistent clients
    • setOutboundRandomKey

      public void setOutboundRandomKey(String s)
      Random key for outbound tunnels.
      Parameters:
      s - Base64 persistent key, servers and persistent clients
    • setLeaseSetSigningPrivateKey

      public void setLeaseSetSigningPrivateKey(String s)
      Private key used to sign the lease set.
      Parameters:
      s - SigType prefixed Base64 signing key, LS1 only
    • setLeaseSetPrivateKey

      public void setLeaseSetPrivateKey(String s)
      Private key used to encrypt the lease set.
      Parameters:
      s - EncType prefixed Base64 encryption key, servers only
    • setDestination

      public void setDestination(Destination dest)
      This is easier than requiring TunnelConfig to talk to TunnelControllerGroup and TunnelController.
      Parameters:
      dest - the current Destination for this tunnel.
    • getConfig

      public Properties getConfig()
      Based on all provided data, create a set of configuration parameters suitable for use in a TunnelController. This will replace (not add to) any existing parameters, so this should return a comprehensive mapping.
      Returns:
      a new Properties holding the settings for a TunnelController, replacing rather than merging any existing ones
    • setClientServerConfig

      private void setClientServerConfig(Properties config)
      Set the interface or target host and the generic client or server options, including the encryption mode for servers.
      Parameters:
      config - the config to fill
    • setProxyOptions

      private void setProxyOptions(Properties config)
      Set the outproxy list and migrate or add proxy authentication digests for HTTP, CONNECT, and SOCKS tunnels.
      Parameters:
      config - the config to fill
    • setDestinationConfig

      private void setDestinationConfig(Properties config)
      Set the destination, spoofed host, bidirectional server interface, and IRC DCC options.
      Parameters:
      config - the config to fill
    • setPersistentKeysConfig

      private void setPersistentKeysConfig(Properties config)
      Add persistent random keys and lease set signing and encryption keys for non-client tunnels and clients with persistent keys.
      Parameters:
      config - the config to fill
    • processEncryptMode

      private void processEncryptMode(Properties config)
      Servers only.
      Parameters:
      config - the tunnel config properties whose lease set options are set or cleared to match the selected encryption mode
    • setPerClientKeys

      private void setPerClientKeys(Properties config)
      Add the per-client PSK or DH keys for encrypt modes 6-9, generating new keys as needed.
      Parameters:
      config - the config to fill
    • addLeaseSetPrivKey

      private void addLeaseSetPrivKey(Properties config, boolean isBlinded)
      Servers only. Also sets/clears i2cp.leaseSetType.
      Parameters:
      config - the tunnel config properties to store the private key in
      isBlinded - true for a blinded lease set, which also stores the key in i2cp.leaseSetPrivKey and sets lease set type 5
    • updateConfigGeneric

      private void updateConfigGeneric(Properties config)
      Writes the shared tunnel settings into the config.
      Parameters:
      config - the tunnel's properties
    • updateTunnelQuantities

      public void updateTunnelQuantities(Properties config)
      Update tunnel quantities for the provided config from this TunnelConfig.
      Parameters:
      config - the properties to write into; a quantity is only set when it has been given a non-negative value
    • parseCustomOptions

      private static Map<String,String> parseCustomOptions(String args)
      Parse the args submitted in the custom options field.

      Modified from EepGet.parseAuthArgs(String) Spaces or tabs separate args. Args may be single- or double-quoted if they contain spaces or tabs. There is no provision for escaping quotes. A quoted string may not contain a quote of any kind. Double quotes around values are stripped. No quotes allowed for keys. Keys without values, e.g. key= or key will be returned with "" for the value.

      Parameters:
      args - non-null
      Returns:
      the parsed key-value pairs, empty if none; a key with no value maps to the empty string