summaryrefslogtreecommitdiff
path: root/src/or/control.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-10-18 13:36:53 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-18 13:36:53 -0400
commitf1bf9bf8198fcfaf078fdc12eb2ad5adf1901d29 (patch)
treef6847f99adba9f8caa216cf42ab6c3e54cf2af50 /src/or/control.h
parentf0daaf8d60be8bfcfaa99e3a878cd90967a84bb0 (diff)
downloadtor-f1bf9bf8198fcfaf078fdc12eb2ad5adf1901d29.tar.gz
tor-f1bf9bf8198fcfaf078fdc12eb2ad5adf1901d29.zip
Add __OwningControllerFD to allow controllers without controlports
This feature should help programs that want to launch and manage a Tor process, as well as programs that want to launch and manage a Tor instance in a separate thread. Right now, they have to open a controlport, and then connect to it, with attendant authentication issues. This feature allows them to just start with an authenticated connection. Bug 23900.
Diffstat (limited to 'src/or/control.h')
-rw-r--r--src/or/control.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/control.h b/src/or/control.h
index e957b593a6..7ec182cb78 100644
--- a/src/or/control.h
+++ b/src/or/control.h
@@ -27,6 +27,10 @@ void control_ports_write_to_file(void);
#define LOG_FN_CONN(conn, args) \
CONN_LOG_PROTECT(conn, log_fn args)
+#define CC_LOCAL_FD_IS_OWNER (1u<<0)
+#define CC_LOCAL_FD_IS_AUTHENTICATED (1u<<1)
+int control_connection_add_local_fd(tor_socket_t sock, unsigned flags);
+
int connection_control_finished_flushing(control_connection_t *conn);
int connection_control_reached_eof(control_connection_t *conn);
void connection_control_closed(control_connection_t *conn);