routerset.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 */
  5. /**
  6. * \file routerlist.h
  7. * \brief Header file for routerset.c
  8. **/
  9. #ifndef TOR_ROUTERSET_H
  10. #define TOR_ROUTERSET_H
  11. routerset_t *routerset_new(void);
  12. void routerset_refresh_countries(routerset_t *rs);
  13. int routerset_parse(routerset_t *target, const char *s,
  14. const char *description);
  15. void routerset_union(routerset_t *target, const routerset_t *source);
  16. int routerset_is_list(const routerset_t *set);
  17. int routerset_needs_geoip(const routerset_t *set);
  18. int routerset_is_empty(const routerset_t *set);
  19. int routerset_contains_router(const routerset_t *set, const routerinfo_t *ri,
  20. country_t country);
  21. int routerset_contains_routerstatus(const routerset_t *set,
  22. const routerstatus_t *rs,
  23. country_t country);
  24. int routerset_contains_extendinfo(const routerset_t *set,
  25. const extend_info_t *ei);
  26. int routerset_contains_node(const routerset_t *set, const node_t *node);
  27. void routerset_get_all_nodes(smartlist_t *out, const routerset_t *routerset,
  28. const routerset_t *excludeset,
  29. int running_only);
  30. int routerset_add_unknown_ccs(routerset_t **setp, int only_if_some_cc_set);
  31. #if 0
  32. void routersets_get_node_disjunction(smartlist_t *target,
  33. const smartlist_t *source,
  34. const routerset_t *include,
  35. const routerset_t *exclude, int running_only);
  36. #endif
  37. void routerset_subtract_nodes(smartlist_t *out,
  38. const routerset_t *routerset);
  39. char *routerset_to_string(const routerset_t *routerset);
  40. int routerset_equal(const routerset_t *old, const routerset_t *new);
  41. void routerset_free(routerset_t *routerset);
  42. #endif