aboutsummaryrefslogtreecommitdiff
path: root/src/feature/control/control_cmd.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-03-25 14:03:49 -0400
committerNick Mathewson <nickm@torproject.org>2019-03-25 14:06:56 -0400
commit2917ecaa970c8fabcc0e9875b1e87c0d279ab1b3 (patch)
tree48f58753adae02b1e1c8957b48d5c143e87377a5 /src/feature/control/control_cmd.h
parent4754e9058b7521967dd92092e54483cec456bb2f (diff)
downloadtor-2917ecaa970c8fabcc0e9875b1e87c0d279ab1b3.tar.gz
tor-2917ecaa970c8fabcc0e9875b1e87c0d279ab1b3.zip
Split command-handling and authentication from control.c
Diffstat (limited to 'src/feature/control/control_cmd.h')
-rw-r--r--src/feature/control/control_cmd.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/feature/control/control_cmd.h b/src/feature/control/control_cmd.h
new file mode 100644
index 0000000000..a417e10da3
--- /dev/null
+++ b/src/feature/control/control_cmd.h
@@ -0,0 +1,48 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2019, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file control_cmd.h
+ * \brief Header file for control_cmd.c.
+ **/
+
+#ifndef TOR_CONTROL_CMD_H
+#define TOR_CONTROL_CMD_H
+
+int handle_control_command(control_connection_t *conn,
+ uint32_t cmd_data_len,
+ char *args);
+void control_cmd_free_all(void);
+
+#ifdef CONTROL_CMD_PRIVATE
+#include "lib/crypt_ops/crypto_ed25519.h"
+
+/* ADD_ONION secret key to create an ephemeral service. The command supports
+ * multiple versions so this union stores the key and passes it to the HS
+ * subsystem depending on the requested version. */
+typedef union add_onion_secret_key_t {
+ /* Hidden service v2 secret key. */
+ crypto_pk_t *v2;
+ /* Hidden service v3 secret key. */
+ ed25519_secret_key_t *v3;
+} add_onion_secret_key_t;
+
+STATIC int add_onion_helper_keyarg(const char *arg, int discard_pk,
+ const char **key_new_alg_out,
+ char **key_new_blob_out,
+ add_onion_secret_key_t *decoded_key,
+ int *hs_version, char **err_msg_out);
+
+STATIC rend_authorized_client_t *add_onion_helper_clientauth(const char *arg,
+ int *created, char **err_msg_out);
+
+#endif /* defined(CONTROL_CMD_PRIVATE) */
+
+#ifdef CONTROL_MODULE_PRIVATE
+smartlist_t * get_detached_onion_services(void);
+#endif /* defined(CONTROL_MODULE_PRIVATE) */
+
+#endif /* !defined(TOR_CONTROL_CMD_H) */