These did not turn out to be useful for anything.
circid_t circ_id; /**< Circuit which received the cell. */
uint8_t command; /**< Type of the cell: one of CELL_PADDING, CELL_CREATE,
* 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. */
};
* the SENDME if need be. */
sendme_record_received_cell_digest(circ, layer_hint);
- cell->relay_cell_proto = format; // ????? TODO #41051.
// TODO #41051: This also doesn't need to copy!
relay_msg_t *msg = relay_msg_decode_cell(format, cell);
return -1;
}
- msg.relay_cell_proto = cell_format;
msg.command = relay_command;
msg.stream_id = stream_id;
msg.length = payload_len;
const uint16_t payload_len, relay_msg_t *msg)
{
// TODO #41051: Should this free msg->body?
- msg->relay_cell_proto = relay_cell_proto;
+ (void) relay_cell_proto;
msg->command = cmd;
msg->stream_id = stream_id;
cell_t *cell_out)
{
memset(cell_out, 0, sizeof(cell_t));
- cell_out->relay_cell_proto = format;
cell_out->command = msg->is_relay_early ?
CELL_RELAY_EARLY : CELL_RELAY;
relay_msg_decode_cell(relay_cell_fmt_t format,
const cell_t *cell)
{
- // TODO #41051: Either remove the format argument here,
- // or the format field in cell_t.
- tor_assert(cell->relay_cell_proto == format);
-
switch (format) {
case RELAY_CELL_FORMAT_V0:
return decode_v0_cell(cell);
*
* This CAN NOT be made opaque so to avoid heap allocation in the fast path. */
typedef struct relay_msg_t {
- /* Relay cell protocol version of this message. */
- relay_cell_fmt_t relay_cell_proto;
/* Relay command of a message. */
uint8_t command;
/* Length of the message body. */
s = "02" "0000" "0250" "00000000" "000B"
"68656c6c6f20776f726c64" "00000000";
base16_decode((char*)cell.payload, sizeof(cell.payload), s, strlen(s));
- cell.relay_cell_proto = RELAY_CELL_FORMAT_V0;
msg1 = relay_msg_decode_cell(RELAY_CELL_FORMAT_V0, &cell);
tt_assert(msg1);
"05" "0014"
"68656c6c6f206920616d2061207461672e2e2e2e" "00000000";
base16_decode((char*)cell.payload, sizeof(cell.payload), s, strlen(s));
- cell.relay_cell_proto = RELAY_CELL_FORMAT_V1;
msg1 = relay_msg_decode_cell(RELAY_CELL_FORMAT_V1, &cell);
tt_assert(msg1);
// V0, too long.
cell.command = CELL_RELAY;
- cell.relay_cell_proto = RELAY_CELL_FORMAT_V0;
s = "02" "0000" "0250" "00000000" "01F3";
base16_decode((char*)cell.payload, sizeof(cell.payload), s, strlen(s));
msg1 = relay_msg_decode_cell(RELAY_CELL_FORMAT_V0, &cell);
tt_ptr_op(msg1, OP_EQ, NULL);
// V1, command unrecognized.
- cell.relay_cell_proto = RELAY_CELL_FORMAT_V1;
s = "00000000000000000000000000000000"
"F0" "000C" "0250";
base16_decode((char*)cell.payload, sizeof(cell.payload), s, strlen(s));