Author: robert
Date: 2008-02-06 17:27:46 +0000 (Wed, 06 Feb 2008)
New Revision: 17592
Modified:
trunk/freenet/src/freenet/io/comm/DMT.java
Log:
Secret[Ping/Pong/Set] message types
Modified: trunk/freenet/src/freenet/io/comm/DMT.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/DMT.java 2008-02-06 15:18:07 UTC (rev
17591)
+++ trunk/freenet/src/freenet/io/comm/DMT.java 2008-02-06 17:27:46 UTC (rev
17592)
@@ -127,6 +127,8 @@
public static final String REJECT_CODE = "rejectCode";
public static final String ROUTING_ENABLED = "routingEnabled";
public static final String OFFER_AUTHENTICATOR = "offerAuthenticator";
+ public static final String DAWN_HTL = "dawnHtl";
+ public static final String SECRET = "secret";
/** Very urgent */
public static final short PRIORITY_NOW=-2;
@@ -1175,6 +1177,47 @@
return msg;
}
+ public static final MessageType FNPSecretPing = new
MessageType("FNPSecretPing", PRIORITY_LOW) {{
+ addRoutedToNodeMessageFields();
+ addField(COUNTER, Integer.class);
+ addField(DAWN_HTL, Short.class);
+ }};
+
+
+ public static final Message createFNPSecretPing(long uid, double
targetLocation, short htl, short dawnHtl, int counter) {
+ Message msg = new Message(FNPSecretPing);
+ msg.setRoutedToNodeFields(uid, targetLocation, htl);
+ msg.set(COUNTER, counter);
+ msg.set(DAWN_HTL, dawnHtl);
+ return msg;
+ }
+
+ public static final MessageType FNPSecretPong = new
MessageType("FNPSecretPong", PRIORITY_LOW) {{
+ addField(UID, Long.class);
+ addField(COUNTER, Integer.class);
+ addField(SECRET, Long.class);
+ }};
+
+ public static final Message createFNPSecretPong(long uid, int counter,
long secret) {
+ Message msg = new Message(FNPSecretPong);
+ msg.set(UID, uid);
+ msg.set(COUNTER, counter);
+ msg.set(SECRET, Long.class);
+ return msg;
+ }
+
+ public static final MessageType FNPStoreSecret = new
MessageType("FNPStoreSecret", PRIORITY_LOW) {{
+ addField(UID, Long.class);
+ addField(SECRET, Long.class);
+ }};
+
+ public static final Message createFNPStoreSecret(long uid, long secret)
{
+ Message msg = new Message(FNPStoreSecret);
+ msg.set(UID, uid);
+ msg.set(SECRET, Long.class);
+ return msg;
+ }
+
public static final MessageType FNPRoutedRejected = new
MessageType("FNPRoutedRejected", PRIORITY_UNSPECIFIED) {{
addField(UID, Long.class);
addField(HTL, Short.class);