2010-07-23 20:04:12 +02:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2012-06-05 02:58:17 +02:00
|
|
|
* Copyright (c) 2007-2012, The Tor Project, Inc. */
|
2010-07-23 20:04:12 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file microdesc.h
|
|
|
|
* \brief Header file for microdesc.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _TOR_MICRODESC_H
|
|
|
|
#define _TOR_MICRODESC_H
|
|
|
|
|
|
|
|
microdesc_cache_t *get_microdesc_cache(void);
|
|
|
|
|
2011-09-28 20:13:49 +02:00
|
|
|
void microdesc_check_counts(void);
|
|
|
|
|
2010-07-23 20:04:12 +02:00
|
|
|
smartlist_t *microdescs_add_to_cache(microdesc_cache_t *cache,
|
|
|
|
const char *s, const char *eos, saved_location_t where,
|
2010-05-11 23:20:33 +02:00
|
|
|
int no_save, time_t listed_at,
|
|
|
|
smartlist_t *requested_digests256);
|
2010-07-23 20:04:12 +02:00
|
|
|
smartlist_t *microdescs_add_list_to_cache(microdesc_cache_t *cache,
|
|
|
|
smartlist_t *descriptors, saved_location_t where,
|
|
|
|
int no_save);
|
|
|
|
|
2010-10-07 21:28:54 +02:00
|
|
|
void microdesc_cache_clean(microdesc_cache_t *cache, time_t cutoff, int force);
|
2011-05-03 23:03:49 +02:00
|
|
|
int microdesc_cache_rebuild(microdesc_cache_t *cache, int force);
|
2010-07-23 20:04:12 +02:00
|
|
|
int microdesc_cache_reload(microdesc_cache_t *cache);
|
|
|
|
void microdesc_cache_clear(microdesc_cache_t *cache);
|
|
|
|
|
|
|
|
microdesc_t *microdesc_cache_lookup_by_digest256(microdesc_cache_t *cache,
|
|
|
|
const char *d);
|
|
|
|
|
|
|
|
size_t microdesc_average_size(microdesc_cache_t *cache);
|
|
|
|
|
2010-05-11 23:20:33 +02:00
|
|
|
smartlist_t *microdesc_list_missing_digest256(networkstatus_t *ns,
|
|
|
|
microdesc_cache_t *cache,
|
|
|
|
int downloadable_only,
|
|
|
|
digestmap_t *skip);
|
|
|
|
|
2010-07-23 20:04:12 +02:00
|
|
|
void microdesc_free(microdesc_t *md);
|
|
|
|
void microdesc_free_all(void);
|
|
|
|
|
2010-05-11 23:20:33 +02:00
|
|
|
void update_microdesc_downloads(time_t now);
|
2010-09-21 22:16:56 +02:00
|
|
|
void update_microdescs_from_networkstatus(time_t now);
|
2010-05-11 23:20:33 +02:00
|
|
|
|
2010-11-08 20:21:32 +01:00
|
|
|
int usable_consensus_flavor(void);
|
2011-06-14 19:01:38 +02:00
|
|
|
int we_fetch_microdescriptors(const or_options_t *options);
|
|
|
|
int we_fetch_router_descriptors(const or_options_t *options);
|
|
|
|
int we_use_microdescriptors_for_circuits(const or_options_t *options);
|
2010-11-08 20:21:32 +01:00
|
|
|
|
2010-07-23 20:04:12 +02:00
|
|
|
#endif
|
|
|
|
|