aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-15 21:58:46 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-15 21:58:46 -0400
commitb95dd03e5f6505ce2e78fe34a20bf5e5c970e6eb (patch)
treed60ca6da0feb52fc330ffa88ff871e6c35781e63 /src/or/router.h
parentede102fd4675af8ac4060767f0348f3c93617e80 (diff)
downloadtor-b95dd03e5f6505ce2e78fe34a20bf5e5c970e6eb.tar.gz
tor-b95dd03e5f6505ce2e78fe34a20bf5e5c970e6eb.zip
Log descriptions of nodes, not just nicknames.
This patch introduces a few new functions in router.c to produce a more helpful description of a node than its nickame, and then tweaks nearly all log messages taking a nickname as an argument to call these functions instead. There are a few cases where I left the old log messages alone: in these cases, the nickname was that of an authority (whose nicknames are useful and unique), or the message already included an identity and/or an address. I might have missed a couple more too. This is a fix for bug 3045.
Diffstat (limited to 'src/or/router.h')
-rw-r--r--src/or/router.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/or/router.h b/src/or/router.h
index 1bf1a51ae1..6cabfd56e8 100644
--- a/src/or/router.h
+++ b/src/or/router.h
@@ -85,6 +85,21 @@ int extrainfo_dump_to_string(char **s, extrainfo_t *extrainfo,
int is_legal_nickname(const char *s);
int is_legal_nickname_or_hexdigest(const char *s);
int is_legal_hexdigest(const char *s);
+
+#define NODE_DESC_BUF_LEN (MAX_VERBOSE_NICKNAME_LEN+4+TOR_ADDR_BUF_LEN)
+const char *format_node_description(char *buf,
+ const char *id_digest,
+ int is_named,
+ const char *nickname,
+ const tor_addr_t *addr,
+ uint32_t addr32h);
+const char *router_get_description(char *buf, const routerinfo_t *ri);
+const char *routerstatus_get_description(char *buf, const routerstatus_t *rs);
+const char *extend_info_get_description(char *buf, const extend_info_t *ei);
+const char *router_describe(const routerinfo_t *ri);
+const char *routerstatus_describe(const routerstatus_t *ri);
+const char *extend_info_describe(const extend_info_t *ei);
+
void router_get_verbose_nickname(char *buf, const routerinfo_t *router);
void routerstatus_get_verbose_nickname(char *buf,
const routerstatus_t *router);