[or-cvs] r10128: add a 'bridge' flag for dirserver config entries (in tor/trunk: doc src/or)

arma at seul.org arma at seul.org
Mon May 7 08:26:57 UTC 2007


Author: arma
Date: 2007-05-07 04:26:50 -0400 (Mon, 07 May 2007)
New Revision: 10128

Modified:
   tor/trunk/doc/tor.1.in
   tor/trunk/src/or/config.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/router.c
   tor/trunk/src/or/routerlist.c
Log:
add a 'bridge' flag for dirserver config entries


Modified: tor/trunk/doc/tor.1.in
===================================================================
--- tor/trunk/doc/tor.1.in	2007-05-07 05:19:50 UTC (rev 10127)
+++ tor/trunk/doc/tor.1.in	2007-05-07 08:26:50 UTC (rev 10128)
@@ -150,9 +150,11 @@
 authority for old-style (v1) directories as well.  (Only directory mirrors
 care about this.)  Tor will use this server as an authority for hidden
 service information if the "hs" flag is set, or if the "v1" flag is set and
-the "no-hs" flag is \fBnot\fP set.  If a flag "orport=\fBport\fR" is given,
-Tor will use the given port when opening encrypted tunnels to the
-dirserver.
+the "no-hs" flag is \fBnot\fP set.  Tor will use this authority as a bridge
+authoritative directory if the "bridge" flag is set.  Lastly, if a flag
+"orport=\fBport\fR" is given, Tor will use the given port when opening
+encrypted tunnels to the dirserver.
+
 If no \fBdirserver\fP line is given, Tor will use the default
 directory servers.  NOTE: this option is intended
 for setting up a private Tor network with its own directory authorities.  If

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2007-05-07 05:19:50 UTC (rev 10127)
+++ tor/trunk/src/or/config.c	2007-05-07 08:26:50 UTC (rev 10128)
@@ -3444,7 +3444,8 @@
   uint16_t dir_port = 0, or_port = 0;
   char digest[DIGEST_LEN];
   int is_v1_authority = 0, is_hidserv_authority = 0,
-    is_not_hidserv_authority = 0, is_v2_authority = 1;
+    is_not_hidserv_authority = 0, is_v2_authority = 1,
+    is_bridge_authority = 0;
 
   items = smartlist_create();
   smartlist_split_string(items, line, NULL,
@@ -3469,6 +3470,8 @@
       is_hidserv_authority = 1;
     } else if (!strcasecmp(flag, "no-hs")) {
       is_not_hidserv_authority = 1;
+    } else if (!strcasecmp(flag, "bridge")) {
+      is_bridge_authority = 1;
     } else if (!strcasecmp(flag, "no-v2")) {
       is_v2_authority = 0;
     } else if (!strcasecmpstart(flag, "orport=")) {
@@ -3519,8 +3522,8 @@
               (int)dir_port,
               (char*)smartlist_get(items,1));
     add_trusted_dir_server(nickname, address, dir_port, or_port, digest,
-                           is_v1_authority,
-                           is_v2_authority, is_hidserv_authority);
+                           is_v1_authority, is_v2_authority,
+                           is_bridge_authority, is_hidserv_authority);
 
   }
 

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-05-07 05:19:50 UTC (rev 10127)
+++ tor/trunk/src/or/or.h	2007-05-07 08:26:50 UTC (rev 10128)
@@ -3011,6 +3011,8 @@
   /** True iff this server is an authority for the newer ("v2") directory
    * protocol. */
   unsigned int is_v2_authority:1;
+  /** True iff this server is an authority for bridge relays. */
+  unsigned int is_bridge_authority:1;
   /** True iff this server is an authority for hidden services. */
   unsigned int is_hidserv_authority:1;
   /** True iff this server has accepted the most recent server descriptor
@@ -3115,7 +3117,8 @@
 void add_trusted_dir_server(const char *nickname, const char *address,
                             uint16_t dir_port, uint16_t or_port,
                             const char *digest, int is_v1_authority,
-                            int is_v2_authority, int is_hidserv_authority);
+                            int is_v2_authority, int is_bridge_authority,
+                            int is_hidserv_authority);
 void clear_trusted_dir_servers(void);
 int any_trusted_dir_is_v1_authority(void);
 networkstatus_t *networkstatus_get_by_digest(const char *digest);

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2007-05-07 05:19:50 UTC (rev 10127)
+++ tor/trunk/src/or/router.c	2007-05-07 08:26:50 UTC (rev 10128)
@@ -378,6 +378,7 @@
                            digest,
                            options->V1AuthoritativeDir, /* v1 authority */
                            options->V2AuthoritativeDir, /* v2 authority */
+                           options->BridgeAuthoritativeDir, /* bridge auth */
                            options->HSAuthoritativeDir /*hidserv authority*/);
   }
   return 0; /* success */

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-05-07 05:19:50 UTC (rev 10127)
+++ tor/trunk/src/or/routerlist.c	2007-05-07 08:26:50 UTC (rev 10128)
@@ -3264,7 +3264,8 @@
 add_trusted_dir_server(const char *nickname, const char *address,
                        uint16_t dir_port, uint16_t or_port,
                        const char *digest, int is_v1_authority,
-                       int is_v2_authority, int is_hidserv_authority)
+                       int is_v2_authority, int is_bridge_authority,
+                       int is_hidserv_authority)
 {
   trusted_dir_server_t *ent;
   uint32_t a;
@@ -3300,6 +3301,7 @@
   ent->is_running = 1;
   ent->is_v1_authority = is_v1_authority;
   ent->is_v2_authority = is_v2_authority;
+  ent->is_bridge_authority = is_bridge_authority;
   ent->is_hidserv_authority = is_hidserv_authority;
   memcpy(ent->digest, digest, DIGEST_LEN);
 



More information about the tor-commits mailing list