circuituse.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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-2013, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file circuituse.h
  8. * \brief Header file for circuituse.c.
  9. **/
  10. #ifndef TOR_CIRCUITUSE_H
  11. #define TOR_CIRCUITUSE_H
  12. void circuit_expire_building(void);
  13. void circuit_remove_handled_ports(smartlist_t *needed_ports);
  14. int circuit_stream_is_being_handled(entry_connection_t *conn, uint16_t port,
  15. int min);
  16. #if 0
  17. int circuit_conforms_to_options(const origin_circuit_t *circ,
  18. const or_options_t *options);
  19. #endif
  20. void circuit_build_needed_circs(time_t now);
  21. void circuit_detach_stream(circuit_t *circ, edge_connection_t *conn);
  22. void circuit_expire_old_circuits_serverside(time_t now);
  23. void reset_bandwidth_test(void);
  24. int circuit_enough_testing_circs(void);
  25. void circuit_has_opened(origin_circuit_t *circ);
  26. void circuit_try_attaching_streams(origin_circuit_t *circ);
  27. void circuit_build_failed(origin_circuit_t *circ);
  28. /** Flag to set when a circuit should have only a single hop. */
  29. #define CIRCLAUNCH_ONEHOP_TUNNEL (1<<0)
  30. /** Flag to set when a circuit needs to be built of high-uptime nodes */
  31. #define CIRCLAUNCH_NEED_UPTIME (1<<1)
  32. /** Flag to set when a circuit needs to be built of high-capacity nodes */
  33. #define CIRCLAUNCH_NEED_CAPACITY (1<<2)
  34. /** Flag to set when the last hop of a circuit doesn't need to be an
  35. * exit node. */
  36. #define CIRCLAUNCH_IS_INTERNAL (1<<3)
  37. origin_circuit_t *circuit_launch_by_extend_info(uint8_t purpose,
  38. extend_info_t *info,
  39. int flags);
  40. origin_circuit_t *circuit_launch(uint8_t purpose, int flags);
  41. void circuit_reset_failure_count(int timeout);
  42. int connection_ap_handshake_attach_chosen_circuit(entry_connection_t *conn,
  43. origin_circuit_t *circ,
  44. crypt_path_t *cpath);
  45. int connection_ap_handshake_attach_circuit(entry_connection_t *conn);
  46. void circuit_change_purpose(circuit_t *circ, uint8_t new_purpose);
  47. int hostname_in_track_host_exits(const or_options_t *options,
  48. const char *address);
  49. void mark_circuit_unusable_for_new_conns(origin_circuit_t *circ);
  50. #endif