aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-11-06 19:56:47 -0500
committerNick Mathewson <nickm@torproject.org>2012-11-06 21:23:46 -0500
commitbfffc1f0fc7616a25c32da2eb759dade4651659e (patch)
treeb31b3fe368816de2f5a001fbd975ead5aa1c2d9e /src/or/or.h
parentcd054ceadaa4723f076c7050160424b356b985ca (diff)
downloadtor-bfffc1f0fc7616a25c32da2eb759dade4651659e.tar
tor-bfffc1f0fc7616a25c32da2eb759dade4651659e.tar.gz
Allow a v4 link protocol for 4-byte circuit IDs.
Implements proposal 214. Needs testing.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 6510725f6..736438e6e 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -862,11 +862,12 @@ typedef enum {
/** Number of bytes in a cell, minus cell header. */
#define CELL_PAYLOAD_SIZE 509
-/** Number of bytes in a cell transmitted over the network. */
-#define CELL_NETWORK_SIZE 512
+/** Number of bytes in a cell transmitted over the network, in the longest
+ * form */
+#define CELL_MAX_NETWORK_SIZE 514
-/** Length of a header on a variable-length cell. */
-#define VAR_CELL_HEADER_SIZE 5
+/** Maximum length of a header on a variable-length cell. */
+#define VAR_CELL_MAX_HEADER_SIZE 7
/** Number of bytes in a relay cell's header (not including general cell
* header). */
@@ -875,7 +876,7 @@ typedef enum {
#define RELAY_PAYLOAD_SIZE (CELL_PAYLOAD_SIZE-RELAY_HEADER_SIZE)
/** Identifies a circuit on an or_connection */
-typedef uint16_t circid_t;
+typedef uint32_t circid_t;
/** Identifies a stream on a circuit */
typedef uint16_t streamid_t;
@@ -1044,7 +1045,7 @@ typedef struct var_cell_t {
/** A cell as packed for writing to the network. */
typedef struct packed_cell_t {
struct packed_cell_t *next; /**< Next cell queued on this circuit. */
- char body[CELL_NETWORK_SIZE]; /**< Cell as packed for network. */
+ char body[CELL_MAX_NETWORK_SIZE]; /**< Cell as packed for network. */
} packed_cell_t;
/** Number of cells added to a circuit queue including their insertion
@@ -1363,6 +1364,7 @@ typedef struct or_connection_t {
/** True iff this is an outgoing connection. */
unsigned int is_outgoing:1;
unsigned int proxy_type:2; /**< One of PROXY_NONE...PROXY_SOCKS5 */
+ unsigned int wide_circ_ids:1;
uint8_t link_proto; /**< What protocol version are we using? 0 for
* "none negotiated yet." */