main.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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-2011, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file main.h
  8. * \brief Header file for main.c.
  9. **/
  10. #ifndef _TOR_MAIN_H
  11. #define _TOR_MAIN_H
  12. extern int can_complete_circuit;
  13. int connection_add(connection_t *conn);
  14. int connection_remove(connection_t *conn);
  15. void connection_unregister_events(connection_t *conn);
  16. int connection_in_array(connection_t *conn);
  17. void add_connection_to_closeable_list(connection_t *conn);
  18. int connection_is_on_closeable_list(connection_t *conn);
  19. smartlist_t *get_connection_array(void);
  20. typedef enum watchable_events {
  21. READ_EVENT=0x02,
  22. WRITE_EVENT=0x04
  23. } watchable_events_t;
  24. void connection_watch_events(connection_t *conn, watchable_events_t events);
  25. int connection_is_reading(connection_t *conn);
  26. void connection_stop_reading(connection_t *conn);
  27. void connection_start_reading(connection_t *conn);
  28. int connection_is_writing(connection_t *conn);
  29. void connection_stop_writing(connection_t *conn);
  30. void connection_start_writing(connection_t *conn);
  31. void connection_stop_reading_from_linked_conn(connection_t *conn);
  32. void directory_all_unreachable(time_t now);
  33. void directory_info_has_arrived(time_t now, int from_cache);
  34. void ip_address_changed(int at_interface);
  35. void dns_servers_relaunch_checks(void);
  36. void control_signal_act(int the_signal);
  37. void handle_signals(int is_parent);
  38. int try_locking(or_options_t *options, int err_if_locked);
  39. int have_lockfile(void);
  40. void release_lockfile(void);
  41. void tor_cleanup(void);
  42. void tor_free_all(int postfork);
  43. int tor_main(int argc, char *argv[]);
  44. #ifdef MAIN_PRIVATE
  45. int do_main_loop(void);
  46. int do_list_fingerprint(void);
  47. void do_hash_password(void);
  48. int tor_init(int argc, char **argv);
  49. #endif
  50. #endif