Tor 0.4.9.0-alpha-dev
Public Member Functions | Data Fields
node_t Struct Reference

#include <node_st.h>

Public Member Functions

 HT_ENTRY (node_t) ht_ent
 
 HT_ENTRY (node_t) ed_ht_ent
 

Data Fields

int nodelist_idx
 
char identity [DIGEST_LEN]
 
ed25519_public_key_t ed25519_id
 
microdesc_tmd
 
routerinfo_tri
 
routerstatus_trs
 
unsigned int is_running:1
 
unsigned int is_valid:1
 
unsigned int is_fast:1
 
unsigned int is_stable:1
 
unsigned int is_possible_guard:1
 
unsigned int is_exit:1
 
unsigned int is_bad_exit:1
 
unsigned int is_middle_only:1
 
unsigned int is_hs_dir:1
 
unsigned int name_lookup_warned:1
 
unsigned int rejects_all:1
 
unsigned int ipv6_preferred:1
 
country_t country
 
time_t last_reachable
 
time_t last_reachable6
 
struct hsdir_index_t hsdir_index
 

Detailed Description

A node_t represents a Tor router.

Specifically, a node_t is a Tor router as we are using it: a router that we are considering for circuits, connections, and so on. A node_t is a thin wrapper around the routerstatus, routerinfo, and microdesc for a single router, and provides a consistent interface for all of them.

Also, a node_t has mutable state. While a routerinfo, a routerstatus, and a microdesc have[*] only the information read from a router descriptor, a consensus entry, and a microdescriptor (respectively)... a node_t has flags based on our own current opinion of the node.

[*] Actually, there is some leftover information in each that is mutable. We should try to excise that.

Definition at line 34 of file node_st.h.

Member Function Documentation

◆ HT_ENTRY() [1/2]

HT_ENTRY ( node_t  )

Used to look up the node_t by its ed25519 identity digest.

◆ HT_ENTRY() [2/2]

HT_ENTRY ( node_t  )

Used to look up the node_t by its identity digest.

Field Documentation

◆ country

country_t country

According to the geoip db what country is this router in?

Definition at line 94 of file node_st.h.

Referenced by node_addrs_changed(), nodelist_set_routerinfo(), and routerset_contains_node().

◆ ed25519_id

The ed25519 identity of this node_t. This field is nonzero iff we currently have an ed25519 identity for this node in either md or ri, and this node has been inserted to the ed25519-to-node map in the nodelist.

Definition at line 53 of file node_st.h.

Referenced by node_add_to_ed25519_map(), and node_remove_from_ed25519_map().

◆ hsdir_index

struct hsdir_index_t hsdir_index

Definition at line 106 of file node_st.h.

◆ identity

char identity[DIGEST_LEN]

◆ ipv6_preferred

unsigned int ipv6_preferred

True if the IPv6 OR port is preferred over the IPv4 OR port.

Definition at line 90 of file node_st.h.

◆ is_bad_exit

unsigned int is_bad_exit

Do we think this exit is censored, borked, or otherwise nasty?

Definition at line 71 of file node_st.h.

Referenced by dirserv_set_node_flags_from_authoritative_status(), and node_is_good_exit().

◆ is_exit

unsigned int is_exit

Do we think this is an OK exit?

Definition at line 70 of file node_st.h.

Referenced by node_is_good_exit().

◆ is_fast

unsigned int is_fast

Definition at line 67 of file node_st.h.

◆ is_hs_dir

unsigned int is_hs_dir

True iff this router is a hidden service directory according to the authorities.

Definition at line 75 of file node_st.h.

Referenced by dirauth_set_routerstatus_from_routerinfo().

◆ is_middle_only

unsigned int is_middle_only

Is this unsuitable for use as anything besides a middle relay?

Definition at line 74 of file node_st.h.

Referenced by dirserv_set_node_flags_from_authoritative_status().

◆ is_possible_guard

unsigned int is_possible_guard

Do we think this is a stable OR? Do we think this is an OK guard?

Definition at line 69 of file node_st.h.

Referenced by node_is_possible_guard(), and node_is_unreliable().

◆ is_running

unsigned int is_running

As far as we know, is this OR currently running?

Definition at line 63 of file node_st.h.

Referenced by mark_all_dirservers_up(), router_exit_policy_all_nodes_reject(), router_find_exact_exit_enclave(), and router_is_active().

◆ is_stable

unsigned int is_stable

Do we think this is a fast OR?

Definition at line 68 of file node_st.h.

Referenced by dirauth_set_routerstatus_from_routerinfo(), node_is_possible_guard(), and node_is_unreliable().

◆ is_valid

unsigned int is_valid

Has a trusted dirserver validated this OR? (For Authdir: Have we validated this OR?)

Definition at line 65 of file node_st.h.

Referenced by dirserv_set_node_flags_from_authoritative_status(), node_is_possible_guard(), and router_is_active().

◆ last_reachable

time_t last_reachable

When was the last time we could reach this OR?

Definition at line 100 of file node_st.h.

Referenced by node_addrs_changed().

◆ last_reachable6

time_t last_reachable6

Definition at line 101 of file node_st.h.

◆ md

Definition at line 55 of file node_st.h.

◆ name_lookup_warned

unsigned int name_lookup_warned

Have we warned the user for referring to this (unnamed) router by nickname?

Definition at line 80 of file node_st.h.

Referenced by networkstatus_reset_warnings().

◆ nodelist_idx

int nodelist_idx

Position of the node within the list of nodes

Definition at line 42 of file node_st.h.

Referenced by node_free_(), and nodelist_drop_node().

◆ rejects_all

unsigned int rejects_all

Local info: we treat this node as if it rejects everything

Definition at line 85 of file node_st.h.

Referenced by compare_tor_addr_to_node_policy(), node_exit_policy_rejects_all(), and policies_set_node_exitpolicy_to_reject_all().

◆ ri

Definition at line 56 of file node_st.h.

◆ rs

Definition at line 57 of file node_st.h.


The documentation for this struct was generated from the following file: