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.
|
2013-01-16 07:54:56 +01:00
|
|
|
* Copyright (c) 2007-2013, 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.
|
|
|
|
**/
|
|
|
|
|
2012-10-12 18:13:10 +02:00
|
|
|
#ifndef TOR_MICRODESC_H
|
|
|
|
#define TOR_MICRODESC_H
|
2010-07-23 20:04:12 +02:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2013-03-13 15:42:58 +01:00
|
|
|
void microdesc_free_(microdesc_t *md, const char *fname, int line);
|
|
|
|
#define microdesc_free(md) \
|
|
|
|
microdesc_free_((md), __FILE__, __LINE__)
|
2010-07-23 20:04:12 +02:00
|
|
|
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
|
|
|
|
|