connection_or.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 connection_or.h
  8. * \brief Header file for connection_or.c.
  9. **/
  10. #ifndef _TOR_CONNECTION_OR_H
  11. #define _TOR_CONNECTION_OR_H
  12. void connection_or_remove_from_identity_map(or_connection_t *conn);
  13. void connection_or_clear_identity_map(void);
  14. or_connection_t *connection_or_get_for_extend(const char *digest,
  15. const tor_addr_t *target_addr,
  16. const char **msg_out,
  17. int *launch_out);
  18. void connection_or_set_bad_connections(const char *digest, int force);
  19. int connection_or_reached_eof(or_connection_t *conn);
  20. int connection_or_process_inbuf(or_connection_t *conn);
  21. int connection_or_flushed_some(or_connection_t *conn);
  22. int connection_or_finished_flushing(or_connection_t *conn);
  23. int connection_or_finished_connecting(or_connection_t *conn);
  24. int connection_or_digest_is_known_relay(const char *id_digest);
  25. void connection_or_update_token_buckets(smartlist_t *conns,
  26. or_options_t *options);
  27. void connection_or_connect_failed(or_connection_t *conn,
  28. int reason, const char *msg);
  29. or_connection_t *connection_or_connect(const tor_addr_t *addr, uint16_t port,
  30. const char *id_digest);
  31. int connection_tls_start_handshake(or_connection_t *conn, int receiving);
  32. int connection_tls_continue_handshake(or_connection_t *conn);
  33. void or_handshake_state_free(or_handshake_state_t *state);
  34. int connection_or_set_state_open(or_connection_t *conn);
  35. void connection_or_write_cell_to_buf(const cell_t *cell,
  36. or_connection_t *conn);
  37. void connection_or_write_var_cell_to_buf(const var_cell_t *cell,
  38. or_connection_t *conn);
  39. int connection_or_send_destroy(circid_t circ_id, or_connection_t *conn,
  40. int reason);
  41. int connection_or_send_netinfo(or_connection_t *conn);
  42. int is_or_protocol_version_known(uint16_t version);
  43. void cell_pack(packed_cell_t *dest, const cell_t *src);
  44. void var_cell_pack_header(const var_cell_t *cell, char *hdr_out);
  45. var_cell_t *var_cell_new(uint16_t payload_len);
  46. void var_cell_free(var_cell_t *cell);
  47. #endif