1 /* Copyright (c) 2023, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
6 * \brief Header file for conflux_cell.c.
9 #ifndef TOR_CONFLUX_CELL_H
10 #define TOR_CONFLUX_CELL_H
12 #include "core/or/or.h"
14 typedef struct conflux_cell_link_t
{
17 uint8_t nonce
[DIGEST256_LEN
];
19 uint64_t last_seqno_sent
;
20 uint64_t last_seqno_recv
;
21 } conflux_cell_link_t
;
23 conflux_cell_link_t
*conflux_cell_new_link(const uint8_t *nonce
,
28 conflux_cell_link_t
*conflux_cell_parse_link(const cell_t
*cell
,
29 const uint16_t cell_len
);
30 conflux_cell_link_t
*conflux_cell_parse_linked(const cell_t
*cell
,
31 const uint16_t cell_le
);
32 uint32_t conflux_cell_parse_switch(const cell_t
*cell
,
33 const uint16_t rh_len
);
35 bool conflux_cell_send_link(const conflux_cell_link_t
*link
,
36 origin_circuit_t
*circ
);
37 bool conflux_cell_send_linked(const conflux_cell_link_t
*link
,
39 bool conflux_cell_send_linked_ack(origin_circuit_t
*circ
);
40 bool conflux_send_switch_command(circuit_t
*send_circ
, uint64_t relative_seq
);
45 build_link_cell(const conflux_cell_link_t
*link
, uint8_t *cell_out
);
47 #endif /* TOR_UNIT_TESTS */
49 #endif /* TOR_CONFLUX_CELL_H */