aboutsummaryrefslogtreecommitdiff
path: root/src/or/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-11-14 20:45:47 +0000
committerNick Mathewson <nickm@torproject.org>2003-11-14 20:45:47 +0000
commita8eaa79e031ee04d44d9ed919ed77c7a2e0acba2 (patch)
tree5fc60ec64ad07b6b2ecc6ce4c44eae22e61e7398 /src/or/test.c
parent273da1d3c425464dffa525a853096d0dde93aafb (diff)
downloadtor-a8eaa79e031ee04d44d9ed919ed77c7a2e0acba2.tar.gz
tor-a8eaa79e031ee04d44d9ed919ed77c7a2e0acba2.zip
Improved exit policy syntax; basic client-side DNS caching.
- Exit policies now support bitmasks (18.0.0.0/255.0.0.0) and bitcounts 18.0.0.0/8. Policies are parsed on startup, not when comparing to them. - desired_path_len is now part of an opaque cpath_build_state_t structure. - END_REASON_EXITPOLICY cells no longer include a port. - RELAY_COMMAND_CONNECTED cells now include the IP address we've connected to. - connection_edge now has a client_dns cache to remember resolved addresses. It gets populated by RELAY_COMMAND_CONNECTED cells and END_REASON_EXITPOLICY cells. It gets used by connection_ap_handshake_send_begin. We don't compare it to exit policies yet. svn:r812
Diffstat (limited to 'src/or/test.c')
-rw-r--r--src/or/test.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 688335ab1c..9f2c97edcb 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -558,12 +558,14 @@ test_dir_format()
ex1.policy_type = EXIT_POLICY_ACCEPT;
ex1.string = NULL;
- ex1.address = "*";
- ex1.port = "80";
+ ex1.addr = 0;
+ ex1.msk = 0;
+ ex1.prt = 80;
ex1.next = &ex2;
ex2.policy_type = EXIT_POLICY_REJECT;
- ex2.address = "18.*";
- ex2.port = "24";
+ ex2.addr = 18 << 24;
+ ex2.msk = 0xFF000000u;
+ ex2.prt = 24;
ex2.next = NULL;
r2.address = "tor.tor.tor";
r2.addr = 0x0a030201u; /* 10.3.2.1 */