Text file with diffs attached. zip of new files in other email.
? dist
? docs
? prng.seed
? Contrib/fcptools/fcptools-0.4.8
? Contrib/fcptools/libtool
? lib/junit-gpl.jar
? src/freenet/.nautilus-metafile.xml
? src/freenet/node/gatekeeper
Index: src/freenet/Message.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/Message.java,v
retrieving revision 1.4
diff -r1.4 Message.java
47c47
< this.otherFields = otherFields;
---
> this.otherFields = (otherFields != null) ? otherFields : new FieldSet();
Index: src/freenet/client/InternalClient.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/InternalClient.java,v
retrieving revision 1.10
diff -r1.10 InternalClient.java
486a487,488
>
> // do we add gateway hint?
488c490,493
< null, ft, ri);
---
> null, ft, ri,
> n.addGatewayHint ?
>ft.clientKey.getURI().toString() : null
> );
>
Index: src/freenet/message/DataRequest.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/message/DataRequest.java,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 DataRequest.java
33d32
< //import java.net.*;
37a37
> public static final String gatewayHintField = "GatewayHint";
63a64,75
> }
>
> public String getGatewayHint() {
> return otherFields.get( gatewayHintField );
> }
>
> public void putGatewayHint( String gatewayHint ) {
> if (gatewayHint == null) {
> otherFields.remove( gatewayHintField );
> } else {
> otherFields.put( gatewayHintField, gatewayHint );
> }
Index: src/freenet/node/Node.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/Node.java,v
retrieving revision 1.93
diff -r1.93 Node.java
10a11
> import freenet.node.gatekeeper.GateKeeper;
766a768,829
> // Options for the gatekeeper gateway
> // to other protocols
> config.addOption("addGatewayHint", 1, true, 2501);
> config.addOption("gatekeeper.gateways", 1, GateKeeper.DEFAULT_GATEWAYS,
>2502);
> config.addOption("gatekeeper.insertHTL", 1, GateKeeper.DEFAULT_INSERT_HTL,
>2503);
> config.addOption("gatekeeper.urlGateway.insertionPoints", 1,
>freenet.node.gatekeeper.url.UrlGateway.DEFAULT_INSERTION_POINTS, 2510);
> config.addOption("gatekeeper.urlGateway.proxyPoints", 1,
>freenet.node.gatekeeper.url.UrlGateway.DEFAULT_PROXY_POINTS, 2511);
>
> // addGatewayHint
> config.setExpert ("addGatewayHint", true);
> config.argDesc ("addGatewayHint", "true/false");
> config.shortDesc ("addGatewayHint", "Add hint to queries for gatekeeper");
> config.longDesc ("addGatewayHint",
> "Add a hint to freenet queries so that other nodes may proxy out " +
> "to other protocols if the query cannot be served by freenet. " +
> "Note: this makes queries more susceptible to traffic analysis."
> );
>
> // gatekeeper.gateways
> config.setExpert ("gatekeeper.gateways", false);
> config.argDesc ("gatekeeper.gateways",
>"gatewayClass_1,gatewayClass_2,...");
> config.shortDesc ("gatekeeper.gateways", "Classes that proxy out to other
>protocols.");
> config.longDesc ("gatekeeper.gateways",
> "A comma delimited list of Gateway classes that are " +
> "instantiated when the node starts. " +
> "Each class controls gatewaying out to some other " +
> "protocol. If there are no classes listed here, " +
> "this freenet node will not proxy out to any other
>protocols."
> );
>
>
> // gatekeeper.insertHTL (insert hops to live)
> config.setExpert ("gatekeeper.insertHTL", true);
> config.argDesc ("gatekeeper.insertHTL", "<integer>");
> config.shortDesc ("gatekeeper.insertHTL", "HTL used when inserting proxied
>data");
> config.longDesc ("gatekeeper.insertHTL",
> "When inserting proxied data into freenet, the gatekeeper will set HTL
>to this value",
> "for the insert request."
> );
>
> // gatekeeper.urlGateway.insertionPoints
> config.setExpert ("gatekeeper.urlGateway.insertionPoints", false);
> config.argDesc ("gatekeeper.urlGateway.insertionPoints",
>"freenet:KSK@insertionpoint_1,freenet:DBR@insertionpoint_2,...");
> config.shortDesc ("gatekeeper.urlGateway.insertionPoints", "Where the URL
>gateway will insert fetched data");
> config.longDesc ("gatekeeper.urlGateway.insertionPoints",
> "A comma delimited list of points in freenet keyspace " +
> "where the URL Gateway will insert fetched data."
> );
>
> // gatekeeper.urlGateway.proxyPoints
> config.setExpert ("gatekeeper.urlGateway.proxyPoints", false);
> config.argDesc ("gatekeeper.urlGateway.proxyPoints",
>"http://urlfragment_1,ftp://urlfragment_2,...");
> config.shortDesc ("gatekeeper.urlGateway.proxyPoints", "Where the URL
>gateway will fetch data from");
> config.longDesc ("gatekeeper.urlGateway.proxyPoints",
> "A comma delimited list of URL fragments denoting" +
> "where the URL Gateway will fetch data from. " +
> "There should be a URL fragment corresponding to " +
> "each insertion point listed in " +
> "gatekeeper.urlGateway.insertionPoints."
> );
>
>
836a900,903
> // gatekeeper stuff
> static public boolean addGatewayHint;
>
>
959a1027,1033
> // GatewayHint parameters
> addGatewayHint = params.getBoolean("addGatewayHint");
>
> // GateKeeper
> gateKeeper = new GateKeeper();
> gateKeeper.init(params);
>
1029,1030c1103,1107
< // REDFLAG: initialize, better interface, i.e make final?
<
---
> /**
> * GateKeeper to proxy out to other protocols
> */
> public static GateKeeper gateKeeper = null;
>
Index: src/freenet/node/states/FCP/NewClientGet.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/FCP/NewClientGet.java,v
retrieving revision 1.6
diff -r1.6 NewClientGet.java
61a62,63
>
> // do we add gateway hint?
63c65,66
< k, null, ft, ri)).received(n, ri);
---
> k, null, ft, ri,
> n.addGatewayHint ? cgmo.getURI().toString() :
>null)).received(n, ri);
Index: src/freenet/node/states/FNP/NewDataRequest.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/FNP/NewDataRequest.java,v
retrieving revision 1.4
diff -r1.4 NewDataRequest.java
42c42
< drmo.searchKey, origRec, ft, ri);
---
> drmo.searchKey, origRec, ft, ri,
>drmo.getGatewayHint());
Index: src/freenet/node/states/announcing/NewInitialRequest.java
===================================================================
RCS file:
/cvsroot/freenet/freenet/src/freenet/node/states/announcing/NewInitialRequest.java,v
retrieving revision 1.3
diff -r1.3 NewInitialRequest.java
58c58
< return (new DataPending(id, htl, key, null, ft, ri)).received(n, ri);
---
> return (new DataPending(id, htl, key, null, ft, ri, null)).received(n, ri);
Index: src/freenet/node/states/request/DataPending.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/request/DataPending.java,v
retrieving revision 1.10
diff -r1.10 DataPending.java
17a18,25
>
> /**
> * A hint to pass to gateways to to other protocols.
> * This is used because the searchKey (a GUID) will be insufficient
> * data to proxy out to another protocol.
> */
> private String gatewayHint;
>
21c29,30
< FeedbackToken ft, RequestInitiator ri) {
---
> FeedbackToken ft, RequestInitiator ri,
> String gatewayHint) {
22a32
> this.gatewayHint = gatewayHint;
28a39,43
> this.gatewayHint = null;
> }
> DataPending(DataPending ancestor) {
> super(ancestor);
> this.gatewayHint = ancestor.gatewayHint;
36c51,58
< return new DataRequest(id, hopsToLive, searchKey, ref, otherFields);
---
> DataRequest request = new DataRequest(id, hopsToLive, searchKey, ref,
>otherFields);
> if (gatewayHint != null) {
> request.putGatewayHint(gatewayHint);
> } else {
> gatewayHint = request.getGatewayHint();
> }
>
> return request;
50a73,81
> try {
> // Ok, we couldn't find what we needed in freenet...
> // try to get the data via a gateway to another
> // protocol.
> searchGateway( n );
> }
> catch (RequestAbortException rae) {
> return rae.state;
> }
68a100,108
> try {
> // Ok, we couldn't find what we needed in freenet...
> // try to get the data via a gateway to another
> // protocol.
> searchGateway( n );
> }
> catch (RequestAbortException rae) {
> return rae.state;
> }
117a158,166
> try {
> // Ok, we couldn't find what we needed in freenet...
> // try to get the data via a gateway to another
> // protocol.
> searchGateway( n );
> }
> catch (RequestAbortException rae) {
> return rae.state;
> }
132a182
>
153d202
< }
154a204,224
> /**
> * Search via gateway to other protocols for data.
> * Does nothing if data is not found. In order to know what to
> * request via some other protocol, use the GatewayHint field
> * of the key.
> */
> private final void searchGateway( Node n ) throws RequestAbortException {
>
>
> // Only bother with this if we have a GatewayHint
> if ((gatewayHint != null) && ( gatewayHint.length() > 0))
> {
> // tell gateways to look for the data
> n.gateKeeper.search( n, gatewayHint );
>
> // If the gateway inserted the data, it will be in the local
> // cache.
> searchData(n);
> }
> }
> }