9#define TOR_CONFLUX_PRIVATE
19#include "core/or/or_circuit_st.h"
45 tor_assert_nonfatal(circ->
purpose ==
46 CIRCUIT_PURPOSE_CONFLUX_LINKED);
62 log_warn(
LD_BUG,
"Conflux has no circuit to send on. "
63 "Circuit %p idx %d marked at line %s:%d",
68 log_warn(
LD_BUG,
"Conflux has no circuit to send on. "
69 "Circuit %p idx %d not marked for close.",
79 cpath = CONST_TO_ORIGIN_CIRCUIT(circ)->
cpath->
prev;
81 if (BUG(cpath != NULL)) {
82 log_warn(
LD_BUG,
"cpath is not NULL for non-origin circuit");
109 LD_BUG,
"Conflux has no current circuit to send on. ");
125 log_warn(
LD_BUG,
"No circuit to send on for conflux");
150 if (dest != layer_hint) {
151 log_warn(
LD_CIRC,
"Got conflux command from incorrect hop");
155 if (layer_hint == NULL) {
158 log_warn(
LD_BUG,
"Got conflux command on circuit with further hops");
181 CIRCUIT_PURPOSE_CONFLUX_LINKED);
190 } CONFLUX_FOR_EACH_LEG_END(leg);
196 return cpath == NULL;
215 CIRCUIT_PURPOSE_CONFLUX_LINKED);
218 uint64_t max_rtt = 0;
221 if (cc->max_rtt_usec > max_rtt) {
222 max_rtt = cc->max_rtt_usec;
224 } CONFLUX_FOR_EACH_LEG_END(leg);
250 tor_assert_nonfatal(
TO_CIRCUIT(circ)->purpose ==
251 CIRCUIT_PURPOSE_CONFLUX_LINKED);
260 } CONFLUX_FOR_EACH_LEG_END(leg);
263 "Got unexpected relay data from intermediate hop");
268 "Got unexpected relay data from intermediate hop");
285 tor_assert_nonfatal(
TO_CIRCUIT(circ)->purpose ==
286 CIRCUIT_PURPOSE_CONFLUX_LINKED);
289 } CONFLUX_FOR_EACH_LEG_END(leg);
313 leg->circ->timestamp_dirty =
TO_CIRCUIT(ref_circ)->timestamp_dirty;
315 ocirc->unusable_for_new_conns = ref_circ->unusable_for_new_conns;
316 } CONFLUX_FOR_EACH_LEG_END(leg);
331 } CONFLUX_FOR_EACH_LEG_END(leg);
347 } CONFLUX_FOR_EACH_LEG_END(leg);
360 tor_assert_nonfatal(
TO_CIRCUIT(circ)->purpose ==
361 CIRCUIT_PURPOSE_CONFLUX_LINKED);
364 } CONFLUX_FOR_EACH_LEG_END(leg);
381 CONST_TO_ORIGIN_CIRCUIT(first_leg->
circ);
388 } CONFLUX_FOR_EACH_LEG_END(leg);
392 const or_circuit_t *l_circ = CONST_TO_OR_CIRCUIT(leg->circ);
396 } CONFLUX_FOR_EACH_LEG_END(leg);
408 bool is_client =
false;
412 tor_assert_nonfatal(leg->circ->purpose ==
413 CIRCUIT_PURPOSE_CONFLUX_LINKED);
418 if (BUG(leg->circ->conflux_pending_nonce != NULL)) {
424 if (BUG(leg->circ->conflux == NULL)) {
430 if (leg->circ_rtts_usec > 0) {
433 } CONFLUX_FOR_EACH_LEG_END(leg);
440 LD_BUG,
"Number of legs is above maximum of %d allowed: %d\n",
origin_circuit_t * TO_ORIGIN_CIRCUIT(circuit_t *x)
or_circuit_t * TO_OR_CIRCUIT(circuit_t *x)
Header file for circuitlist.c.
#define CIRCUIT_IS_ORIGIN(c)
Functions and types for monotonic times.
Header file for config.c.
circuit_t * conflux_decide_next_circ(conflux_t *cfx)
const congestion_control_t * circuit_ccontrol(const circuit_t *circ)
Public APIs for conflux multipath support.
#define CONFLUX_FOR_EACH_LEG_BEGIN(cfx, var)
Header file for conflux_params.c.
uint8_t conflux_params_get_num_legs_set(void)
void conflux_log_set(int loglevel, const conflux_t *cfx, bool is_client)
Header file for conflux_pool.c.
Structure definitions for conflux multipath.
void conflux_validate_stream_lists(const conflux_t *cfx)
uint64_t edge_get_max_rtt(const edge_connection_t *stream)
crypt_path_t * conflux_get_destination_hop(circuit_t *circ)
void conflux_validate_legs(const conflux_t *cfx)
bool conflux_validate_source_hop(circuit_t *in_circ, crypt_path_t *layer_hint)
void conflux_sync_circ_fields(conflux_t *cfx, origin_circuit_t *ref_circ)
void conflux_update_resolving_streams(or_circuit_t *circ, edge_connection_t *stream)
int circuit_get_package_window(circuit_t *circ, const crypt_path_t *cpath)
void conflux_update_p_streams(origin_circuit_t *circ, edge_connection_t *stream)
void conflux_update_half_streams(origin_circuit_t *circ, smartlist_t *half_streams)
bool conflux_can_send(conflux_t *cfx)
bool relay_crypt_from_last_hop(const origin_circuit_t *circ, const crypt_path_t *layer_hint)
void conflux_update_n_streams(or_circuit_t *circ, edge_connection_t *stream)
bool edge_uses_cpath(const edge_connection_t *conn, const crypt_path_t *cpath)
Header file for conflux_util.c.
int congestion_control_get_package_window(const circuit_t *circ, const crypt_path_t *cpath)
Public APIs for congestion control.
Structure definitions for congestion control.
#define log_fn(severity, domain, args,...)
Master header file for Tor-specific functionality.
Origin circuit structure.
Header file for sendme.c.
int global_circuitlist_idx
uint16_t marked_for_close
struct conflux_t * conflux
const char * marked_for_close_file
struct congestion_control_t * ccontrol
struct conflux_leg_t * curr_leg
struct crypt_path_t * prev
struct congestion_control_t * ccontrol
struct crypt_path_t * cpath_layer
struct circuit_t * on_circuit
edge_connection_t * resolving_streams
edge_connection_t * n_streams
edge_connection_t * p_streams
streamid_t next_stream_id
smartlist_t * half_streams