Browse Source

Stub out USER_MESSAGE.

Adam Ierymenko 9 years ago
parent
commit
0ee4d3554a
3 changed files with 15 additions and 1 deletions
  1. 2 0
      node/IncomingPacket.cpp
  2. 1 0
      node/Packet.cpp
  3. 12 1
      node/Packet.hpp

+ 2 - 0
node/IncomingPacket.cpp

@@ -109,6 +109,8 @@ bool IncomingPacket::tryDecode(const RuntimeEnvironment *RR)
 				case Packet::VERB_CIRCUIT_TEST:                   return _doCIRCUIT_TEST(RR,peer);
 				case Packet::VERB_CIRCUIT_TEST_REPORT:            return _doCIRCUIT_TEST_REPORT(RR,peer);
 				case Packet::VERB_REQUEST_PROOF_OF_WORK:          return _doREQUEST_PROOF_OF_WORK(RR,peer);
+				case Packet::VERB_USER_MESSAGE:
+					return true;
 			}
 		} else {
 			RR->sw->requestWhois(sourceAddress);

+ 1 - 0
node/Packet.cpp

@@ -47,6 +47,7 @@ const char *Packet::verbString(Verb v)
 		case VERB_CIRCUIT_TEST: return "CIRCUIT_TEST";
 		case VERB_CIRCUIT_TEST_REPORT: return "CIRCUIT_TEST_REPORT";
 		case VERB_REQUEST_PROOF_OF_WORK: return "REQUEST_PROOF_OF_WORK";
+		case VERB_USER_MESSAGE: return "USER_MESSAGE";
 	}
 	return "(unknown)";
 }

+ 12 - 1
node/Packet.hpp

@@ -1030,7 +1030,18 @@ public:
 		 *
 		 * ERROR has no payload.
 		 */
-		VERB_REQUEST_PROOF_OF_WORK = 0x13
+		VERB_REQUEST_PROOF_OF_WORK = 0x13,
+
+		/**
+		 * A message with arbitrary user-definable content:
+		 *   <[8] 64-bit arbitrary message type ID>
+		 *  [<[...] message payload>]
+		 *
+		 * This can be used to send arbitrary messages over VL1. It generates no
+		 * OK or ERROR and has no special semantics outside of whatever the user
+		 * (via the ZeroTier core API) chooses to give it.
+		 */
+		VERB_USER_MESSAGE = 0x14
 	};
 
 	/**