Create connection_or.h

This commit is contained in:
Sebastian Hahn 2010-07-22 10:50:34 +02:00
parent 78b6a4650b
commit 0d33120c26
12 changed files with 69 additions and 45 deletions

View File

@ -15,6 +15,7 @@
#include "buffers.h"
#include "config.h"
#include "connection_edge.h"
#include "connection_or.h"
#include "../common/util.h"
#include "../common/torlog.h"
#ifdef HAVE_UNISTD_H

View File

@ -18,6 +18,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
#include "router.h"
#include "routerlist.h"
#include "crypto.h"

View File

@ -16,6 +16,7 @@
#include "connection.h"
#include "config.h"
#include "connection_edge.h"
#include "connection_or.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "routerlist.h"

View File

@ -20,6 +20,7 @@
#include "circuitlist.h"
#include "command.h"
#include "connection.h"
#include "connection_or.h"
#include "config.h"
#include "router.h"
#include "routerlist.h"

View File

@ -18,6 +18,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
#include "dnsserv.h"
#include "geoip.h"
#include "rendclient.h"

View File

@ -16,6 +16,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
#include "dnsserv.h"
#include "rendclient.h"
#include "rendcommon.h"

View File

@ -16,6 +16,7 @@
#include "command.h"
#include "config.h"
#include "connection.h"
#include "connection_or.h"
#include "geoip.h"
#include "router.h"
#include "routerlist.h"

59
src/or/connection_or.h Normal file
View File

@ -0,0 +1,59 @@
/* Copyright (c) 2001 Matej Pfajfar.
* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2010, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
* \file connection_or.h
* \brief Header file for connection_or.c.
**/
#ifndef _TOR_CONNECTION_OR_H
#define _TOR_CONNECTION_OR_H
void connection_or_remove_from_identity_map(or_connection_t *conn);
void connection_or_clear_identity_map(void);
or_connection_t *connection_or_get_for_extend(const char *digest,
const tor_addr_t *target_addr,
const char **msg_out,
int *launch_out);
void connection_or_set_bad_connections(void);
int connection_or_reached_eof(or_connection_t *conn);
int connection_or_process_inbuf(or_connection_t *conn);
int connection_or_flushed_some(or_connection_t *conn);
int connection_or_finished_flushing(or_connection_t *conn);
int connection_or_finished_connecting(or_connection_t *conn);
int connection_or_digest_is_known_relay(const char *id_digest);
void connection_or_connect_failed(or_connection_t *conn,
int reason, const char *msg);
or_connection_t *connection_or_connect(const tor_addr_t *addr, uint16_t port,
const char *id_digest);
int connection_tls_start_handshake(or_connection_t *conn, int receiving);
int connection_tls_continue_handshake(or_connection_t *conn);
void or_handshake_state_free(or_handshake_state_t *state);
int connection_or_set_state_open(or_connection_t *conn);
void connection_or_write_cell_to_buf(const cell_t *cell,
or_connection_t *conn);
void connection_or_write_var_cell_to_buf(const var_cell_t *cell,
or_connection_t *conn);
int connection_or_send_destroy(circid_t circ_id, or_connection_t *conn,
int reason);
int connection_or_send_netinfo(or_connection_t *conn);
int connection_or_send_cert(or_connection_t *conn);
int connection_or_send_link_auth(or_connection_t *conn);
int connection_or_compute_link_auth_hmac(or_connection_t *conn,
char *hmac_out);
int is_or_protocol_version_known(uint16_t version);
void cell_pack(packed_cell_t *dest, const cell_t *src);
void var_cell_pack_header(const var_cell_t *cell, char *hdr_out);
var_cell_t *var_cell_new(uint16_t payload_len);
void var_cell_free(var_cell_t *cell);
#endif

View File

@ -8,6 +8,7 @@
#include "buffers.h"
#include "config.h"
#include "connection.h"
#include "connection_or.h"
#include "router.h"
#include "routerlist.h"

View File

@ -20,6 +20,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
#include "dnsserv.h"
#include "geoip.h"
#include "rendclient.h"

View File

@ -3083,51 +3083,6 @@ typedef enum {
ADDRMAPSRC_DNS,
} addressmap_entry_source_t;
/********************************* connection_or.c ***************************/
void connection_or_remove_from_identity_map(or_connection_t *conn);
void connection_or_clear_identity_map(void);
or_connection_t *connection_or_get_for_extend(const char *digest,
const tor_addr_t *target_addr,
const char **msg_out,
int *launch_out);
void connection_or_set_bad_connections(void);
int connection_or_reached_eof(or_connection_t *conn);
int connection_or_process_inbuf(or_connection_t *conn);
int connection_or_flushed_some(or_connection_t *conn);
int connection_or_finished_flushing(or_connection_t *conn);
int connection_or_finished_connecting(or_connection_t *conn);
int connection_or_digest_is_known_relay(const char *id_digest);
void connection_or_connect_failed(or_connection_t *conn,
int reason, const char *msg);
or_connection_t *connection_or_connect(const tor_addr_t *addr, uint16_t port,
const char *id_digest);
int connection_tls_start_handshake(or_connection_t *conn, int receiving);
int connection_tls_continue_handshake(or_connection_t *conn);
void or_handshake_state_free(or_handshake_state_t *state);
int connection_or_set_state_open(or_connection_t *conn);
void connection_or_write_cell_to_buf(const cell_t *cell,
or_connection_t *conn);
void connection_or_write_var_cell_to_buf(const var_cell_t *cell,
or_connection_t *conn);
int connection_or_send_destroy(circid_t circ_id, or_connection_t *conn,
int reason);
int connection_or_send_netinfo(or_connection_t *conn);
int connection_or_send_cert(or_connection_t *conn);
int connection_or_send_link_auth(or_connection_t *conn);
int connection_or_compute_link_auth_hmac(or_connection_t *conn,
char *hmac_out);
int is_or_protocol_version_known(uint16_t version);
void cell_pack(packed_cell_t *dest, const cell_t *src);
void var_cell_pack_header(const var_cell_t *cell, char *hdr_out);
var_cell_t *var_cell_new(uint16_t payload_len);
void var_cell_free(var_cell_t *cell);
/********************************* control.c ***************************/
/** Used to indicate the type of a circuit event passed to the controller.

View File

@ -18,6 +18,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
#include "geoip.h"
#include "mempool.h"
#include "rendcommon.h"