diff options
author | David Goulet <dgoulet@torproject.org> | 2017-05-05 14:55:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-08 20:29:34 -0400 |
commit | b547c5423930a430f70505a12d587735a7c83e1c (patch) | |
tree | 009b3e8fd6a2cb40d9950bfd83ceef7afce4ada9 /src/or/hs_service.h | |
parent | 559ffd71798765970205d0559c9f5a06dc55cf37 (diff) | |
download | tor-b547c5423930a430f70505a12d587735a7c83e1c.tar.gz tor-b547c5423930a430f70505a12d587735a7c83e1c.zip |
test: Add unit test coverage of hs_service.c
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_service.h')
-rw-r--r-- | src/or/hs_service.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/or/hs_service.h b/src/or/hs_service.h index fda2ebfc33..dc80622e33 100644 --- a/src/or/hs_service.h +++ b/src/or/hs_service.h @@ -15,6 +15,7 @@ #include "hs_common.h" #include "hs_descriptor.h" +#include "hs_ident.h" #include "hs_intropoint.h" /* Trunnel */ @@ -284,10 +285,42 @@ STATIC hs_service_t *find_service(hs_service_ht *map, const ed25519_public_key_t *pk); STATIC void remove_service(hs_service_ht *map, hs_service_t *service); STATIC int register_service(hs_service_ht *map, hs_service_t *service); +/* Service introduction point functions. */ STATIC hs_service_intro_point_t *service_intro_point_new( const extend_info_t *ei, unsigned int is_legacy); STATIC void service_intro_point_free(hs_service_intro_point_t *ip); +STATIC void service_intro_point_add(digest256map_t *map, + hs_service_intro_point_t *ip); +STATIC void service_intro_point_remove(const hs_service_t *service, + const hs_service_intro_point_t *ip); +STATIC hs_service_intro_point_t *service_intro_point_find( + const hs_service_t *service, + const ed25519_public_key_t *auth_key); +STATIC hs_service_intro_point_t *service_intro_point_find_by_ident( + const hs_service_t *service, + const hs_ident_circuit_t *ident); +/* Service descriptor functions. */ +STATIC hs_service_descriptor_t *service_descriptor_new(void); +STATIC hs_service_descriptor_t *service_desc_find_by_intro( + const hs_service_t *service, + const hs_service_intro_point_t *ip); +/* Helper functions. */ +STATIC void get_objects_from_ident(const hs_ident_circuit_t *ident, + hs_service_t **service, + hs_service_intro_point_t **ip, + hs_service_descriptor_t **desc); +STATIC const node_t *get_node_from_intro_point( + const hs_service_intro_point_t *ip); +STATIC int can_service_launch_intro_circuit(hs_service_t *service, + time_t now); +STATIC int intro_point_should_expire(const hs_service_intro_point_t *ip, + time_t now); +STATIC void run_housekeeping_event(time_t now); +STATIC void rotate_all_descriptors(time_t now); +STATIC void build_all_descriptors(time_t now); +STATIC void update_all_descriptors(time_t now); +STATIC void run_upload_descriptor_event(time_t now); #endif /* TOR_UNIT_TESTS */ |