|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.i2ptunnel.I2PTunnel
public class I2PTunnel
Nested Class Summary | |
---|---|
static interface |
I2PTunnel.ConnectionEventListener
Callback routine to find out |
Field Summary | |
---|---|
java.lang.String |
host
|
java.lang.String |
listenHost
|
boolean |
ownDest
|
static int |
PACKET_DELAY
|
java.lang.String |
port
|
long |
readTimeout
|
Constructor Summary | |
---|---|
I2PTunnel()
|
|
I2PTunnel(java.lang.String[] args)
|
|
I2PTunnel(java.lang.String[] args,
I2PTunnel.ConnectionEventListener lsnr)
|
Method Summary | |
---|---|
void |
addConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
|
(package private) void |
addSession(I2PSession session)
|
void |
attachEventDispatcher(EventDispatcher e)
Attach an EventDispatcher object to the events dispatching chain. |
static Destination |
destFromName(java.lang.String name)
Generates a Destination from a name. |
void |
detachEventDispatcher(EventDispatcher e)
Detach the specified EventDispatcher object from the events dispatching chain. |
java.util.Properties |
getClientOptions()
|
I2PAppContext |
getContext()
|
EventDispatcher |
getEventDispatcher()
Get an object to be used to deliver events (usually this , but YMMV). |
java.util.Set |
getEvents()
Retrieve the names of all the events that have been received |
java.lang.Object |
getEventValue(java.lang.String n)
Retrieve the value currently associated with the specified event value |
(package private) java.util.List |
getSessions()
|
void |
ignoreEvents()
Ignore further event notifications |
void |
log(java.lang.String s)
Log the given message (using both the logging subsystem and standard output...) |
static void |
main(java.lang.String[] args)
|
static void |
makeKey(java.io.OutputStream writeTo,
java.io.OutputStream pubDest,
Logging l)
Create a new destination, storing the destination and its private keys where instructed |
void |
notifyEvent(java.lang.String e,
java.lang.Object a)
Deliver an event |
void |
removeConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
|
(package private) void |
removeSession(I2PSession session)
|
(package private) void |
routerDisconnected()
Call this whenever we lose touch with the router involuntarily (aka the router is off / crashed / etc) |
void |
runClient(java.lang.String[] args,
Logging l)
Run the client on the given port number pointing at the specified destination (either the base64 of the destination or file:fileNameContainingDestination). |
void |
runClientOptions(java.lang.String[] args,
Logging l)
Configure the extra I2CP options to use in any subsequent I2CP sessions. |
void |
runClose(java.lang.String[] args,
Logging l)
Close the given task (or all tasks), optionally forcing them to die a hard death Sets the event "closeResult" = "ok" after the closing is complete |
void |
runCommand(java.lang.String cmd,
Logging l)
|
void |
runConfig(java.lang.String[] args,
Logging l)
Specify the i2cp host and port Sets the event "configResult" = "ok" or "error" after the configuration has been specified |
void |
runGenKeys(java.lang.String[] args,
Logging l)
Generate a new keypair Sets the event "genkeysResult" = "ok" or "error" after the generation is complete |
void |
runGenTextKeys(Logging l)
Generate a new keypair Sets the event "privateKey" = base64 of the privateKey stream and sets the event "publicDestination" = base64 of the destination |
void |
runHelp(Logging l)
Display help information through the given logger. |
void |
runHttpClient(java.lang.String[] args,
Logging l)
Run an HTTP client on the given port number Sets the event "httpclientTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error). |
void |
runHttpServer(java.lang.String[] args,
Logging l)
Run the HTTP server pointing at the host and port specified using the private i2p destination loaded from the specified file, replacing the HTTP headers so that the Host: specified is the one spoofed. |
void |
runIrcClient(java.lang.String[] args,
Logging l)
Run an IRC client on the given port number Sets the event "ircclientTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error). |
void |
runList(Logging l)
Retrieve a list of currently running tasks Sets the event "listDone" = "done" after dumping the tasks to the logger |
void |
runListenOn(java.lang.String[] args,
Logging l)
Specify the hostname / IP address of the interface that the tunnels should bind to Sets the event "listen_onResult" = "ok" or "error" after the interface has been specified |
void |
runLookup(java.lang.String[] args,
Logging l)
Perform a lookup of the name specified Sets the event "lookupResult" = base64 of the destination, or an error message |
void |
runOwnDest(java.lang.String[] args,
Logging l)
Specify whether to use its own destination for each outgoing tunnel Sets the event "owndestResult" = "ok" or "error" after the configuration has been specified |
void |
runPing(java.lang.String allargs,
Logging l)
Start up a ping task with the specified args (currently supporting -ns, -h, -l) Sets the event "pingTaskId" = Integer of the taskId, or -1 |
void |
runQuit(Logging l)
Exit the JVM if there are no more tasks left running. |
void |
runReadTimeout(java.lang.String[] args,
Logging l)
Specify the read timeout going to be used for newly-created I2PSockets Sets the event "read_timeoutResult" = "ok" or "error" after the interface has been specified |
void |
runRun(java.lang.String[] args,
Logging l)
Run all of the commands in the given file (one command per line) Sets the event "runResult" = "ok" or "error" after the closing is complete |
void |
runServer(java.lang.String[] args,
Logging l)
Run the server pointing at the host and port specified using the private i2p destination loaded from the specified file. |
void |
runSOCKSTunnel(java.lang.String[] args,
Logging l)
Run an SOCKS tunnel on the given port number Sets the event "sockstunnelTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error). |
void |
runTextServer(java.lang.String[] args,
Logging l)
Run the server pointing at the host and port specified using the private i2p destination loaded from the given base64 stream. |
static void |
showKey(java.io.InputStream readFrom,
java.io.OutputStream pubDest,
Logging l)
Read in the given destination, display it, and write it to the given location |
void |
unIgnoreEvents()
Almost like the method above :-) |
java.lang.Object |
waitEventValue(java.lang.String n)
Wait until the given event has received a value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PACKET_DELAY
public boolean ownDest
public java.lang.String port
public java.lang.String host
public java.lang.String listenHost
public long readTimeout
Constructor Detail |
---|
public I2PTunnel()
public I2PTunnel(java.lang.String[] args)
public I2PTunnel(java.lang.String[] args, I2PTunnel.ConnectionEventListener lsnr)
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
java.util.List getSessions()
void addSession(I2PSession session)
void removeSession(I2PSession session)
public java.util.Properties getClientOptions()
public void runCommand(java.lang.String cmd, Logging l)
public void runHelp(Logging l)
l
- logger to receive events and outputpublic void runClientOptions(java.lang.String[] args, Logging l)
args
- each args[i] is a key=value pair to add to the optionsl
- logger to receive events and outputpublic void runServer(java.lang.String[] args, Logging l)
args
- {hostname, portNumber, privKeyFilename}l
- logger to receive events and outputpublic void runHttpServer(java.lang.String[] args, Logging l)
args
- {hostname, portNumber, spoofedHost, privKeyFilename}l
- logger to receive events and outputpublic void runTextServer(java.lang.String[] args, Logging l)
args
- {hostname, portNumber, privKeyBase64}l
- logger to receive events and outputpublic void runClient(java.lang.String[] args, Logging l)
args
- {portNumber, destinationBase64 or "file:filename"[, sharedClient]}l
- logger to receive events and outputpublic void runHttpClient(java.lang.String[] args, Logging l)
args
- {portNumber[, sharedClient][, proxy to be used for the WWW]}l
- logger to receive events and outputpublic void runIrcClient(java.lang.String[] args, Logging l)
args
- {portNumber,destinationBase64 or "file:filename" [, sharedClient]}l
- logger to receive events and outputpublic void runSOCKSTunnel(java.lang.String[] args, Logging l)
args
- {portNumber}l
- logger to receive events and outputpublic void runConfig(java.lang.String[] args, Logging l)
args
- {hostname, portNumber}l
- logger to receive events and outputpublic void runOwnDest(java.lang.String[] args, Logging l)
args
- {yes or no}l
- logger to receive events and outputpublic void runListenOn(java.lang.String[] args, Logging l)
args
- {hostname}l
- logger to receive events and outputpublic void runReadTimeout(java.lang.String[] args, Logging l)
args
- {hostname}l
- logger to receive events and outputpublic void runGenKeys(java.lang.String[] args, Logging l)
args
- {privateKeyFilename, publicKeyFilename} or {privateKeyFilename}l
- logger to receive events and outputpublic void runGenTextKeys(Logging l)
l
- logger to receive events and outputpublic void runQuit(Logging l)
l
- logger to receive events and outputpublic void runList(Logging l)
l
- logger to receive events and outputpublic void runClose(java.lang.String[] args, Logging l)
args
- {jobNumber}, {"forced", jobNumber}, {"forced", "all"}l
- logger to receive events and outputpublic void runRun(java.lang.String[] args, Logging l)
args
- {filename}l
- logger to receive events and outputpublic void runLookup(java.lang.String[] args, Logging l)
args
- {name}l
- logger to receive events and outputpublic void runPing(java.lang.String allargs, Logging l)
allargs
- arguments to pass to the I2Ping taskl
- logger to receive events and outputpublic void log(java.lang.String s)
log
in interface Logging
public static void makeKey(java.io.OutputStream writeTo, java.io.OutputStream pubDest, Logging l)
writeTo
- location to store the private keyspubDest
- location to store the destinationl
- logger to send messages topublic static void showKey(java.io.InputStream readFrom, java.io.OutputStream pubDest, Logging l)
readFrom
- stream to read the destination frompubDest
- stream to write the destination tol
- logger to send messages topublic static Destination destFromName(java.lang.String name) throws DataFormatException
DataFormatException
public void addConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
public void removeConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
public I2PAppContext getContext()
void routerDisconnected()
public EventDispatcher getEventDispatcher()
EventDispatcher
this
, but YMMV).
getEventDispatcher
in interface EventDispatcher
public void attachEventDispatcher(EventDispatcher e)
EventDispatcher
ev
won't reach the object calling this method).
Good luck, and beware of notification loops! :-)
attachEventDispatcher
in interface EventDispatcher
e
- Event object to be attachedpublic void detachEventDispatcher(EventDispatcher e)
EventDispatcher
detachEventDispatcher
in interface EventDispatcher
e
- Event object to be detachedpublic void notifyEvent(java.lang.String e, java.lang.Object a)
EventDispatcher
notifyEvent
in interface EventDispatcher
e
- name of the eventa
- data being stored for that eventpublic java.lang.Object getEventValue(java.lang.String n)
EventDispatcher
getEventValue
in interface EventDispatcher
n
- name of the event to query for
public java.util.Set getEvents()
EventDispatcher
getEvents
in interface EventDispatcher
public void ignoreEvents()
EventDispatcher
ignoreEvents
in interface EventDispatcher
public void unIgnoreEvents()
EventDispatcher
unIgnoreEvents
in interface EventDispatcher
public java.lang.Object waitEventValue(java.lang.String n)
EventDispatcher
waitEventValue
in interface EventDispatcher
n
- name of the event to wait for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |