tor  0.4.2.0-alpha-dev
routerparse.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-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
12 #ifndef TOR_ROUTERPARSE_H
13 #define TOR_ROUTERPARSE_H
14 
15 int router_get_router_hash(const char *s, size_t s_len, char *digest);
16 int router_get_extrainfo_hash(const char *s, size_t s_len, char *digest);
17 
18 int router_parse_list_from_string(const char **s, const char *eos,
19  smartlist_t *dest,
20  saved_location_t saved_location,
21  int is_extrainfo,
22  int allow_annotations,
23  const char *prepend_annotations,
24  smartlist_t *invalid_digests_out);
25 
26 routerinfo_t *router_parse_entry_from_string(const char *s, const char *end,
27  int cache_copy,
28  int allow_annotations,
29  const char *prepend_annotations,
30  int *can_dl_again_out);
31 struct digest_ri_map_t;
32 extrainfo_t *extrainfo_parse_entry_from_string(const char *s, const char *end,
33  int cache_copy, struct digest_ri_map_t *routermap,
34  int *can_dl_again_out);
35 
36 int find_single_ipv6_orport(const smartlist_t *list,
37  tor_addr_t *addr_out,
38  uint16_t *port_out);
39 
40 void routerparse_init(void);
41 void routerparse_free_all(void);
42 
43 #ifdef EXPOSE_ROUTERDESC_TOKEN_TABLE
44 extern const struct token_rule_t routerdesc_token_table[];
45 #endif
46 
47 #define ED_DESC_SIGNATURE_PREFIX "Tor router descriptor signature v1"
48 
49 #endif /* !defined(TOR_ROUTERPARSE_H) */
int router_get_router_hash(const char *s, size_t s_len, char *digest)
Definition: routerparse.c:176
void routerparse_init(void)
Definition: routerparse.c:1228
void routerparse_free_all(void)
Definition: routerparse.c:1242
saved_location_t
Definition: or.h:746
int router_get_extrainfo_hash(const char *s, size_t s_len, char *digest)
Definition: routerparse.c:186
int router_parse_list_from_string(const char **s, const char *eos, smartlist_t *dest, saved_location_t saved_location, int is_extrainfo, int allow_annotations, const char *prepend_annotations, smartlist_t *invalid_digests_out)
Definition: routerparse.c:245
const token_rule_t routerdesc_token_table[]
Definition: routerparse.c:84
int find_single_ipv6_orport(const smartlist_t *list, tor_addr_t *addr_out, uint16_t *port_out)
Definition: routerparse.c:336
extrainfo_t * extrainfo_parse_entry_from_string(const char *s, const char *end, int cache_copy, struct digest_ri_map_t *routermap, int *can_dl_again_out)
Definition: routerparse.c:961
routerinfo_t * router_parse_entry_from_string(const char *s, const char *end, int cache_copy, int allow_annotations, const char *prepend_annotations, int *can_dl_again_out)
Definition: routerparse.c:390