summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-11-09 12:26:10 -0500
committerDavid Goulet <dgoulet@torproject.org>2017-11-20 11:02:30 -0500
commit5d180309ea907711a98da82f07a48646699d03b1 (patch)
tree03e31b822d79d77ec64f2fa8d786248512a7052f /src
parent49f21b6ba30a07369ff3282615465d0f3ad40e5b (diff)
downloadtor-5d180309ea907711a98da82f07a48646699d03b1.tar.gz
tor-5d180309ea907711a98da82f07a48646699d03b1.zip
hs: Rename rend_service_add_ephemeral_status_t
Move it to hs_common.h and rename it "hs_service_add_ephemeral_status_t". It will be shared between v2 and v3 services. Part of #20699 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src')
-rw-r--r--src/or/control.c4
-rw-r--r--src/or/hs_common.h11
-rw-r--r--src/or/rendservice.c4
-rw-r--r--src/or/rendservice.h11
4 files changed, 16 insertions, 14 deletions
diff --git a/src/or/control.c b/src/or/control.c
index ef1e0edcd8..19527acb3c 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4433,13 +4433,13 @@ handle_control_hspost(control_connection_t *conn,
* On success (RSAE_OKAY), the address_out points to a newly allocated string
* containing the onion address without the .onion part. On error, address_out
* is untouched. */
-static rend_service_add_ephemeral_status_t
+static hs_service_add_ephemeral_status_t
add_onion_helper_add_service(int hs_version, void *pk, smartlist_t *port_cfgs,
int max_streams, int max_streams_close_circuit,
int auth_type, smartlist_t *auth_clients,
char **address_out)
{
- rend_service_add_ephemeral_status_t ret;
+ hs_service_add_ephemeral_status_t ret;
tor_assert(pk);
tor_assert(port_cfgs);
diff --git a/src/or/hs_common.h b/src/or/hs_common.h
index c95e59a6f8..58fcd1b93c 100644
--- a/src/or/hs_common.h
+++ b/src/or/hs_common.h
@@ -130,6 +130,17 @@ typedef enum {
HS_AUTH_KEY_TYPE_ED25519 = 2,
} hs_auth_key_type_t;
+/* Return value when adding an ephemeral service through the ADD_ONION
+ * control port command. Both v2 and v3 share these. */
+typedef enum {
+ RSAE_BADAUTH = -5, /**< Invalid auth_type/auth_clients */
+ 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 */
+} hs_service_add_ephemeral_status_t;
+
/* Represents the mapping from a virtual port of a rendezvous service to a
* real port on some IP. */
typedef struct rend_service_port_config_t {
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 60234a5c1f..8eb5334908 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -847,9 +847,9 @@ rend_config_service(const config_line_t *line_,
* after calling this routine, and may assume that correct cleanup has
* been done on failure.
*
- * Return an appropriate rend_service_add_ephemeral_status_t.
+ * Return an appropriate hs_service_add_ephemeral_status_t.
*/
-rend_service_add_ephemeral_status_t
+hs_service_add_ephemeral_status_t
rend_service_add_ephemeral(crypto_pk_t *pk,
smartlist_t *ports,
int max_streams_per_circuit,
diff --git a/src/or/rendservice.h b/src/or/rendservice.h
index 5946e31861..15badce6ab 100644
--- a/src/or/rendservice.h
+++ b/src/or/rendservice.h
@@ -187,16 +187,7 @@ void rend_service_port_config_free(rend_service_port_config_t *p);
void rend_authorized_client_free(rend_authorized_client_t *client);
-/** Return value from rend_service_add_ephemeral. */
-typedef enum {
- RSAE_BADAUTH = -5, /**< Invalid auth_type/auth_clients */
- 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,
+hs_service_add_ephemeral_status_t rend_service_add_ephemeral(crypto_pk_t *pk,
smartlist_t *ports,
int max_streams_per_circuit,
int max_streams_close_circuit,