aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-17 17:20:19 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-17 17:20:19 +0000
commit68a6935afb9566cb2e521997b48741a1037b5802 (patch)
tree13b331ba233cc12e4055852db73c6a1d98a0228b /src/or/or.h
parent44e19a4949f39687363c8b1098ebea4c98625afb (diff)
downloadtor-68a6935afb9566cb2e521997b48741a1037b5802.tar.gz
tor-68a6935afb9566cb2e521997b48741a1037b5802.zip
Change CELL_DIRECTION_* to an enum.
svn:r17646
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 96d9ca0949..c1698374f5 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -745,8 +745,11 @@ typedef struct rend_data_t {
* future are dropped immediately. */
#define REND_REPLAY_TIME_INTERVAL (60 * 60)
-#define CELL_DIRECTION_IN 1
-#define CELL_DIRECTION_OUT 2
+/** Used to indicate which way a cell is going on a circuit. */
+typedef enum {
+ CELL_DIRECTION_IN=1, /**< The cell is moving towards the origin. */
+ CELL_DIRECTION_OUT=2, /**< The cell is moving away from the origin. */
+} cell_direction_t;
/** Initial value for both sides of a circuit transmission window when the
* circuit is initialized. Measured in cells. */
@@ -3823,7 +3826,7 @@ extern uint64_t stats_n_relay_cells_relayed;
extern uint64_t stats_n_relay_cells_delivered;
int circuit_receive_relay_cell(cell_t *cell, circuit_t *circ,
- int cell_direction);
+ cell_direction_t cell_direction);
void relay_header_pack(char *dest, const relay_header_t *src);
void relay_header_unpack(relay_header_t *dest, const char *src);
@@ -3852,7 +3855,7 @@ void cell_queue_append(cell_queue_t *queue, packed_cell_t *cell);
void cell_queue_append_packed_copy(cell_queue_t *queue, const cell_t *cell);
void append_cell_to_circuit_queue(circuit_t *circ, or_connection_t *orconn,
- cell_t *cell, int direction);
+ cell_t *cell, cell_direction_t direction);
void connection_or_unlink_all_active_circs(or_connection_t *conn);
int connection_or_flush_from_first_active_circuit(or_connection_t *conn,
int max, time_t now);