tor  0.4.2.1-alpha-dev
describe.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-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
12 #ifndef TOR_DESCRIBE_H
13 #define TOR_DESCRIBE_H
14 
15 struct extend_info_t;
16 struct node_t;
17 struct routerinfo_t;
18 struct routerstatus_t;
19 
20 const char *extend_info_describe(const struct extend_info_t *ei);
21 const char *node_describe(const struct node_t *node);
22 const char *router_describe(const struct routerinfo_t *ri);
23 const char *routerstatus_describe(const struct routerstatus_t *ri);
24 
25 void router_get_verbose_nickname(char *buf, const routerinfo_t *router);
26 
27 #if defined(DESCRIBE_PRIVATE) || defined(TOR_UNIT_TESTS)
28 
33 #define IPV4_BUF_LEN_NO_NUL 15
34 
42 #define NODE_DESC_BUF_LEN \
43  (MAX_VERBOSE_NICKNAME_LEN+4+IPV4_BUF_LEN_NO_NUL+5+TOR_ADDR_BUF_LEN)
44 
45 #endif /* defined(DESCRIBE_PRIVATE) || defined(TOR_UNIT_TESTS) */
46 
47 #ifdef TOR_UNIT_TESTS
48 
49 STATIC const char *format_node_description(char *buf,
50  const char *id_digest,
51  const char *nickname,
52  const tor_addr_t *addr,
53  uint32_t addr32h);
54 
55 #endif /* defined(TOR_UNIT_TESTS) */
56 
57 #endif /* !defined(TOR_DESCRIBE_H) */
Definition: node_st.h:28
const char * extend_info_describe(const extend_info_t *ei)
Definition: describe.c:204
const char * node_describe(const node_t *node)
Definition: describe.c:143
const char * routerstatus_describe(const routerstatus_t *rs)
Definition: describe.c:184
char nickname[MAX_NICKNAME_LEN+1]
STATIC const char * format_node_description(char *buf, const char *id_digest, const char *nickname, const tor_addr_t *addr, uint32_t addr32h)
Definition: describe.c:36
void router_get_verbose_nickname(char *buf, const routerinfo_t *router)
Definition: describe.c:226
const char * router_describe(const routerinfo_t *ri)
Definition: describe.c:123