]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
add a 'bridge' flag for dirserver config entries
authorRoger Dingledine <arma@torproject.org>
Mon, 7 May 2007 08:26:50 +0000 (08:26 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 7 May 2007 08:26:50 +0000 (08:26 +0000)
svn:r10128

doc/tor.1.in
src/or/config.c
src/or/or.h
src/or/router.c
src/or/routerlist.c

index b03e313ecb18b0a252746826c2aad87d1a004c85..261558169760f5835ce510044a8ce6a944ddc77d 100644 (file)
@@ -150,9 +150,11 @@ for current ("v2")-style directories, unless the "no-v2" flag is given.  If the
 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
index 838a2ef127a03e46014988484249312216374db3..960c2a34e02978b8f307821211a802ead398de70 100644 (file)
@@ -3444,7 +3444,8 @@ parse_dir_server_line(const char *line, int validate_only)
   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 @@ parse_dir_server_line(const char *line, int validate_only)
       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 @@ parse_dir_server_line(const char *line, int validate_only)
               (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);
 
   }
 
index a747a1f1f13fdb838e60f25fbc4ea8a7392f61f9..82585c3db155afbf58358198ca04b6468a9b1b64 100644 (file)
@@ -3011,6 +3011,8 @@ typedef struct trusted_dir_server_t {
   /** 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 @@ int router_exit_policy_rejects_all(routerinfo_t *router);
 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);
index ada3703da96422dbcc8fb3a3b59137d9ce01f946..30b55a562a58b19c0a0ce1a733270c5ec9412ad6 100644 (file)
@@ -378,6 +378,7 @@ init_keys(void)
                            digest,
                            options->V1AuthoritativeDir, /* v1 authority */
                            options->V2AuthoritativeDir, /* v2 authority */
+                           options->BridgeAuthoritativeDir, /* bridge auth */
                            options->HSAuthoritativeDir /*hidserv authority*/);
   }
   return 0; /* success */
index 7d8fb8d9f5e7835bbe5b4f5e969979b56abc66ee..af113dec9e4ee42fd4cd0f281e16a4e9edcfcf64 100644 (file)
@@ -3264,7 +3264,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)
 {
   trusted_dir_server_t *ent;
   uint32_t a;
@@ -3300,6 +3301,7 @@ add_trusted_dir_server(const char *nickname, const char *address,
   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);