diff --git a/Makefile.gcj b/Makefile.gcj
index 106c252ec..c1da11d6f 100644
--- a/Makefile.gcj
+++ b/Makefile.gcj
@@ -21,11 +21,12 @@ NATIVE_DIR=native
# router.jar: full I2P router
# jbigi.jar: collection of native optimized GMP routines for crypto
JAR_BASE=i2p.jar mstreaming.jar streaming.jar
-JAR_CLIENTS=i2ptunnel.jar sam.jar i2psnark.jar
+JAR_CLIENTS=i2ptunnel.jar sam.jar
JAR_ROUTER=router.jar
JAR_JBIGI=jbigi.jar
JAR_XML=xml-apis.jar resolver.jar xercesImpl.jar
JAR_CONSOLE=\
+ i2psnark.jar \
javax.servlet.jar \
commons-el.jar \
commons-logging.jar \
@@ -79,15 +80,15 @@ native_clean:
native_shared: libi2p.so
@cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2p_dsa --main=net.i2p.crypto.DSAEngine
@echo "* i2p_dsa is a simple test app with the DSA engine and Fortuna PRNG to make sure crypto is working"
- @cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/prng --main=gnu.crypto.prng.Fortuna
+ @cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/prng --main=gnu.crypto.prng.FortunaStandalone
@cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2ptunnel --main=net.i2p.i2ptunnel.I2PTunnel
@echo "* i2ptunnel is mihi's I2PTunnel CLI"
@echo " run it as ./i2ptunnel -cli to avoid awt complaints"
@cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2ptunnelctl --main=net.i2p.i2ptunnel.TunnelControllerGroup
@echo "* i2ptunnelctl is a controller for I2PTunnel, reading i2ptunnel.config"
@echo " and launching the appropriate proxies"
- @cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2psnark --main=org.klomp.snark.Snark
- @echo "* i2psnark is an anonymous bittorrent client"
+ #@cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2psnark --main=org.klomp.snark.Snark
+ #@echo "* i2psnark is an anonymous bittorrent client"
@cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2prouter --main=net.i2p.router.Router
@echo "* i2prouter is the main I2P router"
@echo " it can be used, and while the router console won't load,"
@@ -95,6 +96,6 @@ native_shared: libi2p.so
libi2p.so:
@echo "* Building libi2p.so"
- @(cd build ; ${GCJ} ${OPTIMIZE} -fPIC -fjni -shared -o ../${NATIVE_DIR}/libi2p.so ${LIBI2P_JARS} ; cd .. )
+ @(cd build ; time ${GCJ} ${OPTIMIZE} -fPIC -fjni -shared -o ../${NATIVE_DIR}/libi2p.so ${LIBI2P_JARS} ; cd .. )
@ls -l ${NATIVE_DIR}/libi2p.so
@echo "* libi2p.so built"
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java
new file mode 100644
index 000000000..ea66bed63
--- /dev/null
+++ b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java
@@ -0,0 +1,104 @@
+package net.i2p.router.web;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.*;
+
+import net.i2p.data.DataHelper;
+import net.i2p.stat.Rate;
+import net.i2p.router.RouterContext;
+
+public class GraphHelper {
+ private RouterContext _context;
+ private Writer _out;
+ private int _periodCount;
+ private boolean _showEvents;
+ private int _width;
+ private int _height;
+ private int _refreshDelaySeconds;
+ /**
+ * Configure this bean to query a particular router context
+ *
+ * @param contextId begging few characters of the routerHash, or null to pick
+ * the first one we come across.
+ */
+ public void setContextId(String contextId) {
+ try {
+ _context = ContextHelper.getContext(contextId);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ public GraphHelper() {
+ _periodCount = SummaryListener.PERIODS;
+ _showEvents = false;
+ _width = -1;
+ _height = -1;
+ _refreshDelaySeconds = 60;
+ }
+
+ public void setOut(Writer out) { _out = out; }
+ public void setPeriodCount(String str) {
+ try { _periodCount = Integer.parseInt(str); } catch (NumberFormatException nfe) {}
+ }
+ public void setShowEvents(boolean b) { _showEvents = b; }
+ public void setHeight(String str) {
+ try { _height = Integer.parseInt(str); } catch (NumberFormatException nfe) {}
+ }
+ public void setWidth(String str) {
+ try { _width = Integer.parseInt(str); } catch (NumberFormatException nfe) {}
+ }
+ public void setRefreshDelay(String str) {
+ try { _refreshDelaySeconds = Integer.parseInt(str); } catch (NumberFormatException nfe) {}
+ }
+
+ public String getImages() {
+ try {
+ List listeners = StatSummarizer.instance().getListeners();
+ for (int i = 0; i < listeners.size(); i++) {
+ SummaryListener lsnr = (SummaryListener)listeners.get(i);
+ Rate r = lsnr.getRate();
+ String title = r.getRateStat().getName() + " for " + DataHelper.formatDuration(_periodCount * r.getPeriod());
+ _out.write("\n");
+ }
+ if (_refreshDelaySeconds > 0)
+ _out.write("\n");
+
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ return "";
+ }
+ public String getForm() {
+ try {
+ _out.write("