diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2018-05-03 17:07:29 +0200 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2018-05-05 16:12:00 +0200 |
commit | b00d17aa9e312e37fa05a4e3f05fedb28b67155d (patch) | |
tree | bd12d698dd20b776afe33b3b3ecaaf4b9a34b74c /src/or/router.h | |
parent | f36656cada48a2d9f51c857d8477a8060cb89b9d (diff) | |
download | tor-b00d17aa9e312e37fa05a4e3f05fedb28b67155d.tar.gz tor-b00d17aa9e312e37fa05a4e3f05fedb28b67155d.zip |
Improve GETCONF exit-policy/* error handling
This will yield different error codes for transient and permament
errors. Furthermore, Tor will give human readable error
messages to controller.
Diffstat (limited to 'src/or/router.h')
-rw-r--r-- | src/or/router.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/router.h b/src/or/router.h index 03eca9c65d..bf0267b774 100644 --- a/src/or/router.h +++ b/src/or/router.h @@ -14,6 +14,13 @@ #include "testsupport.h" +#define TOR_ROUTERINFO_ERROR_NO_EXT_ADDR (-1) +#define TOR_ROUTERINFO_ERROR_CANNOT_PARSE (-2) +#define TOR_ROUTERINFO_ERROR_NOT_A_SERVER (-3) +#define TOR_ROUTERINFO_ERROR_DIGEST_FAILED (-4) +#define TOR_ROUTERINFO_ERROR_CANNOT_GENERATE (-5) +#define TOR_ROUTERINFO_ERROR_NOT_SO_FAST (-6) + crypto_pk_t *get_onion_key(void); time_t get_onion_key_set_at(void); void set_server_identity_key(crypto_pk_t *k); @@ -85,6 +92,7 @@ void router_new_address_suggestion(const char *suggestion, int router_compare_to_my_exit_policy(const tor_addr_t *addr, uint16_t port); MOCK_DECL(int, router_my_exit_policy_is_reject_star,(void)); MOCK_DECL(const routerinfo_t *, router_get_my_routerinfo, (void)); +MOCK_DECL(int, router_get_my_routerinfo_with_err,(routerinfo_t **ri)); extrainfo_t *router_get_my_extrainfo(void); const char *router_get_my_descriptor(void); const char *router_get_descriptor_gen_reason(void); @@ -127,6 +135,9 @@ const char *node_describe(const node_t *node); const char *routerstatus_describe(const routerstatus_t *ri); const char *extend_info_describe(const extend_info_t *ei); +const char *routerinfo_errno_to_string(int err); +int routerinfo_err_is_transient(int err); + void router_get_verbose_nickname(char *buf, const routerinfo_t *router); void router_reset_warnings(void); void router_reset_reachability(void); |