summaryrefslogtreecommitdiff
path: root/src/feature/control/control_fmt.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-03-25 14:14:56 -0400
committerNick Mathewson <nickm@torproject.org>2019-03-25 14:14:56 -0400
commit61cebb2035b8cfb2f84ab5e198742d0b29b41192 (patch)
tree209dd7c275e6005480be3833ea3d2302c794cd80 /src/feature/control/control_fmt.c
parent2917ecaa970c8fabcc0e9875b1e87c0d279ab1b3 (diff)
downloadtor-61cebb2035b8cfb2f84ab5e198742d0b29b41192.tar.gz
tor-61cebb2035b8cfb2f84ab5e198742d0b29b41192.zip
Minimize the includes in control.c
Diffstat (limited to 'src/feature/control/control_fmt.c')
-rw-r--r--src/feature/control/control_fmt.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/feature/control/control_fmt.c b/src/feature/control/control_fmt.c
index 290ea61450..71f9d82163 100644
--- a/src/feature/control/control_fmt.c
+++ b/src/feature/control/control_fmt.c
@@ -392,3 +392,18 @@ decode_escaped_string(const char *start, size_t in_len_max,
return end+1;
}
+
+/** Return a longname the node whose identity is <b>id_digest</b>. If
+ * node_get_by_id() returns NULL, base 16 encoding of <b>id_digest</b> is
+ * returned instead.
+ *
+ * This function is not thread-safe. Each call to this function invalidates
+ * previous values returned by this function.
+ */
+MOCK_IMPL(const char *,
+node_describe_longname_by_id,(const char *id_digest))
+{
+ static char longname[MAX_VERBOSE_NICKNAME_LEN+1];
+ node_get_verbose_nickname_by_id(id_digest, longname);
+ return longname;
+}