summaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-06-14 11:01:04 -0400
committerNick Mathewson <nickm@torproject.org>2014-06-14 11:01:04 -0400
commita58d94fb7c6c304ecba930eaa7ebbade1d0686ab (patch)
tree7c36b6a4f13246cec4644ebebba223f774c7dcbf /src/or/relay.c
parentcfca2a6037c139a82677a0ba2776d4ddf6ca6d04 (diff)
parent8f3e3279c198dd13c11ffd739ddf08dbe8b07762 (diff)
downloadtor-a58d94fb7c6c304ecba930eaa7ebbade1d0686ab.tar.gz
tor-a58d94fb7c6c304ecba930eaa7ebbade1d0686ab.zip
Merge branch 'bug12184_diagnostic_squashed'
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 66d1251eb7..f42602d412 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2569,6 +2569,17 @@ packed_cell_get_command(const packed_cell_t *cell, int wide_circ_ids)
}
}
+/** Extract the circuit ID from a packed cell. */
+circid_t
+packed_cell_get_circid(const packed_cell_t *cell, int wide_circ_ids)
+{
+ if (wide_circ_ids) {
+ return ntohl(get_uint32(cell->body));
+ } else {
+ return ntohs(get_uint16(cell->body));
+ }
+}
+
/** Pull as many cells as possible (but no more than <b>max</b>) from the
* queue of the first active circuit on <b>chan</b>, and write them to
* <b>chan</b>-&gt;outbuf. Return the number of cells written. Advance