int connection_is_on_closeable_list(connection_t *conn);
smartlist_t *get_connection_array(void);
+uint64_t get_bytes_read(void);
+uint64_t get_bytes_written(void);
+ /** Bitmask for events that we can turn on and off with
+ * connection_watch_events. */
typedef enum watchable_events {
- READ_EVENT=0x02,
- WRITE_EVENT=0x04
+ /* Yes, it is intentional that these match Libevent's EV_READ and EV_WRITE */
+ READ_EVENT=0x02, /**< We want to know when a connection is readable */
+ WRITE_EVENT=0x04 /**< We want to know when a connection is writable */
} watchable_events_t;
void connection_watch_events(connection_t *conn, watchable_events_t events);
int connection_is_reading(connection_t *conn);
/** Parsed variable-length onion routing cell. */
typedef struct var_cell_t {
+ /** Type of the cell: CELL_VERSIONS, etc. */
uint8_t command;
+ /** Circuit thich received the cell */
circid_t circ_id;
- uint16_t payload_len; /**< The actual length of <b>payload</b>. */
+ /** Number of bytes actually stored in <b>payload</b> */
+ uint16_t payload_len;
+ /** Payload of this cell */
- uint8_t payload[1];
+ uint8_t payload[FLEXIBLE_ARRAY_MEMBER];
} var_cell_t;
/** A cell as packed for writing to the network. */