circuituse.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 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(time_t now);
  13. void circuit_remove_handled_ports(smartlist_t *needed_ports);
  14. int circuit_stream_is_being_handled(edge_connection_t *conn, uint16_t port,
  15. int min);
  16. int circuit_conforms_to_options(const origin_circuit_t *circ,
  17. const or_options_t *options);
  18. void circuit_build_needed_circs(time_t now);
  19. void circuit_detach_stream(circuit_t *circ, edge_connection_t *conn);
  20. void circuit_expire_old_circuits_serverside(time_t now);
  21. void reset_bandwidth_test(void);
  22. int circuit_enough_testing_circs(void);
  23. void circuit_has_opened(origin_circuit_t *circ);
  24. void circuit_build_failed(origin_circuit_t *circ);
  25. /** Flag to set when a circuit should have only a single hop. */
  26. #define CIRCLAUNCH_ONEHOP_TUNNEL (1<<0)
  27. /** Flag to set when a circuit needs to be built of high-uptime nodes */
  28. #define CIRCLAUNCH_NEED_UPTIME (1<<1)
  29. /** Flag to set when a circuit needs to be built of high-capacity nodes */
  30. #define CIRCLAUNCH_NEED_CAPACITY (1<<2)
  31. /** Flag to set when the last hop of a circuit doesn't need to be an
  32. * exit node. */
  33. #define CIRCLAUNCH_IS_INTERNAL (1<<3)
  34. origin_circuit_t *circuit_launch_by_extend_info(uint8_t purpose,
  35. extend_info_t *info,
  36. int flags);
  37. origin_circuit_t *circuit_launch_by_router(uint8_t purpose,
  38. routerinfo_t *exit, int flags);
  39. void circuit_reset_failure_count(int timeout);
  40. int connection_ap_handshake_attach_chosen_circuit(edge_connection_t *conn,
  41. origin_circuit_t *circ,
  42. crypt_path_t *cpath);
  43. int connection_ap_handshake_attach_circuit(edge_connection_t *conn);
  44. #endif