routerparse.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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-2018, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file routerparse.h
  8. * \brief Header file for routerparse.c.
  9. **/
  10. #ifndef TOR_ROUTERPARSE_H
  11. #define TOR_ROUTERPARSE_H
  12. int router_get_router_hash(const char *s, size_t s_len, char *digest);
  13. int router_get_extrainfo_hash(const char *s, size_t s_len, char *digest);
  14. int router_parse_list_from_string(const char **s, const char *eos,
  15. smartlist_t *dest,
  16. saved_location_t saved_location,
  17. int is_extrainfo,
  18. int allow_annotations,
  19. const char *prepend_annotations,
  20. smartlist_t *invalid_digests_out);
  21. routerinfo_t *router_parse_entry_from_string(const char *s, const char *end,
  22. int cache_copy,
  23. int allow_annotations,
  24. const char *prepend_annotations,
  25. int *can_dl_again_out);
  26. struct digest_ri_map_t;
  27. extrainfo_t *extrainfo_parse_entry_from_string(const char *s, const char *end,
  28. int cache_copy, struct digest_ri_map_t *routermap,
  29. int *can_dl_again_out);
  30. int find_single_ipv6_orport(const smartlist_t *list,
  31. tor_addr_t *addr_out,
  32. uint16_t *port_out);
  33. void routerparse_init(void);
  34. void routerparse_free_all(void);
  35. #ifdef EXPOSE_ROUTERDESC_TOKEN_TABLE
  36. extern const struct token_rule_t routerdesc_token_table[];
  37. #endif
  38. #define ED_DESC_SIGNATURE_PREFIX "Tor router descriptor signature v1"
  39. #endif /* !defined(TOR_ROUTERPARSE_H) */