* CELL_DESTROY, etc */
/* Relay cell protocol version. This tells us which format to use when
* parsing the payload. */
+ /* TODO #41051: Use an enum. */
+ /* TODO #41051: Reconsider whether this field belongs here. */
uint8_t relay_cell_proto;
uint8_t payload[CELL_PAYLOAD_SIZE]; /**< Cell body. */
};
return wide_circ_ids ? 4 : 2;
}
+/* TODO #41051: It would be better if these went away. */
/** Number of bytes in a relay cell's header (not including general cell
* header). */
#define RELAY_HEADER_SIZE (1+2+2+4+2)
* payload for the future of our C-tor maze and protocol. */
#define RELAY_CELL_PADDING_GAP 4
+/* TODO #41051: Most of these functions no longer make sense under CGO,
+ * and we are only going to use the new proto format with CGO. */
+
/* Getters. */
bool relay_cell_is_recognized(const cell_t *cell);
uint8_t *relay_cell_get_digest(cell_t *cell);
/* Specified in tor-spec.txt. */
switch (relay_cell_proto) {
case 0: return (1 + 2 + 2 + 4 + 2); // 11
+ // TODO #41051: This doesn't really make sense, for two reasons.
+ // First, we're not going to do this protocol without CGO,
+ // so we no longer have separate "recognized" and "digest" fields.
+ // Second, the 16-byte tag under CGO does not include
+ // the length and command fields,
+ // which are counted above.
case 1: return (2 + 14); // 16
default:
tor_fragile_assert();
/** Return the size of the relay cell payload for the given relay cell
* protocol version. */
+/* TODO #41051: This depends on the command too, since the stream ID is
+ conditional */
+/* TODO #41051: This is a _maximum_. */
static inline size_t
relay_cell_get_payload_size(uint8_t relay_cell_proto)
{
#endif /* RELAY_CELL_PRIVATE */
#endif /* TOR_RELAY_CELL_H */
-