static void circuit_is_open(circuit_t *circ);
static void circuit_build_failed(circuit_t *circ);
static circuit_t *circuit_establish_circuit(uint8_t purpose, const char *exit_nickname);
+static void circuit_free(circuit_t *circ);
+static void circuit_free_cpath(crypt_path_t *cpath);
/********* START VARIABLES **********/
/** Deallocate space associated with circ.
*/
-void circuit_free(circuit_t *circ) {
+static void circuit_free(circuit_t *circ) {
tor_assert(circ);
tor_assert(circ->magic == CIRCUIT_MAGIC);
if (circ->n_crypto)
}
/** Deallocate space associated with the linked list <b>cpath</b>. */
-void circuit_free_cpath(crypt_path_t *cpath) {
+static void circuit_free_cpath(crypt_path_t *cpath) {
crypt_path_t *victim, *head=cpath;
if(!cpath)
static int connection_receiver_bucket_should_increase(connection_t *conn);
static int connection_finished_flushing(connection_t *conn);
static int connection_finished_connecting(connection_t *conn);
+static int connection_read_to_buf(connection_t *conn);
+static int connection_process_inbuf(connection_t *conn);
/**************************************************************/
*
* Return -1 if we want to break conn, else return 0.
*/
-int connection_read_to_buf(connection_t *conn) {
+static int connection_read_to_buf(connection_t *conn) {
int result;
int at_most;
* This function just passes conn to the connection-specific
* connection_*_process_inbuf() function.
*/
-int connection_process_inbuf(connection_t *conn) {
+static int connection_process_inbuf(connection_t *conn) {
tor_assert(conn);
* the last time we got a key rotation event. */
static time_t last_rotation_time=0;
-int cpuworker_main(void *data);
+static int cpuworker_main(void *data);
static int spawn_cpuworker(void);
static void spawn_enough_cpuworkers(void);
static void process_pending_task(connection_t *cpuworker);
* Onionskin challenge ONIONSKIN_REPLY_LEN
* Negotiated keys KEY_LEN*2+DIGEST_LEN*2
*/
-int cpuworker_main(void *data) {
+static int cpuworker_main(void *data) {
unsigned char question[ONIONSKIN_CHALLENGE_LEN];
unsigned char question_type;
int *fdarray = data;
static int assign_to_dnsworker(connection_t *exitconn);
static void dns_purge_resolve(struct cached_resolve *resolve);
static void dns_found_answer(char *address, uint32_t addr, char outcome);
-int dnsworker_main(void *data);
+static int dnsworker_main(void *data);
static int spawn_dnsworker(void);
static void spawn_enough_dnsworkers(void);
* The dnsworker runs indefinitely, until its connection is closed or an error
* occurs.
*/
-int dnsworker_main(void *data) {
+static int dnsworker_main(void *data) {
char address[MAX_ADDRESSLEN];
unsigned char address_len;
char answer[5];
extern char *circuit_state_to_string[];
circuit_t *circuit_new(uint16_t p_circ_id, connection_t *p_conn);
void circuit_close_all_marked(void);
-void circuit_free(circuit_t *circ);
void circuit_free_cpath(crypt_path_t *cpath);
int _circuit_mark_for_close(circuit_t *circ);
void connection_bucket_refill(struct timeval *now);
int connection_handle_read(connection_t *conn);
-int connection_read_to_buf(connection_t *conn);
int connection_fetch_from_buf(char *string, int len, connection_t *conn);
int connection_send_destroy(uint16_t circ_id, connection_t *conn);
-int connection_process_inbuf(connection_t *conn);
-
void assert_connection_ok(connection_t *conn, time_t now);
/********************************* connection_edge.c ***************************/
void cpuworkers_rotate(void);
int connection_cpu_finished_flushing(connection_t *conn);
int connection_cpu_process_inbuf(connection_t *conn);
-int cpuworker_main(void *data);
int assign_to_cpuworker(connection_t *cpuworker, unsigned char question_type,
void *task);
int rend_client_receive_rendezvous(circuit_t *circ, const char *request, int request_len);
void rend_client_desc_fetched(char *query, int success);
-int rend_cmp_service_ids(const char *one, const char *two);
char *rend_client_get_random_intro(char *query);
int rend_parse_rendezvous_address(char *address);
char **intro_points;
} rend_service_descriptor_t;
+int rend_cmp_service_ids(const char *one, const char *two);
+
void rend_process_relay_cell(circuit_t *circ, int command, int length,
const char *payload);
/** Send the establish-rendezvous cell along a rendezvous circuit. if
* it fails, mark the circ for close and return -1. else return 0.
*/
-int
+static int
rend_client_send_establish_rendezvous(circuit_t *circ)
{
tor_assert(circ->purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND);
}
}
-/** Return 0 if one and two are the same service ids, else -1 or 1 */
-int rend_cmp_service_ids(const char *one, const char *two) {
- return strcasecmp(one,two);
-}
-
/** strdup a nickname for a random introduction
* point of query. return NULL if error.
*/
#include "or.h"
+
+/** Return 0 if one and two are the same service ids, else -1 or 1 */
+int rend_cmp_service_ids(const char *one, const char *two) {
+ return strcasecmp(one,two);
+}
+
/** Free the storage held by the service descriptor <b>desc</b>.
*/
void rend_service_descriptor_free(rend_service_descriptor_t *desc)