summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-05-17 20:31:01 +0000
committerNick Mathewson <nickm@torproject.org>2004-05-17 20:31:01 +0000
commit50b7ebcf9e5b2c6f9fa1f8be470e34e0789c772f (patch)
tree29f8b52d6c44c4969f816ffcf52257bd5c02a866 /src/or/or.h
parentd9bcb23f769b4f9137956eae9e4ccf240b3cb686 (diff)
downloadtor-50b7ebcf9e5b2c6f9fa1f8be470e34e0789c772f.tar.gz
tor-50b7ebcf9e5b2c6f9fa1f8be470e34e0789c772f.zip
Make directory functions update routerlist, not replace it. Add notion of OR-is-trusted-to-be-a-dirserver. Arma, please review: does this handle being a dirserver right?
svn:r1880
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 924131cf73..8cc42cd9f2 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -542,7 +542,6 @@ typedef struct {
crypto_pk_env_t *onion_pkey; /**< Public RSA key for onions. */
crypto_pk_env_t *identity_pkey; /**< Public RSA key for signing. */
- int is_running; /**< As far as we know, is this OR currently running? */
char *platform; /**< What software/operating system is this OR using? */
@@ -552,6 +551,10 @@ typedef struct {
uint32_t bandwidthburst; /**< How large is this OR's token bucket? */
struct exit_policy_t *exit_policy; /**< What streams will this OR permit
* to exit? */
+ /* local info */
+ int is_running; /**< As far as we know, is this OR currently running? */
+ int is_trusted_dir; /**< Do we trust this OR as a directory server? */
+
} routerinfo_t;
#define MAX_ROUTERS_IN_DIR 1024
@@ -561,7 +564,9 @@ typedef struct {
smartlist_t *routers;
/** Which versions of tor are recommended by this directory? */
char *software_versions;
- /** When was this directory published? */
+ /** When was the most recent directory that contributed to this list
+ * published?
+ */
time_t published_on;
} routerlist_t;
@@ -1284,12 +1289,13 @@ routerinfo_t *router_get_by_addr_port(uint32_t addr, uint16_t port);
routerinfo_t *router_get_by_nickname(char *nickname);
void router_get_routerlist(routerlist_t **prouterlist);
void routerlist_free(routerlist_t *routerlist);
+void routerlist_clear_trusted_directories(void);
void routerinfo_free(routerinfo_t *router);
routerinfo_t *routerinfo_copy(const routerinfo_t *router);
void router_mark_as_down(char *nickname);
-int router_set_routerlist_from_file(char *routerfile);
-int router_set_routerlist_from_string(const char *s);
-int router_set_routerlist_from_directory(const char *s, crypto_pk_env_t *pkey);
+int router_load_routerlist_from_file(char *routerfile, int trusted);
+int router_load_routerlist_from_string(const char *s, int trusted);
+int router_load_routerlist_from_directory(const char *s,crypto_pk_env_t *pkey);
int router_compare_addr_to_exit_policy(uint32_t addr, uint16_t port,
struct exit_policy_t *policy);
#define ADDR_POLICY_ACCEPTED 0