Tor  0.4.7.0-alpha-dev
routerstatus_st.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 routerstatus_st.h
9  * @brief Routerstatus (consensus entry) structure
10  **/
11 
12 #ifndef ROUTERSTATUS_ST_H
13 #define ROUTERSTATUS_ST_H
14 
16 
17 /** Contents of a single router entry in a network status object.
18  */
20  /* This should be kept in sync with the function
21  * routerstatus_has_visibly_changed and the printing function
22  * routerstatus_format_entry in NS_CONTROL_PORT mode.
23  */
24  time_t published_on; /**< When was this router published? */
25  char nickname[MAX_NICKNAME_LEN+1]; /**< The nickname this router says it
26  * has. */
27  char identity_digest[DIGEST_LEN]; /**< Digest of the router's identity
28  * key. */
29  /** Digest of the router's most recent descriptor or microdescriptor.
30  * If it's a descriptor, we only use the first DIGEST_LEN bytes. */
32  tor_addr_t ipv4_addr;
33  uint16_t ipv4_orport; /**< IPv4 OR port for this router. */
34  uint16_t ipv4_dirport; /**< Directory port for this router. */
35  tor_addr_t ipv6_addr; /**< IPv6 address for this router. */
36  uint16_t ipv6_orport; /**< IPv6 OR port for this router. */
37  unsigned int is_authority:1; /**< True iff this router is an authority. */
38  unsigned int is_exit:1; /**< True iff this router is a good exit. */
39  unsigned int is_stable:1; /**< True iff this router stays up a long time. */
40  unsigned int is_fast:1; /**< True iff this router has good bandwidth. */
41  /** True iff this router is called 'running' in the consensus. We give it
42  * this funny name so that we don't accidentally use this bit as a view of
43  * whether we think the router is *currently* running. If that's what you
44  * want to know, look at is_running in node_t. */
45  unsigned int is_flagged_running:1;
46  unsigned int is_named:1; /**< True iff "nickname" belongs to this router. */
47  unsigned int is_unnamed:1; /**< True iff "nickname" belongs to another
48  * router. */
49  unsigned int is_valid:1; /**< True iff this router isn't invalid. */
50  unsigned int is_possible_guard:1; /**< True iff this router would be a good
51  * choice as an entry guard. */
52  unsigned int is_bad_exit:1; /**< True iff this node is a bad choice for
53  * an exit node. */
54  unsigned int is_hs_dir:1; /**< True iff this router is a v2-or-later hidden
55  * service directory. */
56  unsigned int is_v2_dir:1; /** True iff this router publishes an open DirPort
57  * or it claims to accept tunnelled dir requests.
58  */
59  unsigned int is_staledesc:1; /** True iff the authorities think this router
60  * should upload a new descriptor soon. */
61  unsigned int is_sybil:1; /** True iff this router is a sybil. */
62 
63  unsigned int has_bandwidth:1; /**< The vote/consensus had bw info */
64  unsigned int has_exitsummary:1; /**< The vote/consensus had exit summaries */
65  unsigned int bw_is_unmeasured:1; /**< This is a consensus entry, with
66  * the Unmeasured flag set. */
67 
68  /** Flags to summarize the protocol versions for this routerstatus_t. */
70 
71  uint32_t bandwidth_kb; /**< Bandwidth (capacity) of the router as reported in
72  * the vote/consensus, in kilobytes/sec. */
73 
74  /** The consensus has guardfraction information for this router. */
75  unsigned int has_guardfraction:1;
76  /** The guardfraction value of this router. */
78 
79  char *exitsummary; /**< exit policy summary -
80  * XXX weasel: this probably should not stay a string. */
81 
82  /* ---- The fields below aren't derived from the networkstatus; they
83  * hold local information only. */
84 
85  time_t last_dir_503_at; /**< When did this router last tell us that it
86  * was too busy to serve directory info? */
87  download_status_t dl_status;
88 
89 };
90 
91 #endif /* !defined(ROUTERSTATUS_ST_H) */
#define DIGEST_LEN
Definition: digest_sizes.h:20
#define DIGEST256_LEN
Definition: digest_sizes.h:23
Directory download status/schedule structure.
#define MAX_NICKNAME_LEN
Definition: or.h:112
unsigned int is_bad_exit
uint16_t ipv6_orport
tor_addr_t ipv6_addr
unsigned int is_sybil
protover_summary_flags_t pv
time_t last_dir_503_at
unsigned int is_staledesc
char descriptor_digest[DIGEST256_LEN]
unsigned int has_exitsummary
char identity_digest[DIGEST_LEN]
unsigned int is_hs_dir
unsigned int has_guardfraction
unsigned int is_valid
unsigned int bw_is_unmeasured
char nickname[MAX_NICKNAME_LEN+1]
unsigned int has_bandwidth
uint16_t ipv4_dirport
unsigned int is_named
unsigned int is_possible_guard
unsigned int is_stable
unsigned int is_flagged_running
unsigned int is_exit
unsigned int is_authority
uint32_t guardfraction_percentage
unsigned int is_fast
uint32_t bandwidth_kb
uint16_t ipv4_orport
unsigned int is_unnamed