mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
add a 'bridge' flag for dirserver config entries
svn:r10128
This commit is contained in:
+6
-3
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
+3
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user