aboutsummaryrefslogtreecommitdiff
path: root/src/trunnel/flow_control_cells.trunnel
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2021-08-06 18:47:05 +0000
committerMike Perry <mikeperry-git@torproject.org>2021-09-28 21:26:10 +0000
commit6868f30cedf783bc6ba883206899ae7d59473c0c (patch)
treec5ae3f2ad477e09c328824d449f838eedc925a9d /src/trunnel/flow_control_cells.trunnel
parentecb91e75e4770fa76c64c7b1932985de024d693e (diff)
downloadtor-6868f30cedf783bc6ba883206899ae7d59473c0c.tar.gz
tor-6868f30cedf783bc6ba883206899ae7d59473c0c.zip
Add trunnel definitions for xon/xoff cells.
Diffstat (limited to 'src/trunnel/flow_control_cells.trunnel')
-rw-r--r--src/trunnel/flow_control_cells.trunnel20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/trunnel/flow_control_cells.trunnel b/src/trunnel/flow_control_cells.trunnel
new file mode 100644
index 0000000000..9d07b568a9
--- /dev/null
+++ b/src/trunnel/flow_control_cells.trunnel
@@ -0,0 +1,20 @@
+/* This file contains the xon and xoff cell definitions, for flow control. */
+
+/* xoff cell definition. Tells the other endpoint to stop sending, because
+ * we have too much data queued for this stream. */
+struct xoff_cell {
+ /* Version field. */
+ u8 version IN [0x00];
+}
+
+/* xon cell declaration. Tells the other endpoint to resume sending and/or
+ * update its sending rate on this stream based on advisory information. */
+struct xon_cell {
+ /* Version field. */
+ u8 version IN [0x00];
+
+ /* Advisory field: The ewma rate of socket drain we have seen so far
+ * on this stream, in kilobytes/sec (1000 bytes/sec). May be zero,
+ * which means no rate advice. */
+ u32 kbps_ewma;
+}