tor  master
Macros | Functions
hs_cache.c File Reference

Handle hidden service descriptor caches. More...

#include "or.h"
#include "config.h"
#include "crypto_util.h"
#include "hs_ident.h"
#include "hs_common.h"
#include "hs_client.h"
#include "hs_descriptor.h"
#include "networkstatus.h"
#include "rendcache.h"
#include "hs_cache.h"
Include dependency graph for hs_cache.c:

Macros

#define HS_CACHE_PRIVATE
 
#define cache_dir_desc_free(val)   FREE_AND_NULL(hs_cache_dir_descriptor_t, cache_dir_desc_free_, (val))
 
#define cache_client_desc_free(val)   FREE_AND_NULL(hs_cache_client_descriptor_t, cache_client_desc_free_, (val))
 
#define cache_intro_state_free(val)   FREE_AND_NULL(hs_cache_intro_state_t, cache_intro_state_free_, (val))
 
#define cache_client_intro_state_free(val)
 

Functions

STATIC size_t cache_clean_v3_as_dir (time_t now, time_t global_cutoff)
 
int hs_cache_store_as_dir (const char *desc)
 
int hs_cache_lookup_as_dir (uint32_t version, const char *query, const char **desc_out)
 
void hs_cache_clean_as_dir (time_t now)
 
STATIC hs_cache_client_descriptor_t * lookup_v3_desc_as_client (const uint8_t *key)
 
const char * hs_cache_lookup_encoded_as_client (const ed25519_public_key_t *key)
 
const hs_descriptor_ths_cache_lookup_as_client (const ed25519_public_key_t *key)
 
int hs_cache_store_as_client (const char *desc_str, const ed25519_public_key_t *identity_pk)
 
void hs_cache_clean_as_client (time_t now)
 
void hs_cache_purge_as_client (void)
 
void hs_cache_client_intro_state_note (const ed25519_public_key_t *service_pk, const ed25519_public_key_t *auth_key, rend_intro_point_failure_t failure)
 
const hs_cache_intro_state_ths_cache_client_intro_state_find (const ed25519_public_key_t *service_pk, const ed25519_public_key_t *auth_key)
 
void hs_cache_client_intro_state_clean (time_t now)
 
void hs_cache_client_intro_state_purge (void)
 
size_t hs_cache_handle_oom (time_t now, size_t min_remove_bytes)
 
unsigned int hs_cache_get_max_descriptor_size (void)
 
void hs_cache_init (void)
 
void hs_cache_free_all (void)
 

Detailed Description

Handle hidden service descriptor caches.

Macro Definition Documentation

◆ cache_client_intro_state_free

#define cache_client_intro_state_free (   val)
Value:
cache_client_intro_state_free_, (val))
Definition: hs_cache.h:39

Function Documentation

◆ hs_cache_lookup_as_client()

const hs_descriptor_t* hs_cache_lookup_as_client ( const ed25519_public_key_t key)

Public API: Given the HS ed25519 identity public key in key, return its HS descriptor if it's stored in our cache, or NULL if not.

◆ hs_cache_lookup_encoded_as_client()

const char* hs_cache_lookup_encoded_as_client ( const ed25519_public_key_t key)

Public API: Given the HS ed25519 identity public key in key, return its HS encoded descriptor if it's stored in our cache, or NULL if not.

◆ hs_cache_store_as_client()

int hs_cache_store_as_client ( const char *  desc_str,
const ed25519_public_key_t identity_pk 
)

Public API: Given an encoded descriptor, store it in the client HS cache. Return -1 on error, 0 on success .