summaryrefslogtreecommitdiff
path: root/src/or/hs_service.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-01-13 16:00:07 -0500
committerDavid Goulet <dgoulet@torproject.org>2017-07-13 16:49:44 -0400
commitc086a59ea1fe63e38b6f83fa0c2c19bf495e977d (patch)
tree8b1dc6f9b3b4e3ea9658a93eb0406f513a0ebe01 /src/or/hs_service.h
parent93774dcb5458115652e0be5cdfaf198967b8a31e (diff)
downloadtor-c086a59ea1fe63e38b6f83fa0c2c19bf495e977d.tar.gz
tor-c086a59ea1fe63e38b6f83fa0c2c19bf495e977d.zip
prop224: Configure v3 service from options
This commit adds the support in the HS subsystem for loading a service from a set of or_options_t and put them in a staging list. To achieve this, service accessors have been created and a global hash map containing service object indexed by master public key. However, this is not used for now. It's ground work for registration process. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_service.h')
-rw-r--r--src/or/hs_service.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/or/hs_service.h b/src/or/hs_service.h
index ec47cb72ae..8d92e75072 100644
--- a/src/or/hs_service.h
+++ b/src/or/hs_service.h
@@ -11,9 +11,10 @@
#include "crypto_curve25519.h"
#include "crypto_ed25519.h"
+#include "replaycache.h"
+
#include "hs_descriptor.h"
#include "hs_intropoint.h"
-#include "replaycache.h"
/* Trunnel */
#include "hs/cell_establish_intro.h"
@@ -171,6 +172,10 @@ typedef struct hs_service_t {
/* Protocol version of the service. Specified by HiddenServiceVersion. */
uint32_t version;
+ /* Hashtable node: use to look up the service by its master public identity
+ * key in the service global map. */
+ HT_ENTRY(hs_service_t) hs_service_node;
+
/* Service state which contains various flags and counters. */
hs_service_state_t state;
@@ -192,12 +197,16 @@ typedef struct hs_service_t {
/* API */
-int hs_service_config_all(const or_options_t *options, int validate_only);
+/* Global initializer and cleanup function. */
void hs_service_init(void);
void hs_service_free_all(void);
-void hs_service_free(hs_service_t *service);
+/* Service new/free functions. */
hs_service_t *hs_service_new(const or_options_t *options);
+void hs_service_free(hs_service_t *service);
+
+void hs_service_register_services(smartlist_t *new_service_list);
+void hs_service_stage_services(const smartlist_t *service_list);
/* These functions are only used by unit tests and we need to expose them else
* hs_service.o ends up with no symbols in libor.a which makes clang throw a