Tor 0.4.9.3-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
microdesc_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 microdesc_st.h
9 * @brief Microdescriptor structure
10 **/
11
12#ifndef MICRODESC_ST_H
13#define MICRODESC_ST_H
14
17struct nodefamily_t;
18struct short_policy_t;
19struct smartlist_t;
20
21#include "ext/ht.h"
22
23/** A microdescriptor is the smallest amount of information needed to build a
24 * circuit through a router. They are generated by the directory authorities,
25 * using information from the uploaded routerinfo documents. They are not
26 * self-signed, but are rather authenticated by having their hash in a signed
27 * networkstatus document. */
29 /** Hashtable node, used to look up the microdesc by its digest. */
31
32 /* Cache information */
33
34 /** When was this microdescriptor last listed in a consensus document?
35 * Once a microdesc has been unlisted long enough, we can drop it.
36 */
38 /** Where is this microdescriptor currently stored? */
39 saved_location_bitfield_t saved_location : 3;
40 /** If true, do not attempt to cache this microdescriptor on disk. */
41 unsigned int no_save : 1;
42 /** If true, this microdesc has an entry in the microdesc_map */
43 unsigned int held_in_map : 1;
44 /** True iff the exit policy for this router rejects everything. */
45 unsigned int policy_is_reject_star : 1;
46 /** Reference count: how many node_ts have a reference to this microdesc? */
47 unsigned int held_by_nodes;
48
49 /** If saved_location == SAVED_IN_CACHE, this field holds the offset of the
50 * microdescriptor in the cache. */
51 off_t off;
52
53 /* The string containing the microdesc. */
54
55 /** A pointer to the encoded body of the microdescriptor. If the
56 * saved_location is SAVED_IN_CACHE, then the body is a pointer into an
57 * mmap'd region. Otherwise, it is a malloc'd string. The string might not
58 * be NUL-terminated; take the length from <b>bodylen</b>. */
59 char *body;
60 /** The length of the microdescriptor in <b>body</b>. */
61 size_t bodylen;
62 /** A SHA256-digest of the microdescriptor. */
64
65 /* Fields in the microdescriptor. */
66
67 /** As routerinfo_t.onion_curve25519_pkey */
69 /** Ed25519 identity key, if included. */
71 /** As routerinfo_t.ipv6_addr */
73 /** As routerinfo_t.ipv6_orport */
74 uint16_t ipv6_orport;
75 /** As routerinfo_t.family, with readable members parsed. */
77 /** A list of strings representing router family IDs.
78 * May be null; Copied from family-ids.
79 * (Happy families only.) */
81
82 /** IPv4 exit policy summary */
84 /** IPv6 exit policy summary */
86};
87
88#endif /* !defined(MICRODESC_ST_H) */
#define DIGEST256_LEN
HT_ENTRY(microdesc_t) node
unsigned int held_by_nodes
uint16_t ipv6_orport
struct short_policy_t * exit_policy
tor_addr_t ipv6_addr
unsigned int held_in_map
saved_location_bitfield_t saved_location
unsigned int no_save
time_t last_listed
struct curve25519_public_key_t * onion_curve25519_pkey
char digest[DIGEST256_LEN]
struct smartlist_t * family_ids
unsigned int policy_is_reject_star
size_t bodylen
struct nodefamily_t * family
struct ed25519_public_key_t * ed25519_identity_pkey
struct short_policy_t * ipv6_exit_policy