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 */
9 * \brief Header file for main.c.
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
{
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
[]);
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
);