Tor 0.4.9.2-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 |
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.
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 | ||
) |
Definition at line 298 of file circuitbuild_relay.c.
int circuit_extend | ( | const relay_msg_t * | rmsg, |
struct circuit_t * | circ | ||
) |
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 424 of file circuitbuild_relay.c.
STATIC int circuit_extend_add_ed25519_helper | ( | struct extend_cell_t * | ec | ) |
Definition at line 93 of file circuitbuild_relay.c.
STATIC int circuit_extend_add_ipv4_helper | ( | struct extend_cell_t * | ec | ) |
Definition at line 129 of file circuitbuild_relay.c.
STATIC int circuit_extend_add_ipv6_helper | ( | struct extend_cell_t * | ec | ) |
Definition at line 152 of file circuitbuild_relay.c.
|
static |
Definition at line 183 of file circuitbuild_relay.c.
STATIC int circuit_extend_lspec_valid_helper | ( | const struct extend_cell_t * | ec, |
const struct circuit_t * | circ | ||
) |
Definition at line 224 of file circuitbuild_relay.c.
Definition at line 55 of file circuitbuild_relay.c.
STATIC void circuit_open_connection_for_extend | ( | const struct extend_cell_t * | ec, |
struct circuit_t * | circ, | ||
int | should_launch | ||
) |
Definition at line 350 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 536 of file circuitbuild_relay.c.