summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-05-07 08:26:50 +0000
committerRoger Dingledine <arma@torproject.org>2007-05-07 08:26:50 +0000
commitf8a8b27dd2b76ddae26fcf51304b626f6aada9ca (patch)
treed5a5146ccc153a04957fa70baba62eba9e89ed95
parent5ea3f37db7f39ae2204d972f651ddb966c5164ca (diff)
downloadtor-f8a8b27dd2b76ddae26fcf51304b626f6aada9ca.tar.gz
tor-f8a8b27dd2b76ddae26fcf51304b626f6aada9ca.zip
add a 'bridge' flag for dirserver config entries
svn:r10128
-rw-r--r--doc/tor.1.in8
-rw-r--r--src/or/config.c9
-rw-r--r--src/or/or.h5
-rw-r--r--src/or/router.c1
-rw-r--r--src/or/routerlist.c4
5 files changed, 19 insertions, 8 deletions
diff --git a/doc/tor.1.in b/doc/tor.1.in
index b03e313ecb..2615581697 100644
--- a/doc/tor.1.in
+++ b/doc/tor.1.in
@@ -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
diff --git a/src/or/config.c b/src/or/config.c
index 838a2ef127..960c2a34e0 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -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);
}
diff --git a/src/or/or.h b/src/or/or.h
index a747a1f1f1..82585c3db1 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -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);
diff --git a/src/or/router.c b/src/or/router.c
index ada3703da9..30b55a562a 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -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 */
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 7d8fb8d9f5..af113dec9e 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -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);