Rename has_completed_circuit to can_complete_circuit
[tor/rransom.git] / src / or / main.h
blobef38dc9351d2a9ce14bc60639e6c140684f169b4
1 /* Copyright (c) 2001 Matej Pfajfar.
2 * Copyright (c) 2001-2004, Roger Dingledine.
3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4 * Copyright (c) 2007-2010, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 /**
8 * \file main.h
9 * \brief Header file for main.c.
10 **/
12 #ifndef _TOR_MAIN_H
13 #define _TOR_MAIN_H
15 extern int can_complete_circuit;
17 int connection_add(connection_t *conn);
18 int connection_remove(connection_t *conn);
19 void connection_unregister_events(connection_t *conn);
20 int connection_in_array(connection_t *conn);
21 void add_connection_to_closeable_list(connection_t *conn);
22 int connection_is_on_closeable_list(connection_t *conn);
24 smartlist_t *get_connection_array(void);
26 typedef enum watchable_events {
27 READ_EVENT=0x02,
28 WRITE_EVENT=0x04
29 } watchable_events_t;
30 void connection_watch_events(connection_t *conn, watchable_events_t events);
31 int connection_is_reading(connection_t *conn);
32 void connection_stop_reading(connection_t *conn);
33 void connection_start_reading(connection_t *conn);
35 int connection_is_writing(connection_t *conn);
36 void connection_stop_writing(connection_t *conn);
37 void connection_start_writing(connection_t *conn);
39 void connection_stop_reading_from_linked_conn(connection_t *conn);
41 void directory_all_unreachable(time_t now);
42 void directory_info_has_arrived(time_t now, int from_cache);
44 void ip_address_changed(int at_interface);
45 void dns_servers_relaunch_checks(void);
47 void control_signal_act(int the_signal);
48 void handle_signals(int is_parent);
50 int try_locking(or_options_t *options, int err_if_locked);
51 int have_lockfile(void);
52 void release_lockfile(void);
54 void tor_cleanup(void);
55 void tor_free_all(int postfork);
57 int tor_main(int argc, char *argv[]);
59 #ifdef MAIN_PRIVATE
60 int do_main_loop(void);
61 int do_list_fingerprint(void);
62 void do_hash_password(void);
63 int tor_init(int argc, char **argv);
64 #endif
66 #endif