12 #ifndef TOR_CONNECTION_EDGE_H 13 #define TOR_CONNECTION_EDGE_H 15 #include "testsupport.h" 17 #define connection_mark_unattached_ap(conn, endreason) \ 18 connection_mark_unattached_ap_((conn), (endreason), __LINE__, SHORT_FILE__) 20 MOCK_DECL(
void,connection_mark_unattached_ap_,
22 int line,
const char *file));
41 char *address, uint16_t port,
45 int use_begindir,
int want_onehop);
49 MOCK_DECL(
void,connection_ap_handshake_socks_resolved,
53 const uint8_t *answer,
71 const char *file,
int line);
72 #define connection_ap_mark_as_pending_circuit(c) \ 73 connection_ap_mark_as_pending_circuit_((c), __FILE__, __LINE__) 75 #define CONNECTION_AP_EXPECT_NONPENDING(c) do { \ 76 if (ENTRY_TO_CONN(c)->state == AP_CONN_STATE_CIRCUIT_WAIT) { \ 77 log_warn(LD_BUG, "At %s:%d: %p was unexpectedly in circuit_wait.", \ 78 __FILE__, __LINE__, (c)); \ 79 connection_ap_mark_as_non_pending_circuit(c); \ 92 MOCK_DECL(
int, connection_ap_rewrite_and_attach_if_allowed,
102 NORMAL_HOSTNAME, ONION_V2_HOSTNAME, ONION_V3_HOSTNAME,
103 EXIT_HOSTNAME, BAD_HOSTNAME
107 #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_PFVAR_H) 108 int get_pf_socket(
void);
121 void connection_ap_warn_and_unmark_if_pending_circ(
134 #define BEGIN_FLAG_IPV6_OK (1u<<0) 139 #define BEGIN_FLAG_IPV4_NOT_OK (1u<<1) 142 #define BEGIN_FLAG_IPV6_PREFERRED (1u<<2) 145 #ifdef CONNECTION_EDGE_PRIVATE 148 typedef struct begin_cell_t {
160 unsigned is_begindir : 1;
164 uint8_t *end_reason_out);
173 char orig_address[MAX_SOCKS_ADDR_LEN];
191 rewrite_result_t *out);
int connection_edge_destroy(circid_t circ_id, edge_connection_t *conn)
Definition: connection_edge.c:300
void connection_ap_handshake_socks_resolved_addr(entry_connection_t *conn, const tor_addr_t *answer, int ttl, time_t expires)
Definition: connection_edge.c:2990
void connection_ap_fail_onehop(const char *failed_digest, cpath_build_state_t *build_state)
Definition: connection_edge.c:1053
void connection_ap_mark_as_pending_circuit_(entry_connection_t *entry_conn, const char *file, int line)
Definition: connection_edge.c:982
int connection_edge_reached_eof(edge_connection_t *conn)
Definition: connection_edge.c:197
hostname_type_t parse_extended_hostname(char *address)
Definition: connection_edge.c:3934
void circuit_clear_isolation(origin_circuit_t *circ)
Definition: connection_edge.c:4148
int connection_edge_end(edge_connection_t *conn, uint8_t reason)
Definition: connection_edge.c:386
void connection_edge_free_all(void)
Definition: connection_edge.c:4183
int connection_edge_end_errno(edge_connection_t *conn)
Definition: connection_edge.c:454
int connection_edge_process_inbuf(edge_connection_t *conn, int package_partial)
Definition: connection_edge.c:231
MOCK_DECL(int, router_have_minimum_dir_info,(void))
addressmap_entry_source_t
Definition: or.h:4974
void connection_exit_about_to_close(edge_connection_t *edge_conn)
Definition: connection_edge.c:688
void connection_ap_expire_beginning(void)
Definition: connection_edge.c:729
void connection_ap_rescan_and_attach_pending(void)
Definition: connection_edge.c:853
STATIC int begin_cell_parse(const cell_t *cell, begin_cell_t *bcell, uint8_t *end_reason_out)
Definition: connection_edge.c:3246
streamid_t get_unique_stream_id_by_circ(origin_circuit_t *circ)
Definition: connection_edge.c:2578
int connection_edge_flushed_some(edge_connection_t *conn)
Definition: connection_edge.c:468
int connection_ap_handshake_rewrite_and_attach(entry_connection_t *conn, origin_circuit_t *circ, crypt_path_t *cpath)
Definition: connection_edge.c:1636
entry_connection_t * connection_ap_make_link(connection_t *partner, char *address, uint16_t port, const char *digest, int session_group, int isolation_flags, int use_begindir, int want_onehop)
Definition: connection_edge.c:2893
int address_is_invalid_destination(const char *address, int client)
Definition: addressmap.c:1075
int connection_ap_handshake_send_resolve(entry_connection_t *ap_conn)
Definition: connection_edge.c:2803
uint16_t streamid_t
Definition: or.h:1032
int connection_edge_finished_connecting(edge_connection_t *conn)
Definition: connection_edge.c:562
void connection_ap_handshake_socks_reply(entry_connection_t *conn, char *reply, size_t replylen, int endreason)
Definition: connection_edge.c:3141
int connection_edge_update_circuit_isolation(const entry_connection_t *conn, origin_circuit_t *circ, int dry_run)
Definition: connection_edge.c:4070
void connection_exit_connect(edge_connection_t *conn)
Definition: connection_edge.c:3664
int connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
Definition: connection_edge.c:3402
int connection_ap_detach_retriable(entry_connection_t *conn, origin_circuit_t *circ, int reason)
Definition: connection_edge.c:1145
hostname_type_t
Definition: connection_edge.h:101
int connection_edge_compatible_with_circuit(const entry_connection_t *conn, const origin_circuit_t *circ)
Definition: connection_edge.c:4000
void circuit_discard_optional_exit_enclaves(extend_info_t *info)
Definition: connection_edge.c:1094
uint32_t circid_t
Definition: or.h:1030
int connection_ap_process_transparent(entry_connection_t *conn)
Definition: connection_edge.c:2367
STATIC int connected_cell_format_payload(uint8_t *payload_out, const tor_addr_t *addr, uint32_t ttl)
Definition: connection_edge.c:528
int connection_edge_is_rendezvous_stream(const edge_connection_t *conn)
Definition: connection_edge.c:3836
int connection_ap_can_use_exit(const entry_connection_t *conn, const node_t *exit)
Definition: connection_edge.c:3854
void connection_ap_mark_as_non_pending_circuit(entry_connection_t *entry_conn)
Definition: connection_edge.c:1026
int connection_exit_begin_resolve(cell_t *cell, or_circuit_t *circ)
Definition: connection_edge.c:3594
void connection_ap_attach_pending(int retry)
Definition: connection_edge.c:900
int connection_edge_finished_flushing(edge_connection_t *conn)
Definition: connection_edge.c:490
void connection_ap_about_to_close(entry_connection_t *edge_conn)
Definition: connection_edge.c:637
STATIC int connection_ap_process_http_connect(entry_connection_t *conn)
Definition: connection_edge.c:2479