In routerlist_assert_ok(), check r2 before taking &(r2->cache_info)
[tor.git] / src / or / routerset.h
blob8261c7fb098b34f39ddc2be55d8f27b17cff34fe
1 /* Copyright (c) 2001-2004, Roger Dingledine.
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2013, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
6 /**
7 * \file routerlist.h
8 * \brief Header file for routerset.c
9 **/
11 #ifndef TOR_ROUTERSET_H
12 #define TOR_ROUTERSET_H
14 routerset_t *routerset_new(void);
15 void routerset_refresh_countries(routerset_t *rs);
16 int routerset_parse(routerset_t *target, const char *s,
17 const char *description);
18 void routerset_union(routerset_t *target, const routerset_t *source);
19 int routerset_is_list(const routerset_t *set);
20 int routerset_needs_geoip(const routerset_t *set);
21 int routerset_is_empty(const routerset_t *set);
22 int routerset_contains_router(const routerset_t *set, const routerinfo_t *ri,
23 country_t country);
24 int routerset_contains_routerstatus(const routerset_t *set,
25 const routerstatus_t *rs,
26 country_t country);
27 int routerset_contains_extendinfo(const routerset_t *set,
28 const extend_info_t *ei);
30 int routerset_contains_node(const routerset_t *set, const node_t *node);
31 void routerset_get_all_nodes(smartlist_t *out, const routerset_t *routerset,
32 const routerset_t *excludeset,
33 int running_only);
34 int routerset_add_unknown_ccs(routerset_t **setp, int only_if_some_cc_set);
35 void routerset_subtract_nodes(smartlist_t *out,
36 const routerset_t *routerset);
38 char *routerset_to_string(const routerset_t *routerset);
39 int routerset_equal(const routerset_t *old, const routerset_t *new);
40 void routerset_free(routerset_t *routerset);
42 #endif