summaryrefslogtreecommitdiff
path: root/src/trunnel/circpad_negotiation.trunnel
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2018-10-23 19:51:35 +0000
committerGeorge Kadianakis <desnacked@riseup.net>2019-01-02 15:12:20 +0200
commit4ca1df6b326f32fcc87d7d3fd6294221f6964235 (patch)
treefec2f8ada61479e0a966ba89187d70ede909d865 /src/trunnel/circpad_negotiation.trunnel
parent659a4f06d46a0e8e4f391eda3b6d86f2ab6e4db9 (diff)
downloadtor-4ca1df6b326f32fcc87d7d3fd6294221f6964235.tar.gz
tor-4ca1df6b326f32fcc87d7d3fd6294221f6964235.zip
Add padding negotiation trunnel output.
Co-authored-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/trunnel/circpad_negotiation.trunnel')
-rw-r--r--src/trunnel/circpad_negotiation.trunnel44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/trunnel/circpad_negotiation.trunnel b/src/trunnel/circpad_negotiation.trunnel
new file mode 100644
index 0000000000..abbc929cc5
--- /dev/null
+++ b/src/trunnel/circpad_negotiation.trunnel
@@ -0,0 +1,44 @@
+/* These are the padding negotiation commands */
+const CIRCPAD_COMMAND_STOP = 1;
+const CIRCPAD_COMMAND_START = 2;
+
+/* Responses to commands */
+const CIRCPAD_RESPONSE_OK = 1;
+const CIRCPAD_RESPONSE_ERR = 2;
+
+/* Built-in machine types */
+
+/* 1) Machine that obscures circuit setup */
+const CIRCPAD_MACHINE_CIRC_SETUP = 1;
+
+/**
+ * This command tells the relay to alter its min and max netflow
+ * timeout range values, and send padding at that rate (resuming
+ * if stopped). */
+struct circpad_negotiate {
+ u8 version IN [0];
+ u8 command IN [CIRCPAD_COMMAND_START, CIRCPAD_COMMAND_STOP];
+
+ /** Machine type is left unbounded because we can specify
+ * new machines in the consensus */
+ u8 machine_type;
+
+ /** If true, send a relay_drop reply.. */
+ // FIXME-MP-AP: Maybe we just say to transition to the first state
+ // here instead.. Also what about delay before responding?
+ u8 echo_request IN [0,1];
+};
+
+/**
+ * This command tells the relay to alter its min and max netflow
+ * timeout range values, and send padding at that rate (resuming
+ * if stopped). */
+struct circpad_negotiated {
+ u8 version IN [0];
+ u8 command IN [CIRCPAD_COMMAND_START, CIRCPAD_COMMAND_STOP];
+ u8 response IN [CIRCPAD_RESPONSE_OK, CIRCPAD_RESPONSE_ERR];
+
+ /** Machine type is left unbounded because we can specify
+ * new machines in the consensus */
+ u8 machine_type;
+};