Merge remote-tracking branch 'public/bug23985_029' into maint-0.2.9
[tor.git] / src / or / ext_orport.h
blob33d954e8d0b72ce7ede7f37f37e5b2e006112c0d
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-2016, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 #ifndef EXT_ORPORT_H
8 #define EXT_ORPORT_H
10 int connection_ext_or_start_auth(or_connection_t *or_conn);
12 ext_or_cmd_t *ext_or_cmd_new(uint16_t len);
13 void ext_or_cmd_free(ext_or_cmd_t *cmd);
14 void connection_or_set_ext_or_identifier(or_connection_t *conn);
15 void connection_or_remove_from_ext_or_id_map(or_connection_t *conn);
16 void connection_or_clear_ext_or_id_map(void);
17 or_connection_t *connection_or_get_by_ext_or_id(const char *id);
19 int connection_ext_or_finished_flushing(or_connection_t *conn);
20 int connection_ext_or_process_inbuf(or_connection_t *or_conn);
22 int init_ext_or_cookie_authentication(int is_enabled);
23 char *get_ext_or_auth_cookie_file_name(void);
24 void ext_orport_free_all(void);
26 #ifdef EXT_ORPORT_PRIVATE
27 STATIC int connection_write_ext_or_command(connection_t *conn,
28 uint16_t command,
29 const char *body,
30 size_t bodylen);
31 STATIC int handle_client_auth_nonce(const char *client_nonce,
32 size_t client_nonce_len,
33 char **client_hash_out,
34 char **reply_out, size_t *reply_len_out);
35 #ifdef TOR_UNIT_TESTS
36 extern uint8_t *ext_or_auth_cookie;
37 extern int ext_or_auth_cookie_is_set;
38 #endif
39 #endif
41 #endif