aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_service.h
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-09-15 16:33:31 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2018-09-15 16:52:36 +0300
commit9b511dc5d6a9e44bd8c8c644ad9445cab7cdafe2 (patch)
tree9bfd824f5f790295477178ebe45232213ce042d2 /src/feature/hs/hs_service.h
parent8f085841ef40f00bbc2bb146a2d555aba527738f (diff)
downloadtor-9b511dc5d6a9e44bd8c8c644ad9445cab7cdafe2.tar.gz
tor-9b511dc5d6a9e44bd8c8c644ad9445cab7cdafe2.zip
Change HiddenServiceExportCircuitID to take a string parameter: the protocol.
This patch changes HiddenServiceExportCircuitID so instead of being a boolean it takes a string, which is the protocol. Currently only the 'haproxy' protocol is defined. See: https://bugs.torproject.org/4700
Diffstat (limited to 'src/feature/hs/hs_service.h')
-rw-r--r--src/feature/hs/hs_service.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/feature/hs/hs_service.h b/src/feature/hs/hs_service.h
index e541cb28b9..6fb15b9d37 100644
--- a/src/feature/hs/hs_service.h
+++ b/src/feature/hs/hs_service.h
@@ -161,6 +161,15 @@ typedef struct hs_service_authorized_client_t {
curve25519_public_key_t client_pk;
} hs_service_authorized_client_t;
+/** Which protocol to use for exporting HS client circuit ID. */
+typedef enum {
+ /** Don't expose the circuit id. */
+ HS_CIRCUIT_ID_PROTOCOL_NONE,
+
+ /** Use the HAProxy proxy protocol. */
+ HS_CIRCUIT_ID_PROTOCOL_HAPROXY
+} hs_circuit_id_protocol_t;
+
/* Service configuration. The following are set from the torrc options either
* set by the configuration file or by the control port. Nothing else should
* change those values. */
@@ -212,7 +221,7 @@ typedef struct hs_service_config_t {
unsigned int is_ephemeral : 1;
/* Does this service export the circuit ID of its clients? */
- bool export_circuit_id;
+ hs_circuit_id_protocol_t circuit_id_protocol;
} hs_service_config_t;
/* Service state. */
@@ -319,7 +328,8 @@ void hs_service_upload_desc_to_dir(const char *encoded_desc,
const ed25519_public_key_t *blinded_pk,
const routerstatus_t *hsdir_rs);
-bool hs_service_exports_circuit_id(const ed25519_public_key_t *pk);
+hs_circuit_id_protocol_t
+hs_service_exports_circuit_id(const ed25519_public_key_t *pk);
#ifdef HS_SERVICE_PRIVATE