ns_parse.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 ns_parse.h
  8. * \brief Header file for ns_parse.c.
  9. **/
  10. #ifndef TOR_NS_PARSE_H
  11. #define TOR_NS_PARSE_H
  12. int router_get_networkstatus_v3_hashes(const char *s,
  13. common_digests_t *digests);
  14. int router_get_networkstatus_v3_signed_boundaries(const char *s,
  15. const char **start_out,
  16. const char **end_out);
  17. int router_get_networkstatus_v3_sha3_as_signed(uint8_t *digest_out,
  18. const char *s);
  19. int compare_vote_routerstatus_entries(const void **_a, const void **_b);
  20. int networkstatus_verify_bw_weights(networkstatus_t *ns, int);
  21. enum networkstatus_type_t;
  22. networkstatus_t *networkstatus_parse_vote_from_string(const char *s,
  23. const char **eos_out,
  24. enum networkstatus_type_t ns_type);
  25. #ifdef NS_PARSE_PRIVATE
  26. STATIC int routerstatus_parse_guardfraction(const char *guardfraction_str,
  27. networkstatus_t *vote,
  28. vote_routerstatus_t *vote_rs,
  29. routerstatus_t *rs);
  30. struct memarea_t;
  31. STATIC routerstatus_t *routerstatus_parse_entry_from_string(
  32. struct memarea_t *area,
  33. const char **s, smartlist_t *tokens,
  34. networkstatus_t *vote,
  35. vote_routerstatus_t *vote_rs,
  36. int consensus_method,
  37. consensus_flavor_t flav);
  38. #endif
  39. #endif