9 #ifndef TOR_CIRCUITMUX_H
10 #define TOR_CIRCUITMUX_H
23 void (*free_cmux_data)(circuitmux_t *cmux,
27 (*alloc_circ_data)(circuitmux_t *cmux,
31 unsigned int cell_count);
33 void (*free_circ_data)(circuitmux_t *cmux,
38 void (*notify_circ_active)(circuitmux_t *cmux,
42 void (*notify_circ_inactive)(circuitmux_t *cmux,
47 void (*notify_set_n_cells)(circuitmux_t *cmux,
51 unsigned int n_cells);
52 void (*notify_xmit_cells)(circuitmux_t *cmux,
56 unsigned int n_cells);
58 circuit_t * (*pick_active_circuit)(circuitmux_t *cmux,
91 #define TO_CMUX_POL_DATA(x) (&((x)->base_))
98 #define TO_CMUX_POL_CIRC_DATA(x) (&((x)->base_))
101 void circuitmux_assert_okay(circuitmux_t *cmux);
108 #define circuitmux_free(cmux) \
109 FREE_AND_NULL(circuitmux_t, circuitmux_free_, (cmux))
131 int64_t circuitmux_count_queued_destroy_cells(
const channel_t *chan,
132 const circuitmux_t *cmux);
138 unsigned int n_cells);
149 unsigned int n_cells);
151 void circuitmux_append_destroy_cell(
channel_t *chan,
152 circuitmux_t *cmux,
circid_t circ_id,
159 (circuitmux_t *cmux_1, circuitmux_t *cmux_2));
161 #ifdef CIRCUITMUX_PRIVATE
170 chanid_circid_muxinfo_map_t;
176 struct circuitmux_t {
178 unsigned int n_circuits, n_active_circuits;
181 unsigned int n_cells;
186 chanid_circid_muxinfo_map_t *chanid_circid_map;
198 unsigned int last_cell_was_destroy : 1;
cell_direction_t circuitmux_attached_circuit_direction(circuitmux_t *cmux, circuit_t *circ)
void circuitmux_clear_policy(circuitmux_t *cmux)
void circuitmux_mark_destroyed_circids_usable(circuitmux_t *cmux, channel_t *chan)
void circuitmux_notify_xmit_destroy(circuitmux_t *cmux)
unsigned int circuitmux_num_cells_for_circuit(circuitmux_t *cmux, circuit_t *circ)
void circuitmux_detach_all_circuits(circuitmux_t *cmux, smartlist_t *detached_out)
void circuitmux_notify_xmit_cells(circuitmux_t *cmux, circuit_t *circ, unsigned int n_cells)
void circuitmux_set_policy(circuitmux_t *cmux, const circuitmux_policy_t *pol)
int circuitmux_compare_muxes(circuitmux_t *cmux_1, circuitmux_t *cmux_2)
unsigned int circuitmux_num_active_circuits(circuitmux_t *cmux)
void circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t *circ, cell_direction_t direction)
unsigned int circuitmux_num_circuits(circuitmux_t *cmux)
void circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t *circ)
circuitmux_t * circuitmux_alloc(void)
int circuitmux_is_circuit_active(circuitmux_t *cmux, circuit_t *circ)
void circuitmux_free_(circuitmux_t *cmux)
void circuitmux_clear_num_cells(circuitmux_t *cmux, circuit_t *circ)
int circuitmux_is_circuit_attached(circuitmux_t *cmux, circuit_t *circ)
circuit_t * circuitmux_get_first_active_circuit(circuitmux_t *cmux, destroy_cell_queue_t **destroy_queue_out)
void circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t *circ, unsigned int n_cells)
unsigned int circuitmux_num_cells(circuitmux_t *cmux)
const circuitmux_policy_t * circuitmux_get_policy(circuitmux_t *cmux)
Destroy-cell queue structures.
typedef HT_HEAD(hs_service_ht, hs_service_t) hs_service_ht
Master header file for Tor-specific functionality.
Macros to implement mocking and selective exposure for the test code.
#define MOCK_DECL(rv, funcname, arglist)