Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
routerinfo_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 routerinfo_st.h
9 * @brief Router descriptor structure.
10 **/
11
12#ifndef ROUTERINFO_ST_H
13#define ROUTERINFO_ST_H
14
16
18struct smartlist_t;
19
20/** Information about another onion router in the network. */
22 signed_descriptor_t cache_info;
23 char *nickname; /**< Human-readable OR name. */
24
25 /** A router's IPv4 address. */
27 uint16_t ipv4_orport;
28 uint16_t ipv4_dirport;
29
30 /** A router's IPv6 address, if it has one. */
32 uint16_t ipv6_orport;
33
34 /**
35 * Public RSA TAP key for onions, ASN.1 encoded. We store this
36 * in its encoded format since storing it as a crypto_pk_t uses
37 * significantly more memory.
38 *
39 * This may be absent.
40 */
42 /** Length of onion_pkey, in bytes. */
44
45 crypto_pk_t *identity_pkey; /**< Public RSA key for signing. */
46 /** Public curve25519 key for onions */
48 /** What's the earliest expiration time on all the certs in this
49 * routerinfo? */
51
52 char *platform; /**< What software/operating system is this OR using? */
53
54 char *protocol_list; /**< Encoded list of subprotocol versions supported
55 * by this OR */
56
57 /* link info */
58 uint32_t bandwidthrate; /**< How many bytes does this OR add to its token
59 * bucket per second? */
60 uint32_t bandwidthburst; /**< How large is this OR's token bucket? */
61 /** How many bytes/s is this router known to handle? */
63 smartlist_t *exit_policy; /**< What streams will this OR permit
64 * to exit on IPv4? NULL for 'reject *:*'. */
65 /** What streams will this OR permit to exit on IPv6?
66 * NULL for 'reject *:*' */
68 long uptime; /**< How many seconds the router claims to have been up */
69 smartlist_t *declared_family; /**< Nicknames of router which this router
70 * claims are its family. */
71 /** A list of strings representing router family IDs.
72 * May be null. Extracted from family-certs.
73 * (Happy families only.) */
75 char *contact_info; /**< Declared contact info for this router. */
76 unsigned int is_hibernating:1; /**< Whether the router claims to be
77 * hibernating */
78 unsigned int caches_extra_info:1; /**< Whether the router says it caches and
79 * serves extrainfo documents. */
80 unsigned int allow_single_hop_exits:1; /**< Whether the router says
81 * it allows single hop exits. */
82
83 unsigned int wants_to_be_hs_dir:1; /**< True iff this router claims to be
84 * a hidden service directory. */
85 unsigned int policy_is_reject_star:1; /**< True iff the exit policy for this
86 * router rejects everything. */
87 /** True if, after we have added this router, we should re-launch
88 * tests for it. */
89 unsigned int needs_retest_if_added:1;
90
91 /** True iff this router included "tunnelled-dir-server" in its descriptor,
92 * implying it accepts tunnelled directory requests, or it advertised
93 * dir_port > 0. */
95
96 /** Used during voting to indicate that we should not include an entry for
97 * this routerinfo. Used only during voting. */
98 unsigned int omit_from_vote:1;
99
100 /** Flags to summarize the protocol versions for this routerinfo_t. */
102
103/** Tor can use this router for general positions in circuits; we got it
104 * from a directory server as usual, or we're an authority and a server
105 * uploaded it. */
106#define ROUTER_PURPOSE_GENERAL 0
107/** Tor should avoid using this router for circuit-building: we got it
108 * from a controller. If the controller wants to use it, it'll have to
109 * ask for it by identity. */
110#define ROUTER_PURPOSE_CONTROLLER 1
111/** Tor should use this router only for bridge positions in circuits: we got
112 * it via a directory request from the bridge itself, or a bridge
113 * authority. */
114#define ROUTER_PURPOSE_BRIDGE 2
115/** Tor should not use this router; it was marked in cached-descriptors with
116 * a purpose we didn't recognize. */
117#define ROUTER_PURPOSE_UNKNOWN 255
118
119 /** In what way did we find out about this router? One of ROUTER_PURPOSE_*.
120 * Routers of different purposes are kept segregated and used for different
121 * things; see notes on ROUTER_PURPOSE_* macros above.
122 */
123 uint8_t purpose;
124};
125
126#endif /* !defined(ROUTERINFO_ST_H) */
Descriptor/extrainfo signature structure.
unsigned int allow_single_hop_exits
Definition: routerinfo_st.h:80
unsigned int omit_from_vote
Definition: routerinfo_st.h:98
char * platform
Definition: routerinfo_st.h:52
unsigned int caches_extra_info
Definition: routerinfo_st.h:78
tor_addr_t ipv6_addr
Definition: routerinfo_st.h:31
tor_addr_t ipv4_addr
Definition: routerinfo_st.h:26
protover_summary_flags_t pv
smartlist_t * exit_policy
Definition: routerinfo_st.h:63
smartlist_t * declared_family
Definition: routerinfo_st.h:69
uint32_t bandwidthrate
Definition: routerinfo_st.h:58
crypto_pk_t * identity_pkey
Definition: routerinfo_st.h:45
size_t tap_onion_pkey_len
Definition: routerinfo_st.h:43
struct curve25519_public_key_t * onion_curve25519_pkey
Definition: routerinfo_st.h:47
unsigned int wants_to_be_hs_dir
Definition: routerinfo_st.h:83
struct smartlist_t * family_ids
Definition: routerinfo_st.h:74
unsigned int is_hibernating
Definition: routerinfo_st.h:76
unsigned int policy_is_reject_star
Definition: routerinfo_st.h:85
unsigned int needs_retest_if_added
Definition: routerinfo_st.h:89
char * protocol_list
Definition: routerinfo_st.h:54
uint8_t purpose
unsigned int supports_tunnelled_dir_requests
Definition: routerinfo_st.h:94
char * contact_info
Definition: routerinfo_st.h:75
uint32_t bandwidthcapacity
Definition: routerinfo_st.h:62
time_t cert_expiration_time
Definition: routerinfo_st.h:50
uint32_t bandwidthburst
Definition: routerinfo_st.h:60
char * tap_onion_pkey
Definition: routerinfo_st.h:41
char * nickname
Definition: routerinfo_st.h:23
struct short_policy_t * ipv6_exit_policy
Definition: routerinfo_st.h:67