diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-09-28 13:29:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-10-01 18:14:26 -0400 |
commit | fe309e7ad633bee36e175e600f0b9a0ac18cf981 (patch) | |
tree | 5e4bc848a6c65ec4eb91f8994ab9980a5ec20fb0 /src/or/nodelist.h | |
parent | 80b515b85fdfbcd645cb1920e398b3f2f6e85a31 (diff) | |
download | tor-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/nodelist.h')
-rw-r--r-- | src/or/nodelist.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/or/nodelist.h b/src/or/nodelist.h new file mode 100644 index 0000000000..6a77ba6836 --- /dev/null +++ b/src/or/nodelist.h @@ -0,0 +1,28 @@ +/* Copyright (c) 2001 Matej Pfajfar. + * Copyright (c) 2001-2004, Roger Dingledine. + * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. + * Copyright (c) 2007-2010, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * \file microdesc.h + * \brief Header file for microdesc.c. + **/ + +#ifndef _TOR_NODELIST_H +#define _TOR_NODELIST_H + +node_t *node_get_by_id(const char *identity_digest); +node_t *nodelist_add_routerinfo(routerinfo_t *ri); +node_t *nodelist_add_microdesc(microdesc_t *md); +void nodelist_set_consensus(networkstatus_t *ns); + +void nodelist_remove_microdesc(const char *identity_digest, microdesc_t *md); +void nodelist_remove_routerinfo(routerinfo_t *ri); +void nodelist_purge(void); + +void nodelist_free_all(void); +void nodelist_assert_ok(void); + +#endif + |