Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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-2021, The Tor Project, Inc. */
5/* See LICENSE for licensing information */
6
7/**
8 * \file routerparse.h
9 * \brief Header file for routerparse.c.
10 **/
11
12#ifndef TOR_ROUTERPARSE_H
13#define TOR_ROUTERPARSE_H
14
16
17int router_get_router_hash(const char *s, size_t s_len, char *digest);
18int router_get_extrainfo_hash(const char *s, size_t s_len, char *digest);
19
20int router_parse_list_from_string(const char **s, const char *eos,
21 smartlist_t *dest,
22 saved_location_t saved_location,
23 int is_extrainfo,
24 int allow_annotations,
25 const char *prepend_annotations,
26 smartlist_t *invalid_digests_out);
27
28routerinfo_t *router_parse_entry_from_string(const char *s, const char *end,
29 int cache_copy,
30 int allow_annotations,
31 const char *prepend_annotations,
32 int *can_dl_again_out);
33struct digest_ri_map_t;
34extrainfo_t *extrainfo_parse_entry_from_string(const char *s, const char *end,
35 int cache_copy, struct digest_ri_map_t *routermap,
36 int *can_dl_again_out);
37
39 tor_addr_t *addr_out,
40 uint16_t *port_out);
41
42void routerparse_init(void);
43void routerparse_free_all(void);
44
45#ifdef ROUTERDESC_TOKEN_TABLE_PRIVATE
47extern const struct token_rule_t routerdesc_token_table[];
48#endif
49
50#define ED_DESC_SIGNATURE_PREFIX "Tor router descriptor signature v1"
51
52#ifdef ROUTERPARSE_PRIVATE
53STATIC int check_one_family_cert(const uint8_t *cert_body,
54 size_t cert_body_size,
55 const struct ed25519_public_key_t *identity_key,
56 char **family_id_out,
57 time_t *family_expiration_out);
58#endif
59
60#endif /* !defined(TOR_ROUTERPARSE_H) */
saved_location_t
Definition: or.h:711
Header file for parsecommon.c.
STATIC int check_one_family_cert(const uint8_t *cert_body, size_t cert_body_size, const ed25519_public_key_t *identity_key, char **family_id_out, time_t *family_expiration_out)
Definition: routerparse.c:1280
const token_rule_t routerdesc_token_table[]
Definition: routerparse.c:86
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:400
int router_get_extrainfo_hash(const char *s, size_t s_len, char *digest)
Definition: routerparse.c:196
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:1006
int router_get_router_hash(const char *s, size_t s_len, char *digest)
Definition: routerparse.c:186
void routerparse_free_all(void)
Definition: routerparse.c:1402
void routerparse_init(void)
Definition: routerparse.c:1388
int find_single_ipv6_orport(const smartlist_t *list, tor_addr_t *addr_out, uint16_t *port_out)
Definition: routerparse.c:346
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:255
Macros to implement mocking and selective exposure for the test code.
#define STATIC
Definition: testsupport.h:32