Back to index

tor  0.2.3.19-rc
microdesc.h
Go to the documentation of this file.
00001 /* Copyright (c) 2001 Matej Pfajfar.
00002  * Copyright (c) 2001-2004, Roger Dingledine.
00003  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
00004  * Copyright (c) 2007-2012, The Tor Project, Inc. */
00005 /* See LICENSE for licensing information */
00006 
00012 #ifndef _TOR_MICRODESC_H
00013 #define _TOR_MICRODESC_H
00014 
00015 microdesc_cache_t *get_microdesc_cache(void);
00016 
00017 void microdesc_check_counts(void);
00018 
00019 smartlist_t *microdescs_add_to_cache(microdesc_cache_t *cache,
00020                         const char *s, const char *eos, saved_location_t where,
00021                         int no_save, time_t listed_at,
00022                         smartlist_t *requested_digests256);
00023 smartlist_t *microdescs_add_list_to_cache(microdesc_cache_t *cache,
00024                         smartlist_t *descriptors, saved_location_t where,
00025                         int no_save);
00026 
00027 void microdesc_cache_clean(microdesc_cache_t *cache, time_t cutoff, int force);
00028 int microdesc_cache_rebuild(microdesc_cache_t *cache, int force);
00029 int microdesc_cache_reload(microdesc_cache_t *cache);
00030 void microdesc_cache_clear(microdesc_cache_t *cache);
00031 
00032 microdesc_t *microdesc_cache_lookup_by_digest256(microdesc_cache_t *cache,
00033                                                  const char *d);
00034 
00035 size_t microdesc_average_size(microdesc_cache_t *cache);
00036 
00037 smartlist_t *microdesc_list_missing_digest256(networkstatus_t *ns,
00038                                               microdesc_cache_t *cache,
00039                                               int downloadable_only,
00040                                               digestmap_t *skip);
00041 
00042 void microdesc_free(microdesc_t *md);
00043 void microdesc_free_all(void);
00044 
00045 void update_microdesc_downloads(time_t now);
00046 void update_microdescs_from_networkstatus(time_t now);
00047 
00048 int usable_consensus_flavor(void);
00049 int we_fetch_microdescriptors(const or_options_t *options);
00050 int we_fetch_router_descriptors(const or_options_t *options);
00051 int we_use_microdescriptors_for_circuits(const or_options_t *options);
00052 
00053 #endif
00054