summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-05-08 10:11:53 +0000
committerRoger Dingledine <arma@torproject.org>2007-05-08 10:11:53 +0000
commit54f5ab39b331a39081d568d4d4fc5d5e56ce4565 (patch)
tree5a5f7b0f585c51d808166dcd1e18fbf071b8be67 /src/or/circuitbuild.c
parent1d3bb103a4f10b22d8d779feabf6ebab784fd658 (diff)
downloadtor-54f5ab39b331a39081d568d4d4fc5d5e56ce4565.tar.gz
tor-54f5ab39b331a39081d568d4d4fc5d5e56ce4565.zip
record the router purpose at each step of the circuit path.
i have the feeling this will come in handy. svn:r10139
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 83a59fcd07..a555900ec0 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1732,9 +1732,19 @@ extend_info_from_router(routerinfo_t *r)
info->onion_key = crypto_pk_dup_key(r->onion_pkey);
info->addr = r->addr;
info->port = r->or_port;
+ info->router_purpose = r->purpose;
return info;
}
+/** What router purpose is <b>digest</b>?
+ * It's a general purpose router unless it's on our bridges list.
+ */
+static uint8_t
+get_router_purpose_from_digest(char *digest) {
+ (void)digest;
+ return ROUTER_PURPOSE_GENERAL; /* XXX020 */
+}
+
/** Allocate and return a new extend_info_t that can be used to build a
* circuit to or through the router <b>r</b>. */
extend_info_t *
@@ -1748,6 +1758,7 @@ extend_info_from_routerstatus(routerstatus_t *s)
info->onion_key = NULL; /* routerstatus doesn't know this */
info->addr = s->addr;
info->port = s->or_port;
+ info->router_purpose = get_router_purpose_from_digest(info->identity_digest);
return info;
}