tor  master
Data Structures | Macros | Typedefs | Functions
hs_cache.h File Reference

Header file for hs_cache.c. More...

#include <stdint.h>
#include "crypto_ed25519.h"
#include "hs_common.h"
#include "hs_descriptor.h"
#include "rendcommon.h"
#include "torcert.h"
Include dependency graph for hs_cache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hs_cache_intro_state_t
 
struct  hs_cache_client_intro_state_t
 
struct  hs_cache_dir_descriptor_t
 

Macros

#define HS_CACHE_CLIENT_INTRO_STATE_MAX_AGE   (2 * 60)
 

Typedefs

typedef struct hs_cache_intro_state_t hs_cache_intro_state_t
 
typedef struct hs_cache_client_intro_state_t hs_cache_client_intro_state_t
 
typedef struct hs_cache_dir_descriptor_t hs_cache_dir_descriptor_t
 

Functions

void hs_cache_init (void)
 
void hs_cache_free_all (void)
 
void hs_cache_clean_as_dir (time_t now)
 
size_t hs_cache_handle_oom (time_t now, size_t min_remove_bytes)
 
unsigned int hs_cache_get_max_descriptor_size (void)
 
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)
 
const hs_descriptor_ths_cache_lookup_as_client (const ed25519_public_key_t *key)
 
const char * hs_cache_lookup_encoded_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)
 

Detailed Description

Header file for hs_cache.c.

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 .