Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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"
14
15typedef struct conflux_cell_link_t {
16 uint8_t version;
17 uint8_t desired_ux;
18 uint8_t nonce[DIGEST256_LEN];
19
20 uint64_t last_seqno_sent;
21 uint64_t last_seqno_recv;
23
24conflux_cell_link_t *conflux_cell_new_link(const uint8_t *nonce,
25 uint64_t last_sent,
26 uint64_t last_recv,
27 uint8_t ux);
28
29conflux_cell_link_t *conflux_cell_parse_link(const relay_msg_t *msg);
30conflux_cell_link_t *conflux_cell_parse_linked(const relay_msg_t *msg);
31uint32_t conflux_cell_parse_switch(const relay_msg_t *msg);
32
33bool conflux_cell_send_link(const conflux_cell_link_t *link,
34 origin_circuit_t *circ);
35bool conflux_cell_send_linked(const conflux_cell_link_t *link,
36 or_circuit_t *circ);
37bool conflux_cell_send_linked_ack(origin_circuit_t *circ);
38bool conflux_send_switch_command(circuit_t *send_circ, uint64_t relative_seq);
39
40#ifdef TOR_UNIT_TESTS
41
42STATIC ssize_t
43build_link_cell(const conflux_cell_link_t *link, uint8_t *cell_out);
44
45#endif /* TOR_UNIT_TESTS */
46
47#endif /* TOR_CONFLUX_CELL_H */
48
uint32_t conflux_cell_parse_switch(const relay_msg_t *msg)
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.
A relay message which contains a relay command and parameters, if any, that is from a relay cell.
#define STATIC
Definition: testsupport.h:32