tor  0.4.2.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_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 28 of file node_st.h.

Member Function Documentation

◆ HT_ENTRY() [1/2]

node_t::HT_ENTRY ( node_t  )

Used to look up the node_t by its identity digest.

◆ HT_ENTRY() [2/2]

node_t::HT_ENTRY ( node_t  )

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

Field Documentation

◆ country

country_t node_t::country

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

Definition at line 87 of file node_st.h.

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

◆ ed25519_id

ed25519_public_key_t node_t::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 47 of file node_st.h.

Referenced by node_add_to_ed25519_map(), and node_remove_from_ed25519_map().

◆ identity

char node_t::identity[DIGEST_LEN]

◆ ipv6_preferred

unsigned int node_t::ipv6_preferred

True if the IPv6 OR port is preferred over the IPv4 OR port. XX/teor - can this become out of date if the torrc changes?

Definition at line 83 of file node_st.h.

◆ is_bad_exit

unsigned int node_t::is_bad_exit

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

Definition at line 65 of file node_st.h.

Referenced by dirserv_set_node_flags_from_authoritative_status(), and node_is_good_exit().

◆ is_exit

unsigned int node_t::is_exit

Do we think this is an OK exit?

Definition at line 64 of file node_st.h.

Referenced by node_is_good_exit().

◆ is_hs_dir

unsigned int node_t::is_hs_dir

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

Definition at line 67 of file node_st.h.

Referenced by dirauth_set_routerstatus_from_routerinfo().

◆ is_possible_guard

unsigned int node_t::is_possible_guard

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

Definition at line 63 of file node_st.h.

Referenced by node_is_possible_guard(), and node_is_unreliable().

◆ is_running

unsigned int node_t::is_running

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

Definition at line 57 of file node_st.h.

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

◆ is_stable

unsigned int node_t::is_stable

Do we think this is a fast OR?

Definition at line 62 of file node_st.h.

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

◆ is_valid

unsigned int node_t::is_valid

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

Definition at line 59 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 node_t::last_reachable

When was the last time we could reach this OR?

Definition at line 93 of file node_st.h.

Referenced by dirserv_set_router_is_running(), and node_addrs_changed().

◆ name_lookup_warned

unsigned int node_t::name_lookup_warned

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

Definition at line 72 of file node_st.h.

Referenced by networkstatus_reset_warnings().

◆ nodelist_idx

int node_t::nodelist_idx

Position of the node within the list of nodes

Definition at line 36 of file node_st.h.

Referenced by node_free_(), and nodelist_drop_node().

◆ rejects_all

unsigned int node_t::rejects_all

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

Definition at line 77 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().


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