Tor  0.4.7.0-alpha-dev
ns_parse.h
Go to the documentation of this file.
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-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * \file ns_parse.h
9  * \brief Header file for ns_parse.c.
10  **/
11 
12 #ifndef TOR_NS_PARSE_H
13 #define TOR_NS_PARSE_H
14 
15 int router_get_networkstatus_v3_hashes(const char *s, size_t len,
16  common_digests_t *digests);
17 int router_get_networkstatus_v3_signed_boundaries(const char *s, size_t len,
18  const char **start_out,
19  const char **end_out);
20 int router_get_networkstatus_v3_sha3_as_signed(uint8_t *digest_out,
21  const char *s, size_t len);
22 int compare_vote_routerstatus_entries(const void **_a, const void **_b);
23 
27  size_t len,
28  const char **eos_out,
29  enum networkstatus_type_t ns_type);
30 
31 #ifdef NS_PARSE_PRIVATE
32 STATIC int routerstatus_parse_guardfraction(const char *guardfraction_str,
33  networkstatus_t *vote,
34  vote_routerstatus_t *vote_rs,
35  routerstatus_t *rs);
36 struct memarea_t;
37 STATIC routerstatus_t *routerstatus_parse_entry_from_string(
38  struct memarea_t *area,
39  const char **s, const char *eos,
40  smartlist_t *tokens,
41  networkstatus_t *vote,
42  vote_routerstatus_t *vote_rs,
43  int consensus_method,
44  consensus_flavor_t flav);
45 #endif /* defined(NS_PARSE_PRIVATE) */
46 
47 #endif /* !defined(TOR_NS_PARSE_H) */
networkstatus_type_t
int router_get_networkstatus_v3_sha3_as_signed(uint8_t *digest_out, const char *s, size_t len)
Definition: ns_parse.c:179
networkstatus_t * networkstatus_parse_vote_from_string(const char *s, size_t len, const char **eos_out, enum networkstatus_type_t ns_type)
Definition: ns_parse.c:1089
int router_get_networkstatus_v3_signed_boundaries(const char *s, size_t len, const char **start_out, const char **end_out)
Definition: ns_parse.c:163
int networkstatus_verify_bw_weights(networkstatus_t *ns, int)
Definition: ns_parse.c:608
int router_get_networkstatus_v3_hashes(const char *s, size_t len, common_digests_t *digests)
Definition: ns_parse.c:197
consensus_flavor_t
Definition: or.h:761
#define STATIC
Definition: testsupport.h:32