From: Robert Ransom Date: Fri, 1 Oct 2010 07:07:10 +0000 (-0700) Subject: Add public_server_mode function. X-Git-Tag: tor-0.2.2.18-alpha~22^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89dffade8da372e296ae2d564dda102e9a7d566b;p=thirdparty%2Ftor.git Add public_server_mode function. --- diff --git a/src/or/router.c b/src/or/router.c index 8b3a1849ac..bc0e67c9b8 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 options 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 c17fc78bd0..4107c717c3 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);