Tor
0.4.7.0-alpha-dev
feature
nodelist
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-2021, The Tor Project, Inc. */
5
/* See LICENSE for licensing information */
6
7
/**
8
* \file describe.h
9
* \brief Header file for describe.c.
10
**/
11
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
29
/**
30
* Longest allowed output for an IPv4 address "255.255.255.255", with NO
31
* terminating NUL.
32
*/
33
#define IPV4_BUF_LEN_NO_NUL 15
34
35
/**
36
* Longest allowed output of format_node_description, plus 1 character for
37
* NUL. This allows space for:
38
* "$FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF~xxxxxxxxxxxxxxxxxxx "
39
* "[+++++++++++++++++++++++++++++++++++++++++++] at"
40
* " 255.255.255.255 and [ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255]"
41
* plus a terminating NUL.
42
*/
43
#define NODE_DESC_BUF_LEN \
44
(MAX_VERBOSE_NICKNAME_LEN+4 \
45
+ ED25519_BASE64_LEN+3 \
46
+ IPV4_BUF_LEN_NO_NUL+5 \
47
+ TOR_ADDR_BUF_LEN)
48
49
#endif
/* defined(DESCRIBE_PRIVATE) || defined(TOR_UNIT_TESTS) */
50
51
#ifdef TOR_UNIT_TESTS
52
struct
ed25519_public_key_t
;
53
54
STATIC
const
char
*
format_node_description
(
char
*buf,
55
const
char
*rsa_id_digest,
56
const
struct
ed25519_public_key_t
*ed25519_id,
57
const
char
*nickname,
58
const
tor_addr_t
*ipv4_addr,
59
const
tor_addr_t
*ipv6_addr);
60
61
#endif
/* defined(TOR_UNIT_TESTS) */
62
63
#endif
/* !defined(TOR_DESCRIBE_H) */
router_describe
const char * router_describe(const routerinfo_t *ri)
Definition:
describe.c:137
extend_info_describe
const char * extend_info_describe(const extend_info_t *ei)
Definition:
describe.c:224
routerstatus_describe
const char * routerstatus_describe(const routerstatus_t *rs)
Definition:
describe.c:203
node_describe
const char * node_describe(const node_t *node)
Definition:
describe.c:160
format_node_description
STATIC const char * format_node_description(char *buf, const char *rsa_id_digest, const ed25519_public_key_t *ed25519_id, const char *nickname, const tor_addr_t *ipv4_addr, const tor_addr_t *ipv6_addr)
Definition:
describe.c:40
router_get_verbose_nickname
void router_get_verbose_nickname(char *buf, const routerinfo_t *router)
Definition:
describe.c:256
ed25519_public_key_t
Definition:
crypto_ed25519.h:23
extend_info_t
Definition:
extend_info_st.h:27
node_t
Definition:
node_st.h:34
routerinfo_t
Definition:
routerinfo_st.h:20
routerstatus_t
Definition:
routerstatus_st.h:19
tor_addr_t
Definition:
address.h:69
STATIC
#define STATIC
Definition:
testsupport.h:32
Generated by
1.9.1