summaryrefslogtreecommitdiff
path: root/src/or/rendservice.h
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2015-04-25 08:23:15 +0000
committerNick Mathewson <nickm@torproject.org>2015-04-28 10:19:08 -0400
commit915c7438a77edfaf3103b69cb494a4f069a79a0c (patch)
tree1aec80453d2aa691de928349d233a85374b4305c /src/or/rendservice.h
parent63a90f2df4dcd7fff862ca3849f3aa3b1dec7e84 (diff)
downloadtor-915c7438a77edfaf3103b69cb494a4f069a79a0c.tar.gz
tor-915c7438a77edfaf3103b69cb494a4f069a79a0c.zip
Add "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.
These commands allow for the creation and management of ephemeral Onion ("Hidden") services that are either bound to the lifetime of the originating control connection, or optionally the lifetime of the tor instance. Implements #6411.
Diffstat (limited to 'src/or/rendservice.h')
-rw-r--r--src/or/rendservice.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/or/rendservice.h b/src/or/rendservice.h
index 754f7c358c..6d0973b06c 100644
--- a/src/or/rendservice.h
+++ b/src/or/rendservice.h
@@ -15,6 +15,7 @@
#include "or.h"
typedef struct rend_intro_cell_s rend_intro_cell_t;
+typedef struct rend_service_port_config_s rend_service_port_config_t;
#ifdef RENDSERVICE_PRIVATE
@@ -101,5 +102,23 @@ int rend_service_set_connection_addr_port(edge_connection_t *conn,
void rend_service_dump_stats(int severity);
void rend_service_free_all(void);
+rend_service_port_config_t *rend_service_parse_port_config(const char *string,
+ const char *sep,
+ char **err_msg_out);
+void rend_service_port_config_free(rend_service_port_config_t *p);
+
+/** Return value from rend_service_add_ephemeral. */
+typedef enum {
+ RSAE_BADVIRTPORT = -4, /**< Invalid VIRTPORT/TARGET(s) */
+ RSAE_ADDREXISTS = -3, /**< Onion address collision */
+ RSAE_BADPRIVKEY = -2, /**< Invalid public key */
+ RSAE_INTERNAL = -1, /**< Internal error */
+ RSAE_OKAY = 0 /**< Service added as expected */
+} rend_service_add_ephemeral_status_t;
+rend_service_add_ephemeral_status_t rend_service_add_ephemeral(crypto_pk_t *pk,
+ smartlist_t *ports,
+ char **service_id_out);
+int rend_service_del_ephemeral(const char *service_id);
+
#endif