Back to index

tor  0.2.3.18-rc
routerparse.h
Go to the documentation of this file.
00001 /* Copyright (c) 2001 Matej Pfajfar.
00002  * Copyright (c) 2001-2004, Roger Dingledine.
00003  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
00004  * Copyright (c) 2007-2012, The Tor Project, Inc. */
00005 /* See LICENSE for licensing information */
00006 
00012 #ifndef _TOR_ROUTERPARSE_H
00013 #define _TOR_ROUTERPARSE_H
00014 
00015 int router_get_router_hash(const char *s, size_t s_len, char *digest);
00016 int router_get_dir_hash(const char *s, char *digest);
00017 int router_get_runningrouters_hash(const char *s, char *digest);
00018 int router_get_networkstatus_v2_hash(const char *s, char *digest);
00019 int router_get_networkstatus_v3_hash(const char *s, char *digest,
00020                                      digest_algorithm_t algorithm);
00021 int router_get_networkstatus_v3_hashes(const char *s, digests_t *digests);
00022 int router_get_extrainfo_hash(const char *s, size_t s_len, char *digest);
00023 #define DIROBJ_MAX_SIG_LEN 256
00024 int router_append_dirobj_signature(char *buf, size_t buf_len,
00025                                    const char *digest,
00026                                    size_t digest_len,
00027                                    crypto_pk_t *private_key);
00028 int router_parse_list_from_string(const char **s, const char *eos,
00029                                   smartlist_t *dest,
00030                                   saved_location_t saved_location,
00031                                   int is_extrainfo,
00032                                   int allow_annotations,
00033                                   const char *prepend_annotations);
00034 int router_parse_runningrouters(const char *str);
00035 int router_parse_directory(const char *str);
00036 
00037 routerinfo_t *router_parse_entry_from_string(const char *s, const char *end,
00038                                              int cache_copy,
00039                                              int allow_annotations,
00040                                              const char *prepend_annotations);
00041 extrainfo_t *extrainfo_parse_entry_from_string(const char *s, const char *end,
00042                          int cache_copy, struct digest_ri_map_t *routermap);
00043 addr_policy_t *router_parse_addr_policy_item_from_string(const char *s,
00044                                                   int assume_action);
00045 version_status_t tor_version_is_obsolete(const char *myversion,
00046                                          const char *versionlist);
00047 int tor_version_supports_microdescriptors(const char *platform);
00048 int tor_version_as_new_as(const char *platform, const char *cutoff);
00049 int tor_version_parse(const char *s, tor_version_t *out);
00050 int tor_version_compare(tor_version_t *a, tor_version_t *b);
00051 int tor_version_same_series(tor_version_t *a, tor_version_t *b);
00052 void sort_version_list(smartlist_t *lst, int remove_duplicates);
00053 void assert_addr_policy_ok(smartlist_t *t);
00054 void dump_distinct_digest_count(int severity);
00055 
00056 int compare_routerstatus_entries(const void **_a, const void **_b);
00057 networkstatus_v2_t *networkstatus_v2_parse_from_string(const char *s);
00058 int networkstatus_verify_bw_weights(networkstatus_t *ns);
00059 networkstatus_t *networkstatus_parse_vote_from_string(const char *s,
00060                                                  const char **eos_out,
00061                                                  networkstatus_type_t ns_type);
00062 ns_detached_signatures_t *networkstatus_parse_detached_signatures(
00063                                           const char *s, const char *eos);
00064 
00065 smartlist_t *microdescs_parse_from_string(const char *s, const char *eos,
00066                                           int allow_annotations,
00067                                           int copy_body);
00068 
00069 authority_cert_t *authority_cert_parse_from_string(const char *s,
00070                                                    const char **end_of_string);
00071 int rend_parse_v2_service_descriptor(rend_service_descriptor_t **parsed_out,
00072                                      char *desc_id_out,
00073                                      char **intro_points_encrypted_out,
00074                                      size_t *intro_points_encrypted_size_out,
00075                                      size_t *encoded_size_out,
00076                                      const char **next_out, const char *desc);
00077 int rend_decrypt_introduction_points(char **ipos_decrypted,
00078                                      size_t *ipos_decrypted_size,
00079                                      const char *descriptor_cookie,
00080                                      const char *ipos_encrypted,
00081                                      size_t ipos_encrypted_size);
00082 int rend_parse_introduction_points(rend_service_descriptor_t *parsed,
00083                                    const char *intro_points_encoded,
00084                                    size_t intro_points_encoded_size);
00085 int rend_parse_client_keys(strmap_t *parsed_clients, const char *str);
00086 
00087 #endif
00088