1 /* Copyright (c) 2001 Matej Pfajfar.
2 * Copyright (c) 2001-2004, Roger Dingledine.
3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4 * Copyright (c) 2007-2013, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
9 * \brief Header file for microdesc.c.
12 #ifndef TOR_MICRODESC_H
13 #define TOR_MICRODESC_H
15 microdesc_cache_t
*get_microdesc_cache(void);
17 void microdesc_check_counts(void);
19 smartlist_t
*microdescs_add_to_cache(microdesc_cache_t
*cache
,
20 const char *s
, const char *eos
, saved_location_t where
,
21 int no_save
, time_t listed_at
,
22 smartlist_t
*requested_digests256
);
23 smartlist_t
*microdescs_add_list_to_cache(microdesc_cache_t
*cache
,
24 smartlist_t
*descriptors
, saved_location_t where
,
27 void microdesc_cache_clean(microdesc_cache_t
*cache
, time_t cutoff
, int force
);
28 int microdesc_cache_rebuild(microdesc_cache_t
*cache
, int force
);
29 int microdesc_cache_reload(microdesc_cache_t
*cache
);
30 void microdesc_cache_clear(microdesc_cache_t
*cache
);
32 microdesc_t
*microdesc_cache_lookup_by_digest256(microdesc_cache_t
*cache
,
35 size_t microdesc_average_size(microdesc_cache_t
*cache
);
37 smartlist_t
*microdesc_list_missing_digest256(networkstatus_t
*ns
,
38 microdesc_cache_t
*cache
,
39 int downloadable_only
,
42 void microdesc_free_(microdesc_t
*md
, const char *fname
, int line
);
43 #define microdesc_free(md) \
44 microdesc_free_((md), __FILE__, __LINE__)
45 void microdesc_free_all(void);
47 void update_microdesc_downloads(time_t now
);
48 void update_microdescs_from_networkstatus(time_t now
);
50 int usable_consensus_flavor(void);
51 int we_fetch_microdescriptors(const or_options_t
*options
);
52 int we_fetch_router_descriptors(const or_options_t
*options
);
53 int we_use_microdescriptors_for_circuits(const or_options_t
*options
);