Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
congestion_control_flow.h
Go to the documentation of this file.
1/* Copyright (c) 2019-2021, The Tor Project, Inc. */
2/* See LICENSE for licensing information */
3
4/**
5 * \file congestion_control_flow.h
6 * \brief APIs for stream flow control on congestion controlled circuits.
7 **/
8
9#ifndef TOR_CONGESTION_CONTROL_FLOW_H
10#define TOR_CONGESTION_CONTROL_FLOW_H
11
13#include "core/or/circuit_st.h"
15
16struct relay_msg_t;
17
19
21 const crypt_path_t *layer_hint);
23 const crypt_path_t *layer_hint,
24 const struct relay_msg_t *msg);
25
27void flow_control_decide_xon(edge_connection_t *stream, size_t n_written);
28
29void flow_control_note_sent_data(edge_connection_t *stream, size_t len);
30
32
34
35/** Metricsport externs */
36extern uint64_t cc_stats_flow_num_xoff_sent;
37extern uint64_t cc_stats_flow_num_xon_sent;
38extern double cc_stats_flow_xoff_outbuf_ma;
39extern double cc_stats_flow_xon_outbuf_ma;
40
41/* Private section starts. */
42#ifdef TOR_CONGESTION_CONTROL_FLOW_PRIVATE
43
44/*
45 * Unit tests declaractions.
46 */
47#ifdef TOR_UNIT_TESTS
48
49#endif /* defined(TOR_UNIT_TESTS) */
50
51#endif /* defined(TOR_CONGESTION_CONTROL_FLOW_PRIVATE) */
52
53#endif /* !defined(TOR_CONGESTION_CONTROL_FLOW_H) */
Base circuit structure.
void flow_control_new_consensus_params(const networkstatus_t *ns)
bool circuit_process_stream_xon(edge_connection_t *conn, const crypt_path_t *layer_hint, const relay_msg_t *msg)
bool circuit_process_stream_xoff(edge_connection_t *conn, const crypt_path_t *layer_hint)
int flow_control_decide_xoff(edge_connection_t *stream)
void flow_control_note_sent_data(edge_connection_t *stream, size_t len)
bool edge_uses_flow_control(const edge_connection_t *stream)
uint64_t cc_stats_flow_num_xoff_sent
bool conn_uses_flow_control(connection_t *stream)
void flow_control_decide_xon(edge_connection_t *stream, size_t n_written)
Path structures for origin circuits.
Edge-connection structure.