summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-28 13:29:31 -0400
committerNick Mathewson <nickm@torproject.org>2010-10-01 18:14:26 -0400
commitfe309e7ad633bee36e175e600f0b9a0ac18cf981 (patch)
tree5e4bc848a6c65ec4eb91f8994ab9980a5ec20fb0 /src/or/or.h
parent80b515b85fdfbcd645cb1920e398b3f2f6e85a31 (diff)
downloadtor-fe309e7ad633bee36e175e600f0b9a0ac18cf981.tar.gz
tor-fe309e7ad633bee36e175e600f0b9a0ac18cf981.zip
Implement a basic node and nodelist type
The node_t type is meant to serve two key functions: 1) Abstracting difference between routerinfo_t and microdesc_t so that clients can use microdesc_t instead of routerinfo_t. 2) Being a central place to hold mutable state about nodes formerly held in routerstatus_t and routerinfo_t. This patch implements a nodelist type that holds a node for every router that we would consider using.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 673a3920cf..e46237c365 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1698,6 +1698,19 @@ typedef struct microdesc_t {
* XXX this probably should not stay a string. */
} microdesc_t;
+/** DOCDOC */
+typedef struct node_t {
+ /** Used to look up the node_t by its identity digest. */
+ HT_ENTRY(node_t) ht_ent;
+ /** Position of the node within the list of nodes */
+ int nodelist_idx;
+
+ char identity[DIGEST_LEN];
+ microdesc_t *md;
+ routerinfo_t *ri;
+ routerstatus_t *rs;
+} node_t;
+
/** How many times will we try to download a router's descriptor before giving
* up? */
#define MAX_ROUTERDESC_DOWNLOAD_FAILURES 8