Tor 0.4.9.0-alpha-dev
conflux_cell.h
Go to the documentation of this file.
1/* Copyright (c) 2023, The Tor Project, Inc. */
2/* See LICENSE for licensing information */
3
4/**
5 * \file conflux_cell.h
6 * \brief Header file for conflux_cell.c.
7 **/
8
9#ifndef TOR_CONFLUX_CELL_H
10#define TOR_CONFLUX_CELL_H
11
12#include "core/or/or.h"
13
14typedef struct conflux_cell_link_t {
15 uint8_t version;
16 uint8_t desired_ux;
17 uint8_t nonce[DIGEST256_LEN];
18
19 uint64_t last_seqno_sent;
20 uint64_t last_seqno_recv;
22
23conflux_cell_link_t *conflux_cell_new_link(const uint8_t *nonce,
24 uint64_t last_sent,
25 uint64_t last_recv,
26 uint8_t ux);
27
28conflux_cell_link_t *conflux_cell_parse_link(const cell_t *cell,
29 const uint16_t cell_len);
30conflux_cell_link_t *conflux_cell_parse_linked(const cell_t *cell,
31 const uint16_t cell_le);
32uint32_t conflux_cell_parse_switch(const cell_t *cell,
33 const uint16_t rh_len);
34
35bool conflux_cell_send_link(const conflux_cell_link_t *link,
36 origin_circuit_t *circ);
37bool conflux_cell_send_linked(const conflux_cell_link_t *link,
38 or_circuit_t *circ);
39bool conflux_cell_send_linked_ack(origin_circuit_t *circ);
40bool conflux_send_switch_command(circuit_t *send_circ, uint64_t relative_seq);
41
42#ifdef TOR_UNIT_TESTS
43
44STATIC ssize_t
45build_link_cell(const conflux_cell_link_t *link, uint8_t *cell_out);
46
47#endif /* TOR_UNIT_TESTS */
48
49#endif /* TOR_CONFLUX_CELL_H */
50
uint32_t conflux_cell_parse_switch(const cell_t *cell, const uint16_t rh_len)
Definition: conflux_cell.c:287
bool conflux_send_switch_command(circuit_t *send_circ, uint64_t relative_seq)
Definition: conflux_cell.c:311
#define DIGEST256_LEN
Definition: digest_sizes.h:23
Master header file for Tor-specific functionality.
Definition: cell_st.h:17
#define STATIC
Definition: testsupport.h:32