[or-cvs] r17648: {tor} Make ALLOW_INVALID_* into an enum. (tor/trunk/src/or)

nickm at seul.org nickm at seul.org
Wed Dec 17 17:20:27 UTC 2008


Author: nickm
Date: 2008-12-17 12:20:26 -0500 (Wed, 17 Dec 2008)
New Revision: 17648

Modified:
   tor/trunk/src/or/or.h
Log:
Make ALLOW_INVALID_* into an enum.

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-12-17 17:20:22 UTC (rev 17647)
+++ tor/trunk/src/or/or.h	2008-12-17 17:20:26 UTC (rev 17648)
@@ -2072,11 +2072,14 @@
   return DOWNCAST(origin_circuit_t, x);
 }
 
-#define ALLOW_INVALID_ENTRY        1
-#define ALLOW_INVALID_EXIT         2
-#define ALLOW_INVALID_MIDDLE       4
-#define ALLOW_INVALID_RENDEZVOUS   8
-#define ALLOW_INVALID_INTRODUCTION 16
+/** Bitfield type: things that we're willing to use invalid routers for. */
+typedef enum invalid_router_usage_t {
+  ALLOW_INVALID_ENTRY       =1,
+  ALLOW_INVALID_EXIT        =2,
+  ALLOW_INVALID_MIDDLE      =4,
+  ALLOW_INVALID_RENDEZVOUS  =8,
+  ALLOW_INVALID_INTRODUCTION=16,
+} invalid_router_usage_t;
 
 /** An entry specifying a set of addresses and ports that should be remapped
  * to another address and port before exiting this exit node. */
@@ -2146,7 +2149,8 @@
 
   /** List of "entry", "middle", "exit", "introduction", "rendezvous". */
   smartlist_t *AllowInvalidNodes;
-  int _AllowInvalid; /**< Bitmask; derived from AllowInvalidNodes. */
+  /** Bitmask; derived from AllowInvalidNodes. */
+  invalid_router_usage_t _AllowInvalid;
   config_line_t *ExitPolicy; /**< Lists of exit policy components. */
   int ExitPolicyRejectPrivate; /**< Should we not exit to local addresses? */
   config_line_t *SocksPolicy; /**< Lists of socks policy components */



More information about the tor-commits mailing list