aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-22 16:37:20 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-22 16:37:20 +0000
commit167d266dbf618c856a87ac482668cd848651ab62 (patch)
treecb4e77e7d54d2dc8384e1455dda9ebd5de421d1e /src/or/or.h
parent1e666bfcc105b6b650c072c10074d009dcdc50d3 (diff)
downloadtor-167d266dbf618c856a87ac482668cd848651ab62.tar
tor-167d266dbf618c856a87ac482668cd848651ab62.tar.gz
Documentation and conformance for WRA_* returns.
shahn: "Add some documentation for the WRA_* family of functions, also make sure that (hopefully) all functions that return was_router_added_t don't return ints directly and that they don't refer to integers in their documentation anymore." svn:r17731
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h
index ffb989443..ff578b0b4 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -4385,19 +4385,25 @@ typedef enum was_router_added_t {
static int WRA_WAS_ADDED(was_router_added_t s);
static int WRA_WAS_OUTDATED(was_router_added_t s);
static int WRA_WAS_REJECTED(was_router_added_t s);
-/**DOCDOC*/
+/** Return true iff the descriptor was added. It might still be necessary to
+ * check whether the descriptor generator should be notified.
+ */
static INLINE int
WRA_WAS_ADDED(was_router_added_t s) {
return s == ROUTER_ADDED_SUCCESSFULLY || s == ROUTER_ADDED_NOTIFY_GENERATOR;
}
-/**DOCDOC*/
+/** Return true iff the descriptor was not added because it was either:
+ * - not in the consensus
+ * - neither in the consensus nor in any networkstatus document
+ * - it was outdated.
+ */
static INLINE int WRA_WAS_OUTDATED(was_router_added_t s)
{
return (s == ROUTER_WAS_NOT_NEW ||
s == ROUTER_NOT_IN_CONSENSUS ||
s == ROUTER_NOT_IN_CONSENSUS_OR_NETWORKSTATUS);
}
-/**DOCDOC*/
+/** Return true iff the descriptor rejected because it was malformed. */
static INLINE int WRA_WAS_REJECTED(was_router_added_t s)
{
return (s == ROUTER_AUTHDIR_REJECTS);