routerparse.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #include "core/or/versions.h"
  13. int router_get_router_hash(const char *s, size_t s_len, char *digest);
  14. int router_get_extrainfo_hash(const char *s, size_t s_len, char *digest);
  15. int router_parse_list_from_string(const char **s, const char *eos,
  16. smartlist_t *dest,
  17. saved_location_t saved_location,
  18. int is_extrainfo,
  19. int allow_annotations,
  20. const char *prepend_annotations,
  21. smartlist_t *invalid_digests_out);
  22. routerinfo_t *router_parse_entry_from_string(const char *s, const char *end,
  23. int cache_copy,
  24. int allow_annotations,
  25. const char *prepend_annotations,
  26. int *can_dl_again_out);
  27. struct digest_ri_map_t;
  28. extrainfo_t *extrainfo_parse_entry_from_string(const char *s, const char *end,
  29. int cache_copy, struct digest_ri_map_t *routermap,
  30. int *can_dl_again_out);
  31. MOCK_DECL(addr_policy_t *, router_parse_addr_policy_item_from_string,
  32. (const char *s, int assume_action, int *malformed_list));
  33. int find_single_ipv6_orport(const smartlist_t *list,
  34. tor_addr_t *addr_out,
  35. uint16_t *port_out);
  36. void routerparse_init(void);
  37. void routerparse_free_all(void);
  38. void summarize_protover_flags(protover_summary_flags_t *out,
  39. const char *protocols,
  40. const char *version);
  41. #define ED_DESC_SIGNATURE_PREFIX "Tor router descriptor signature v1"
  42. #endif /* !defined(TOR_ROUTERPARSE_H) */