Tor
0.4.7.0-alpha-dev
|
Implements the details of exteding circuits (by relaying extend cells as create cells, and answering create cells). More...
#include "orconfig.h"
#include "feature/relay/circuitbuild_relay.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "core/or/or.h"
#include "app/config/config.h"
#include "core/crypto/relay_crypto.h"
#include "core/or/cell_st.h"
#include "core/or/circuit_st.h"
#include "core/or/extend_info_st.h"
#include "core/or/or_circuit_st.h"
#include "core/or/channel.h"
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/extendinfo.h"
#include "core/or/onion.h"
#include "core/or/relay.h"
#include "feature/nodelist/nodelist.h"
#include "feature/relay/router.h"
#include "feature/relay/routermode.h"
#include "feature/relay/selftest.h"
Go to the source code of this file.
Macros | |
#define | IPV6_CONNECTION_ONE_IN_N 2 |
Functions | |
STATIC int | circuit_extend_state_valid_helper (const struct circuit_t *circ) |
STATIC int | circuit_extend_add_ed25519_helper (struct extend_cell_t *ec) |
STATIC int | circuit_extend_add_ipv4_helper (struct extend_cell_t *ec) |
STATIC int | circuit_extend_add_ipv6_helper (struct extend_cell_t *ec) |
static bool | circuit_extend_addr_port_is_valid (const struct tor_addr_port_t *ap, bool log_zero_addrs, bool log_internal_addrs, int log_level) |
STATIC int | circuit_extend_lspec_valid_helper (const struct extend_cell_t *ec, const struct circuit_t *circ) |
STATIC const tor_addr_port_t * | circuit_choose_ip_ap_for_extend (const tor_addr_port_t *ipv4_ap, const tor_addr_port_t *ipv6_ap) |
STATIC void | circuit_open_connection_for_extend (const struct extend_cell_t *ec, struct circuit_t *circ, int should_launch) |
int | circuit_extend (struct cell_t *cell, struct circuit_t *circ) |
int | onionskin_answer (struct or_circuit_t *circ, const created_cell_t *created_cell, const char *keys, size_t keys_len, const uint8_t *rend_circ_nonce) |
Implements the details of exteding circuits (by relaying extend cells as create cells, and answering create cells).
On the server side, this module handles the logic of responding to RELAY_EXTEND requests, using circuit_extend() and onionskin_answer().
The shared client and server code is in core/or/circuitbuild.c.
Definition in file circuitbuild_relay.c.
Take the 'extend' cell, pull out addr/port plus the onion skin and identity digest for the next hop. If we're already connected, pass the onion skin to the next hop using a create cell; otherwise launch a new OR connection, and circ will notice when the connection succeeds or fails.
Return -1 if we want to warn and tear down the circuit, else return 0.
Definition at line 423 of file circuitbuild_relay.c.
int onionskin_answer | ( | struct or_circuit_t * | circ, |
const created_cell_t * | created_cell, | ||
const char * | keys, | ||
size_t | keys_len, | ||
const uint8_t * | rend_circ_nonce | ||
) |
On a relay, accept a create cell, initialise a circuit, and send a created cell back.
Given:
If we haven't found our ORPorts reachable yet, and the channel meets the necessary conditions, mark the relevant ORPorts as reachable.
Returns -1 if cell or circuit initialisation fails.
Definition at line 534 of file circuitbuild_relay.c.