ext_orport.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #ifndef EXT_ORPORT_H
  7. #define EXT_ORPORT_H
  8. int connection_ext_or_start_auth(or_connection_t *or_conn);
  9. ext_or_cmd_t *ext_or_cmd_new(uint16_t len);
  10. void ext_or_cmd_free(ext_or_cmd_t *cmd);
  11. void connection_or_set_ext_or_identifier(or_connection_t *conn);
  12. void connection_or_remove_from_ext_or_id_map(or_connection_t *conn);
  13. void connection_or_clear_ext_or_id_map(void);
  14. or_connection_t *connection_or_get_by_ext_or_id(const char *id);
  15. int connection_ext_or_finished_flushing(or_connection_t *conn);
  16. int connection_ext_or_process_inbuf(or_connection_t *or_conn);
  17. int init_ext_or_cookie_authentication(int is_enabled);
  18. char *get_ext_or_auth_cookie_file_name(void);
  19. #ifdef EXT_ORPORT_PRIVATE
  20. STATIC int connection_write_ext_or_command(connection_t *conn,
  21. uint16_t command,
  22. const char *body,
  23. size_t bodylen);
  24. STATIC int handle_client_auth_nonce(const char *client_nonce,
  25. size_t client_nonce_len,
  26. char **client_hash_out,
  27. char **reply_out, size_t *reply_len_out);
  28. #ifdef TOR_UNIT_TESTS
  29. extern uint8_t *ext_or_auth_cookie;
  30. extern int ext_or_auth_cookie_is_set;
  31. #endif
  32. #endif
  33. #endif