diff options
author | Roger Dingledine <arma@torproject.org> | 2002-07-02 09:36:58 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-07-02 09:36:58 +0000 |
commit | d982925593dbb724e4c8ebeb4f945c2184f11831 (patch) | |
tree | c3f22938ad261f3c45ed2744ae0950388c1c04e8 /src/or/routers.c | |
parent | b34fad4d38ac9c45eb2112fa9dde26e499ccdcc5 (diff) | |
download | tor-d982925593dbb724e4c8ebeb4f945c2184f11831.tar.gz tor-d982925593dbb724e4c8ebeb4f945c2184f11831.zip |
Integrated onion proxy into or/
The 'or' process can now be told (by the global_role variable) what
roles this server should play -- connect to all ORs, listen for ORs,
listen for OPs, listen for APs, or any combination.
* everything in /src/op/ is now obsolete.
* connection_ap.c now handles all interactions with application proxies
* "port" is now or_port, op_port, ap_port. But routers are still always
referenced (say, in conn_get_by_addr_port()) by addr / or_port. We
should make routers.c actually read these new ports (currently I've
kludged it so op_port = or_port+10, ap_port=or_port+20)
* circuits currently know if they're at the beginning of the path because
circ->cpath is set. They use this instead for crypts (both ways),
if it's set.
* I still obey the "send a 0 back to the AP when you're ready" protocol,
but I think we should phase it out. I can simply not read from the AP
socket until I'm ready.
I need to do a lot of cleanup work here, but the code appears to work, so
now's a good time for a checkin.
svn:r22
Diffstat (limited to 'src/or/routers.c')
-rw-r--r-- | src/or/routers.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/or/routers.c b/src/or/routers.c index d24d4d1bdb..9a673aeefb 100644 --- a/src/or/routers.c +++ b/src/or/routers.c @@ -163,11 +163,14 @@ routerinfo_t **getrouters(char *routerfile, size_t *lenp) if (token) { log(LOG_DEBUG,"getrouters():Token :%s",token); - router->port = (uint16_t)strtoul(token,&errtest,0); + router->or_port = (uint16_t)strtoul(token,&errtest,0); if ((*token != '\0') && (*errtest == '\0')) /* conversion was successful */ { +/* FIXME patch from RD. We should make it actually read these. */ + router->op_port = htons(router->or_port + 10); + router->ap_port = htons(router->or_port + 20); /* convert port to network format */ - router->port = htons(router->port); + router->or_port = htons(router->or_port); /* read min bandwidth */ token = (char *)strtok(NULL,OR_ROUTERLIST_SEPCHARS); @@ -204,7 +207,8 @@ routerinfo_t **getrouters(char *routerfile, size_t *lenp) retp=fgets(line,512,rf); if (!retp) { - log(LOG_ERR,"Could not find a public key entry for router %s:%u.",router->address,router->port); + log(LOG_ERR,"Could not find a public key entry for router %s:%u.", + router->address,router->or_port); free((void *)router->address); free((void *)router); fclose(rf); @@ -233,7 +237,8 @@ routerinfo_t **getrouters(char *routerfile, size_t *lenp) } else /* we found something else; this isn't right */ { - log(LOG_ERR,"Could not find a public key entry for router %s:%u.",router->address,router->port); + log(LOG_ERR,"Could not find a public key entry for router %s:%u.", + router->address,router->or_port); free((void *)router->address); free((void *)router); fclose(rf); @@ -247,7 +252,8 @@ routerinfo_t **getrouters(char *routerfile, size_t *lenp) router->pkey = PEM_read_RSAPublicKey(rf,&router->pkey,NULL,NULL); if (!router->pkey) /* something went wrong */ { - log(LOG_ERR,"Could not read public key for router %s:%u.",router->address,router->port); + log(LOG_ERR,"Could not read public key for router %s:%u.", + router->address,router->or_port); free((void *)router->address); free((void *)router); fclose(rf); @@ -259,7 +265,7 @@ routerinfo_t **getrouters(char *routerfile, size_t *lenp) log(LOG_DEBUG,"getrouters():Public key size = %u.", RSA_size(router->pkey)); if (RSA_size(router->pkey) != 128) /* keys MUST be 1024 bits in size */ { - log(LOG_ERR,"Key for router %s:%u is not 1024 bits. All keys must be exactly 1024 bits long.",router->address,router->port); + log(LOG_ERR,"Key for router %s:%u is not 1024 bits. All keys must be exactly 1024 bits long.",router->address,router->or_port); free((void *)router->address); RSA_free(router->pkey); free((void *)router); |