Commit Graph

413 Commits

Author SHA1 Message Date
Nick Mathewson
ab2fc7bd62 r11596@Kushana: nickm | 2006-12-15 10:57:12 -0500
Mark some TODO items as done.  Also, never include ourself in our family list.


svn:r9131
2006-12-15 21:26:15 +00:00
Roger Dingledine
c4ed331d8d oh, and catch the other instance we should fix
svn:r9122
2006-12-15 08:14:32 +00:00
Roger Dingledine
0bc0688668 if we rotate our onion key, publish a new descriptor, and
die soon after, we want to stick with that onion key when
we restart.


svn:r9121
2006-12-15 07:58:31 +00:00
Nick Mathewson
38bd6837db r11588@Kushana: nickm | 2006-12-15 02:04:32 -0500
Add a LastRotatedOnionKey variable to the state file, so we can rotate onion keys a week after they change even if we never stay up for a whole week at a time.  Should fix bug 368.


svn:r9120
2006-12-15 07:04:37 +00:00
Roger Dingledine
97c83a4c09 finish enabling begin-dir cells. require one-hop circs for
socks-command-connect-dir streams, so we don't open new anonymity
questions.


svn:r9099
2006-12-13 02:49:45 +00:00
Roger Dingledine
0dbf725927 Infrastructure to test BEGIN_DIR cells.
New socks command CONNECT_DIR. New config option TunnelDirConns that
builds a circ ending at the directory server and delivers a BEGIN_DIR
cell if it's running 0.1.2.2-alpha or later. We still need to make
one-hop circs when appropriate, while making other conns avoid them.


svn:r9098
2006-12-13 00:28:56 +00:00
Roger Dingledine
ab68e312bd actually, i think this fix was closest to what i originally
intended. this way we don't call resolve-my-address, which
yells and screams if we're using an internal address (mere
clients should not have to care).


svn:r8998
2006-11-26 20:01:45 +00:00
Nick Mathewson
116ae04c2d r9399@totoro: nickm | 2006-11-26 14:22:17 -0500
Actually, clients *should* try to guess their addresses.


svn:r8997
2006-11-26 19:22:25 +00:00
Nick Mathewson
68142b18cd r9396@totoro: nickm | 2006-11-26 13:36:29 -0500
Fix router_new_address_suggestion() so it only changes last_guessed_ip() when it actually calls resolve_my_address(). (bug found by dev-girl)


svn:r8996
2006-11-26 18:36:51 +00:00
Nick Mathewson
1bf1f9d2fc r9449@Kushana: nickm | 2006-10-31 00:12:02 -0500
Dump breakdown of PK operations when we get a USR2 signal.  This should help us figure out of we are doing some of them for stupid reasons.


svn:r8881
2006-10-31 19:17:07 +00:00
Nick Mathewson
829bf4dcd0 r8970@totoro: nickm | 2006-10-09 10:12:53 -0400
Win32 patch from Matt Edman: fix compilation bugs by casting to int; defining SSIZE_T; defining USE_TWOS_COMPLEMENT in windows orconfig.h; and using the proper names for win32 functions on GetProcAddress. Also fixes bug 295.


svn:r8669
2006-10-09 15:46:21 +00:00
Nick Mathewson
c6f2d725d0 r8957@totoro: nickm | 2006-10-08 22:35:17 -0400
The otherwise regrettable MIPSpro C compiler warns about values set but never used, and about mixing enums and ints; these are good warnings, and so should be fixed.  This removes some dead code and some potential bugs. Thanks to pnx.


svn:r8664
2006-10-09 02:35:51 +00:00
Roger Dingledine
06e5b2283c minor cleanups
svn:r8622
2006-10-07 00:50:39 +00:00
Roger Dingledine
baf208d7b3 bugfix: When testing reachability of our dirport, don't launch a new
test if there's already one in progress.


svn:r8604
2006-10-06 04:02:27 +00:00
Nick Mathewson
6e0b90a902 r8838@totoro: nickm | 2006-10-02 15:24:39 -0400
Partial implementation of revised nickname syntax for controllers.  Implement ability to look up routers by "verbose" nicknames; add a per-v1-control-connection flag to turn the feature on in events.  Needs testing, spec, ability to actually turn on the flag, double-checking that we wont overflow any nickname buffers, and changelog.


svn:r8582
2006-10-03 18:58:40 +00:00
Roger Dingledine
a3efc8e3d1 - V1 authorities should set "HSAuthoritativeDir 1" to continue being
hidden service authorities too.
- Just because your DirPort is open doesn't mean people should be
  able to remotely teach you about hidden service descriptors. Now
  only accept rendezvous posts if you've got HSAuthoritativeDir set.


svn:r8573
2006-10-01 22:16:55 +00:00
Roger Dingledine
e6f4431722 stop trying to hammer router_rebuild_descriptor() when we don't
have a public address we like yet.


svn:r8554
2006-09-30 20:40:26 +00:00
Nick Mathewson
c2d304366b r9032@Kushana: nickm | 2006-09-29 18:51:42 -0400
Now, all log messages should be distinct.


svn:r8545
2006-09-29 22:51:47 +00:00
Nick Mathewson
7d366f61cb r9025@Kushana: nickm | 2006-09-29 18:33:13 -0400
Differentiate more duplicated log entries


svn:r8542
2006-09-29 22:33:40 +00:00
Nick Mathewson
0335bd51d3 r9005@Kushana: nickm | 2006-09-29 10:37:55 -0400
Implement DESCCHANGED event to tell controller when our router descriptor changes.


svn:r8533
2006-09-29 18:13:25 +00:00
Nick Mathewson
907fc6c73e r8977@Kushana: nickm | 2006-09-28 19:56:41 -0400
Make "is a v1 authority", "is a v2 authority", and "is a hidden service authority" into separate flags so we can eventually migrate more trust away from moria.


svn:r8523
2006-09-28 23:57:59 +00:00
Nick Mathewson
adade79f68 r8879@Kushana: nickm | 2006-09-21 17:20:31 -0400
Oops from earlier patch; add "opt eventdns" to unittests, fix bug in routerdesc generation.


svn:r8444
2006-09-21 21:49:03 +00:00
Nick Mathewson
a942441615 r8872@Kushana: nickm | 2006-09-21 14:00:20 -0400
Implement server-side reverse DNS using eventdns.  Add an option to routerdescs so we can tell which servers have eventdns enabled.


svn:r8437
2006-09-21 21:48:06 +00:00
Nick Mathewson
5ebb949c9f Stop searching routerlist for routers with the same identity as other routers (on router insert): we already have a map for that. (We need to add an index field to routerinfo_t so we can figure out which point in the routerlist to replace.) Also, add a comment to routerlist.c; arma, please advise?
svn:r8432
2006-09-19 23:18:30 +00:00
Roger Dingledine
bfa78b3dea actually, do the bandwidth test anyway, if you've been up at
least 6 hours at your previous address.


svn:r8403
2006-09-15 18:07:11 +00:00
Roger Dingledine
a51ec44466 avoid thrashing the bandwidth exercise when we change IPs a lot.
(we avoid simply by not doing any new tests when we change IPs --
it looks like we retain our previous bandwidth estimates, so there's
no need to do new exercise. though in some cases new exercises may
still be useful. one day we'll do something smarter.)


svn:r8402
2006-09-15 18:03:53 +00:00
Roger Dingledine
c22dc94fe6 make my bandwidth exercises actually happen
svn:r8400
2006-09-15 05:53:00 +00:00
Roger Dingledine
769f9201a6 Send out a burst of long-range drop cells after we've established that
we're reachable. Spread them over 4 circuits, so hopefully a few will
be fast. This exercises our bandwidth and bootstraps us quicker.


svn:r8399
2006-09-15 05:30:25 +00:00
Nick Mathewson
e58b9c1151 r8819@Kushana: nickm | 2006-09-15 00:27:45 -0400
Implement a smartlist_uniq() that will with luck not end the world.


svn:r8396
2006-09-15 04:27:58 +00:00
Peter Palfrader
2cf6cfe189 r9758@danube: weasel | 2006-09-14 07:10:12 +0200
Add a comment


svn:r8391
2006-09-14 05:17:02 +00:00
Peter Palfrader
7fcec09560 r9753@danube: weasel | 2006-09-14 07:07:02 +0200
Remove duplicates from MyFamily


svn:r8390
2006-09-14 05:07:34 +00:00
Peter Palfrader
984e8f6efb r9736@danube: weasel | 2006-09-14 05:53:06 +0200
Refactor dirserv_parse_fingerprint_file(fname) into dirserv_load_fingerprint_file():
 There is not need to put together the path to the approved-routers file in more than one place.


svn:r8386
2006-09-14 04:53:23 +00:00
Roger Dingledine
e56dbb810f start remembering X-Your-Address-Is hints even if you're
a client, so you can become a server more smoothly.


svn:r8359
2006-09-09 19:36:51 +00:00
Roger Dingledine
5f6351ceb3 fix typo, add log message
svn:r8357
2006-09-09 19:16:07 +00:00
Roger Dingledine
29b6d6560e add a "getinfo address" controller command.
svn:r8354
2006-09-09 03:18:39 +00:00
Roger Dingledine
43edbf0461 prefer calling it a client rather than an OP
svn:r8334
2006-09-07 01:00:37 +00:00
Nick Mathewson
4ff4577beb r6908@Kushana: nickm | 2006-07-26 12:38:52 -0400
Refactor connection_t into edge, or, dir, control, and base subtypes.  This might save some RAM on busy exit servers, but really matters most in terms of correctness.


svn:r6906
2006-07-26 19:07:26 +00:00
Roger Dingledine
e1f30a5f21 when we find our dirport to be reachable, mark our descriptor
dirty so we'll tell the world. (fixes bug 306 reported by pnx)


svn:r6787
2006-07-18 03:06:55 +00:00
Roger Dingledine
ac258d2cc8 Start publishing one minute or so after we find our ORPort
to be reachable. This will help reduce the number of descriptors
we have for ourselves floating around, since it's quite likely
other things (e.g. DirPort) will change during that minute too.


svn:r6786
2006-07-18 03:06:12 +00:00
Roger Dingledine
c85745cfe2 parameterize the loudness of log_addr_has_changed(), since it's the
only place where we inform the user of a new IP address, if we're
guessing it from external sources.


svn:r6780
2006-07-17 19:33:54 +00:00
Roger Dingledine
542adb88d7 Make a louder statement the first time we learn a guessed
IP address.


svn:r6779
2006-07-17 08:17:51 +00:00
Roger Dingledine
a2a89da693 and don't try to build the descriptor every second, if it's dirty
but we don't have a known address.


svn:r6777
2006-07-17 06:59:56 +00:00
Roger Dingledine
42e2057d67 fix some more places where we shouldn't crash if we can't build
our own descriptor yet.


svn:r6775
2006-07-17 06:54:28 +00:00
Roger Dingledine
9db7b2c068 Allow servers with no hostname or IP address to learn their IP address
by asking the directory authorities. This code only kicks in when you
would normally have exited with a "no address" error.

This design is flawed, though, since the X-Your-Address-Is header is not
authenticated, and doing it this way introduces too many new attacks. The
right answer is to give IP address hints inside the HELLO cell; much of
this code can be reused when we switch.


svn:r6774
2006-07-17 06:35:06 +00:00
Roger Dingledine
ee5f512e13 parameterize the loudness of resolve_my_address(), and call things
IP addresses, not IPs.


svn:r6764
2006-07-15 20:26:05 +00:00
Roger Dingledine
05d0b70573 Get rid of the router_retry_connections notion. Now routers no longer
try to rebuild long-term connections to directory authorities, and
directory authorities no longer try to rebuild long-term connections to
all servers.

We still don't hang up connections in these two cases though -- we need
to look at it more carefully to avoid flapping, and we likely need to
wait til 0.1.1.x is obsolete.


svn:r6712
2006-07-04 03:31:27 +00:00
Nick Mathewson
b7910202a3 Next batch of memory miserdom: mmap cached-routers file. This is sure to break somewhere.
svn:r6675
2006-06-22 07:01:54 +00:00
Roger Dingledine
2cd349903c be more lax about recognizing valid hexdigests.
svn:r6619
2006-06-13 12:05:59 +00:00
Roger Dingledine
0bfef523df simplify the tortls api: we only support being a "server", that
is, even tor clients do the same sort of handshake.

this has been true for years, so it's best to get rid of the
stale code.


svn:r6557
2006-06-07 06:10:54 +00:00
Nick Mathewson
853e2d99b6 Add a new warning to our "warn a lot" list: unused parameters. This means we have to explicitly "use" unuseds, but it can catch bugs. (It caught two coding mistakes so far.)
svn:r6532
2006-06-04 22:42:13 +00:00
Roger Dingledine
82ae38f649 be more verbose about testing reachability of our ORPort.
svn:r6506
2006-05-26 16:29:33 +00:00
Roger Dingledine
3c86402cc2 petty cleanups
svn:r6421
2006-04-25 07:00:04 +00:00
Roger Dingledine
934e9c49bb Regenerate our local descriptor if it's dirty and some local
function asks for it. This may resolve bug 286.


svn:r6412
2006-04-23 23:09:03 +00:00
Nick Mathewson
6ebd886511 forward-port: "Resolve" all XXX011 items, mostly by marking them non-011.
svn:r6396
2006-04-18 03:07:24 +00:00
Roger Dingledine
56df81199a that extra punctuation distracts me
svn:r6250
2006-03-27 05:30:16 +00:00
Roger Dingledine
6f08d121d9 Refactor and consolidate addr/exit policies into a new policies.c.
Fix some minor bugs and memory leaks along the way.


svn:r6246
2006-03-27 02:25:34 +00:00
Roger Dingledine
1db263ac3c stop writing the "router.desc" file, ever. nothing uses it anymore.
svn:r6224
2006-03-22 03:45:17 +00:00
Peter Palfrader
805754fdd9 Log server fingerprint on startup
svn:r6223
2006-03-22 03:40:59 +00:00
Roger Dingledine
c06e6ddadd Finish the transition from the word 'verified' to the words
'named' and 'valid'.


svn:r6188
2006-03-19 01:21:59 +00:00
Nick Mathewson
0f0e14c6e3 normalize whitespace.
svn:r6173
2006-03-17 04:43:37 +00:00
Nick Mathewson
3c0a5f6365 Do not warn about unknown servers in our family when they are given as hex digests.
svn:r6163
2006-03-15 05:04:11 +00:00
Peter Palfrader
a4ec555228 change INET_NTOA_BUF_LEN+1 to INET_NTOA_BUF_LEN
add a comment in a few places where we add weird numbers to buffer lengths


svn:r6161
2006-03-14 23:40:37 +00:00
Nick Mathewson
474c60b743 Cleanup on time-relaqted constants. New conventions:
1) Surround all constants by (parens), whether we'll be using them
     in a denominator or not.
  2) Express all time periods as products (24*60*60), not as multiplied-out
     constants (86400).
  3) Comments like "(60*60) /* one hour */" are as pointless as comments
     like "c = a + b; /* set c to the sum of a and b */".  Remove them.
  4) All time periods should be #defined constants, not given inline.
  5) All time periods should have doxygen comments.
  6) All time periods, unless specified, are in seconds.  It's not necessary
     to say so.

To summarize, the old (lack of) style would allow:

  #define FOO_RETRY_INTERVAL 60*60 /* one hour (seconds) */
  next_try = now + 3600;

The new style is:

  /** How often do we reattempt foo? */
  #define FOO_RETRY_INTERVAL (60*60)

  next_try = now + RETRY_INTERVAL;


svn:r6142
2006-03-12 22:48:18 +00:00
Roger Dingledine
8db1e363c9 remove some redundant code now that we compress exit policies
after parsing them


svn:r6099
2006-03-08 19:34:34 +00:00
Roger Dingledine
498c13b4df make the NoPublish option obsolete.
svn:r6052
2006-02-20 01:21:48 +00:00
Roger Dingledine
0408adb728 tweak
svn:r6051
2006-02-20 01:15:38 +00:00
Roger Dingledine
6a52867846 New config options to address bug 251:
FetchServerDescriptors and FetchHidServDescriptors for whether
to fetch server info and hidserv info or let the controller do it,
and also PublishServerDescriptor and PublishHidServDescriptors.

Add AllDirActionsPrivate undocumented option -- if you set it, you'll
need the controller to bootstrap you enough to build your first circuits.


svn:r6047
2006-02-19 22:02:02 +00:00
Roger Dingledine
ae249fc5a3 document the frequency for reachability testing by the
directory authorities.


svn:r6014
2006-02-14 04:33:59 +00:00
Roger Dingledine
259c65ab08 the last of the log convention conversion. finally.
svn:r6005
2006-02-13 10:33:00 +00:00
Nick Mathewson
dba155ecff Generate 18.0.0.0/8 address policy format in descs when we can; warn when the mask is not reducible to a bit-prefix.
svn:r5991
2006-02-12 23:58:22 +00:00
Roger Dingledine
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +00:00
Roger Dingledine
92ef9e37e7 Add a new config option ExitPolicyRejectPrivate which defaults to 1.
This means all exit policies will begin with rejecting private addresses,
unless the server operator explicitly turns it off.

Also, make our code to remove redundancies in the exit policy smarter,
so it can detect "reject foo, reject bar, reject *" patterns.

Lastly, we can get rid of the "exit policy implicitly accepts" code,
since we make everything more explicit now.


svn:r5888
2006-02-01 03:53:52 +00:00
Roger Dingledine
76f1b7415b try to detect an assert error earlier
svn:r5834
2006-01-17 02:31:04 +00:00
Nick Mathewson
2dd566d5d5 Indirect access to the signed_descriptor field to make it easier to keep them lazily on disk.
svn:r5827
2006-01-12 18:04:17 +00:00
Roger Dingledine
c8e6003412 balance the reachability testing so a smidgen of it happens
every 10 seconds. this way we don't try to do 500 tls's at
once every 20 minutes.


svn:r5763
2006-01-10 07:21:01 +00:00
Roger Dingledine
6dcbbda43b remove typo
svn:r5757
2006-01-08 22:16:09 +00:00
Nick Mathewson
447e6ffffd Fix bug where OPs would try to generate descriptor and crash.
svn:r5738
2006-01-06 15:40:34 +00:00
Roger Dingledine
6b2a6a8239 Bugfix: dyndns tor servers were needing to wait 18 hours before they
could start doing reachability testing using the new IP address and
ports. This is because we were using the internal descriptor to learn
what to test, yet we were only rebuilding the descriptor once we
decided we were reachable.


svn:r5723
2006-01-03 23:34:42 +00:00
Nick Mathewson
1af630d32c Bite the bullet and limit all our source lines to 80 characters, the way IBM intended.
svn:r5582
2005-12-14 20:40:40 +00:00
Roger Dingledine
58366ffd24 when we changed from log_fn to debug/info/notice/warn/err,
we screwed up the formatting in wild and unpredictable ways.

fix it before it becomes convention to format logs in wild and
unpredictable ways.

still need to do src/common/ someday.


svn:r5551
2005-12-10 09:36:26 +00:00
Nick Mathewson
9cec3a13f5 remove some functions that are not used; #if0 out some files that are not likely to be used.
svn:r5471
2005-11-30 06:27:59 +00:00
Nick Mathewson
3bd613b44d Rename connection_get_by_identity_digest to reflect that it is OR-only. Make it use a hashtable instead of a linear search.
svn:r5469
2005-11-30 03:01:16 +00:00
Roger Dingledine
7aae63994f Recover better from TCP connections to Tor servers that are broken but
don't tell you (it happens!); and rotate TLS connections once a week.

1) If an OR conn becomes more than a week old, make it obsolete.
2) If it's obsolete and empty, kill it.
3) When an OR makes a second connection to you, allow it.
4) If we want to send a new create cell, but the best conn we've
   got is obsolete, and the router is 0.1.1.9-alpha-cvs or later, ask
   for a new conn instead.
5) When we time out on circuit building on the first hop, make that
   connection obsolete.


svn:r5429
2005-11-19 06:57:44 +00:00
Peter Palfrader
901712ee59 Remove ip address change flapping detection. It is not really needed and I do not think it works quite right.
svn:r5423
2005-11-18 19:28:34 +00:00
Nick Mathewson
75d85c8214 On directory servers, old_routers was wasting hundreds of bytes per superseded router descriptor. Roll the signed descriptor info and identifying info into a cache_info struct, and use only that for old_routers.
svn:r5349
2005-11-05 20:15:27 +00:00
Roger Dingledine
1991f6cf48 more doc cleanups and reorganizing
svn:r5336
2005-11-01 03:48:51 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Nick Mathewson
452f4cfa09 Convert circuituse, command, config, connection, relay, router, test to new logging interface
svn:r5308
2005-10-25 07:04:36 +00:00
Nick Mathewson
f9b0be526e Use LD_BUG as appropriate; convert rend* and router* to new logging interface; use new circ_log_path interface
svn:r5302
2005-10-24 19:39:45 +00:00
Nick Mathewson
37708e9b1b Avoid potential infinite recursion when building a descriptor
svn:r5292
2005-10-24 03:04:05 +00:00
Nick Mathewson
3347c1741d Refactor routerlist access slightly: always use router_get_by_routerlist(); change its interface; add modifier functions to add/remove elements from the current routerlist (so we can add indices).
svn:r5276
2005-10-18 17:43:54 +00:00
Peter Palfrader
0d9aedfcea Downgrade a few INFO level logs to DEBUG again. Also add two or three new
logs in cases where a calling function's log was downgraded and we wouldn't
get any log message otherwise.


svn:r5263
2005-10-17 16:21:42 +00:00
Roger Dingledine
fd165329b8 start calling it *ListenAddress rather than *BindAddress,
since none of our users know what it means to bind an address or port.


svn:r5260
2005-10-17 03:17:29 +00:00
Peter Palfrader
8808b26206 Check if our IP address has changed every 5 minutes. If it has, update our server descriptor, but not too often
svn:r5246
2005-10-12 22:41:16 +00:00
Nick Mathewson
bf9ff1c1e7 Do not check whether DirPort is reachable when we are suppressing it because of hibernation. (Backport candidate)
svn:r5235
2005-10-12 04:07:10 +00:00
Roger Dingledine
46af2d26d0 you can't declare variables in the middle of a block
svn:r5214
2005-10-07 18:56:21 +00:00
Nick Mathewson
ba24193ab5 Make doxygen marginally happier
svn:r5208
2005-10-06 04:33:40 +00:00
Nick Mathewson
5cf758764e Rate-limit warnings related to unrecognized MyFamily elements.
svn:r5204
2005-10-05 23:20:45 +00:00
Nick Mathewson
61ea516885 Check for named servers when looking them up by nickname;
warn when we'recalling a non-named server by its nickname;
don't warn twice about the same name.

Fix a bug in routers_update_status_from_networkstatus that made nearly
all clients never update routerinfo_t.is_named.

Try to list MyFamily elements by key, not by nickname.

Only warn about names that we generated ourself, or got from the local
user.

On TLS handshake, only check the other router's nickname against its
expected nickname if is_named is set.


svn:r5185
2005-10-04 22:23:31 +00:00
Nick Mathewson
2d203fdcf3 link nicknames to trusted directory servers; log these nicknames when mentioning servers; also, when we get a naming conflict; log which nicknames or keys are supposed to bind.
svn:r5184
2005-10-04 21:21:09 +00:00
Roger Dingledine
e28c31ebce we were leaking some memory every time the client changes IPs
svn:r5165
2005-09-30 06:03:04 +00:00
Roger Dingledine
609af664ac resolve a docdoc
svn:r5157
2005-09-30 00:43:40 +00:00
Roger Dingledine
54a662a542 re-enable dirport testing again
(still need the other half, to notice when it has worked.)


svn:r5152
2005-09-29 23:04:01 +00:00
Roger Dingledine
8ae6e1c226 Be more conservative about whether to advertise our dirport.
The main change is to not advertise if we're running at capacity and
either a) we could hibernate or b) our capacity is low and we're using
a default dirport.


svn:r5148
2005-09-29 06:45:03 +00:00
Roger Dingledine
03d0f62da0 make the numbers in read-history and write-history into uint64s,
so they don't overflow and publish negatives in the descriptor.
fixes bug 193.


svn:r5119
2005-09-23 08:29:58 +00:00
Roger Dingledine
cce469c5ce simplify
svn:r5081
2005-09-16 06:15:34 +00:00
Roger Dingledine
8585599965 correct "your server is reachable" log entries to indicate that it was
self-testing that told us so.


svn:r5034
2005-09-13 21:39:42 +00:00
Nick Mathewson
3dc5e77b58 Numerous changes to move towards client-side v2 directories.
connection.c:
- Add some more connection accessor functions to make directory
  download redundancy checking work.

directory.c, or.h, router.c, routerlist.c:
- Start on logic to note when networkstatus downloads fail.

dirserv.c, routerlist.c, routerparse.c:
- Start maintaining an is_named field in routerstatus_t.  Don't
  actually look at it yet.

dirserv.c, routerlist.c:
- Remove expired networkstatus objects.

or.h:
- Make some booleans into bitfields
- Add prototypes

routerlist.c:
- Sort networkstatus list by publication time
- Function to remove old (older than 10 days) networkstatus objects.
- Function to set a list of routerinfo_ts' status info from the
  current set of networkstatus objects.
- Function to tell which routerinfos we need to download based no the
  current set of networkstatus objects.
- Do not launch a networkstatus download if a redundant one is in progress.

routerparse.c:
- Keep router entries in networkstatus sorted by digest.


svn:r5012
2005-09-12 06:56:42 +00:00
Nick Mathewson
059148f588 Only caches download network-status for now, and they use a different strategy. Add an element to connection_t to remember what we are downloading, and a function to recognize our own fingerprint.
svn:r4944
2005-09-08 20:18:15 +00:00
Roger Dingledine
c9e1c41873 dirserv_add_descriptor() doesn't chew up its argument anymore,
so we can stop protecting it.


svn:r4919
2005-09-08 05:37:22 +00:00
Roger Dingledine
03ddeb2620 strip obsolete code
svn:r4918
2005-09-08 05:32:41 +00:00
Nick Mathewson
5c6c88e76d More stuff for new directories.
- Distinguish v1 authorities (all currently trusted directories) from
  v2 authorities (all trusted directories).
    - Add configuration option for which dirs are v1 authories.
    - Add configuration option for whether to be a v1 authority.
    - Make trusted dirserver selection functions take options to
      choose which functionality we need.
    - Remove option when getting directory cache to see whether they
      support running-routers; they all do now.  Replace it with one
      to see whether caches support v2 stuff.

- Parse, cache, and serve network-status objects properly.

- Serve compressed groups of router descriptors.  The compression logic
  here could be more memory-efficient.

-


svn:r4911
2005-09-07 16:42:53 +00:00
Roger Dingledine
d2a5b614eb if you're an auth dir server, start yourself out as verified.
svn:r4907
2005-09-03 23:10:28 +00:00
Roger Dingledine
711cad94ed when we think a router is unreachable, pass the message back to the
server's logs, and make it a 'warn'.
also, fix a memory leak for rejected router descriptors.


svn:r4889
2005-08-31 06:14:37 +00:00
Roger Dingledine
e9524f9d2d refactor -- no actual changes
svn:r4885
2005-08-30 06:43:07 +00:00
Roger Dingledine
53431a4950 fix compile complaints (and a bug)
svn:r4862
2005-08-26 21:30:52 +00:00
Nick Mathewson
208bdf5f27 No need to load cached directory twice
svn:r4860
2005-08-26 21:19:58 +00:00
Nick Mathewson
7f78be1659 Clean up the "add myself as a trusted dirserver" code.
svn:r4849
2005-08-26 19:31:51 +00:00
Nick Mathewson
cf90a36dd1 Add quotes around filenames in src/or
svn:r4845
2005-08-26 18:44:26 +00:00
Nick Mathewson
d54d7b7ec1 Add some documentation; move the signature generation logic into routerparse.c along with the hash generation logic; make router signing use it as well.
svn:r4840
2005-08-26 15:34:53 +00:00
Roger Dingledine
893acb3acc Make a new AssumeReachable config option that will publish anyway.
Also, let authdirservers start without setting their Address field.
Something is still not working though. Will fix in morning.


svn:r4839
2005-08-26 07:41:19 +00:00
Nick Mathewson
54a6a8f0ef Start implementing the server side of the new directory protocol.
Probably very buggy, since I can't actually run an authdir.

Features
- Generate and publish new network-status format
- Code to cache and re-serve network-status objects generated by others.
- Publish individual descriptors (by fingerprint, by "all", and by
  "tell me yours.")  [Still needs compression logic]
- Publish client and server recommended versions seprately.
- Add digest of descriptor to routerinfo_t, so we can track them better, and
  length, so we can server them more easily.

Cleanups
- Unify code to sign directory-like things
- Make resolve_my_address() able to tell you which name it wound up resolving.
- Unify code to store and serve directory-like things so it all uses
  cached_dir_t.
- Unify code to set the value of cached_dir_t objects.


svn:r4835
2005-08-25 20:33:17 +00:00
Roger Dingledine
86f85f240c be much more conservative about logging reachability complaints.
the ones it logs now are probably genuine problem servers.


svn:r4832
2005-08-24 14:31:32 +00:00
Roger Dingledine
a120cc20c1 Dirservers now do their own external reachability testing of each
Tor server, and only list them as running if they've been found to
be reachable.

Dirservers also log trouble servers, but only start complaining loudly
after they've been up for an hour, to reduce false positives. We still
need to do something about the fact that it is quite loud when there
are many trouble servers.


svn:r4829
2005-08-24 02:31:02 +00:00
Roger Dingledine
8b766d1b7e fix bad logic that has been lurking for eons, that now prevented us
from uploading descriptors after the first one.


svn:r4818
2005-08-23 00:47:44 +00:00
Roger Dingledine
676b330eb2 Make DirPostPeriod config option obsolete.
Force new descriptor upload every 18 hours, not 24, to avoid races.
Change rate-limiting on new descriptors due to bandwidth changes, from
45 minutes to 20 minutes.


svn:r4814
2005-08-22 21:53:12 +00:00
Nick Mathewson
dc09c7fc73 Implement new (reduced-frequency) upload rules. arma, you should review this.
svn:r4806
2005-08-22 03:10:53 +00:00
Nick Mathewson
249b72f53e Replace (Fascist)Firewall* with a new ReachableAddresses option that understands address policies.
svn:r4751
2005-08-08 21:58:48 +00:00
Nick Mathewson
11ff0aba80 Make clients regenerate their keys when their IP address changes.
svn:r4688
2005-08-03 20:42:17 +00:00
Nick Mathewson
2bd6040f62 Rename cross-format config.c stuff to config_* and or_options_t-specific stuff to option[s]_*
svn:r4641
2005-07-23 01:58:05 +00:00
Roger Dingledine
97174b67c2 if you're an auth dir server, always publish your dirport,
even if you haven't yet found yourself to be reachable.

this is the cause of Jan Tore Morken's recent or-talk bug.


svn:r4575
2005-07-15 18:49:35 +00:00
Roger Dingledine
3bb756b93b forward-port the 0.1.0.11 stuff
svn:r4515
2005-07-01 02:01:21 +00:00
Nick Mathewson
232861ba42 Docment or add DOCDOC comments to undocumented functions in src/or. Make function definition format uniform.
svn:r4411
2005-06-11 18:52:12 +00:00
Roger Dingledine
b349e60543 don't tell people you're publishing the server descriptor if you're
actually not.


svn:r4387
2005-06-09 21:23:54 +00:00
Nick Mathewson
0831823763 Change end-of-file NLNL convention. It turns out arma I and I agree.
svn:r4382
2005-06-09 19:03:31 +00:00
Roger Dingledine
cfc89f8753 pay more attention to the ClientOnly config option
svn:r4367
2005-06-09 08:54:42 +00:00
Roger Dingledine
9ed7b53143 don't upload your descriptor if rebuilding it failed
svn:r4352
2005-06-08 19:45:17 +00:00
Roger Dingledine
4855990d37 clean up a few more log entries
svn:r4304
2005-05-27 17:43:43 +00:00
Roger Dingledine
040a748d87 i screwed up the dirport reachability testing when we don't yet
have a cached version of the directory. hopefully now fixed.


svn:r4284
2005-05-23 05:20:52 +00:00
Roger Dingledine
b7d6b8a397 doxygeny goodness from tyranix
svn:r4262
2005-05-17 17:01:36 +00:00
Nick Mathewson
00f2a09380 Append default exit policy before checking for implicit internal addresses: fix bug 129.
svn:r4201
2005-05-14 00:13:17 +00:00
Nick Mathewson
13126eeb0f Patch from goodell for task 131: Do not die on internal address if we are not publishing.
svn:r4186
2005-05-09 04:31:00 +00:00
Nick Mathewson
6567ec9ccf Functions work better when you call them. Resolve a bug which would prevent unreachable dirports from getting suppressed.
svn:r4183
2005-05-07 05:17:36 +00:00
Roger Dingledine
5265bbd2b8 first iteration of scrubbing sensitive strings from logs.
also generally clean up log messages.


svn:r4174
2005-05-03 10:04:08 +00:00
Nick Mathewson
69dc4e1675 Remove support for looking at old directory/routerdesc elements; mark non-new elements optional; switch to new format for dir-signing-key; start accepting newer elements so we can mark them as non-opt later; make tor-spec say the right stuff.
svn:r4154
2005-05-02 21:22:31 +00:00
Roger Dingledine
ad4eca60ec add geoff's NoPublish patch
svn:r4084
2005-04-21 10:40:48 +00:00
Roger Dingledine
13e211de17 We're printing the host mask wrong in exit policies in server descriptors.
I believe this isn't a critical bug tho, since we're still obeying the
exit policy internally.


svn:r3987
2005-04-02 08:55:31 +00:00
Nick Mathewson
0e81265359 update copyright notices.
svn:r3982
2005-04-01 20:15:56 +00:00
Roger Dingledine
453a822425 when you decide you're reachable, actually publish your descriptor
right then.


svn:r3968
2005-04-01 09:28:14 +00:00
Roger Dingledine
a28ae7a70c fix assert: if our dirport isn't reachable yet, don't trick
*ourselves* into thinking the dirport is zero. but continue
to tell other people that it is.


svn:r3952
2005-04-01 07:42:32 +00:00