[or-cvs] [tor/master 1/7] Add public_server_mode function.

nickm at torproject.org nickm at torproject.org
Thu Oct 21 20:21:08 UTC 2010


Author: Robert Ransom <rransom.8774 at gmail.com>
Date: Fri, 1 Oct 2010 00:07:10 -0700
Subject: Add public_server_mode function.
Commit: 89dffade8da372e296ae2d564dda102e9a7d566b

---
 src/or/router.c |    9 +++++++++
 src/or/router.h |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/or/router.c b/src/or/router.c
index 8b3a184..bc0e67c 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -976,6 +976,15 @@ server_mode(or_options_t *options)
   return (options->ORPort != 0 || options->ORListenAddress);
 }
 
+/** Return true iff we are trying to be a non-bridge server.
+ */
+int
+public_server_mode(or_options_t *options)
+{
+  if (!server_mode(options)) return 0;
+  return (!options->BridgeRelay);
+}
+
 /** Return true iff the combination of options in <b>options</b> and parameters
  * in the consensus mean that we don't want to allow exits from circuits
  * we got from addresses not known to be servers. */
diff --git a/src/or/router.h b/src/or/router.h
index c17fc78..4107c71 100644
--- a/src/or/router.h
+++ b/src/or/router.h
@@ -48,6 +48,7 @@ int authdir_mode_tests_reachability(or_options_t *options);
 int authdir_mode_bridge(or_options_t *options);
 
 int server_mode(or_options_t *options);
+int public_server_mode(or_options_t *options);
 int advertised_server_mode(void);
 int proxy_mode(or_options_t *options);
 void consider_publishable_server(int force);
-- 
1.7.1




More information about the tor-commits mailing list