ext_orport.h 1.7 KB

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