Commit Graph

1144 Commits

Author SHA1 Message Date
Roger Dingledine
5d41346b67 prevent servers from publishing an internal IP as their address
svn:r1272
2004-03-14 18:12:59 +00:00
Roger Dingledine
8e4f1f67fa actually, if recommendedversions is required for dirservers,
then require it.


svn:r1253
2004-03-10 07:44:31 +00:00
Roger Dingledine
3ba392e69f give a useful error message to clients when the dirserver hasn't
defined any recommended versions


svn:r1252
2004-03-10 07:02:56 +00:00
Roger Dingledine
89d9d80e76 Store options->Address as IP, not hostname
And figure it out while reading config, not every time you
rebuild the descriptor


svn:r1226
2004-03-04 01:53:56 +00:00
Roger Dingledine
b961732246 add --version, note that --help is probably obsolete
svn:r1195
2004-03-02 05:19:01 +00:00
Roger Dingledine
1147289dc0 make config_assign fail rather than warn for unrecognized config options
svn:r1194
2004-03-02 05:00:50 +00:00
Roger Dingledine
3fb9c869a8 clearer warning message
svn:r1173
2004-02-28 23:31:15 +00:00
Roger Dingledine
c058f87513 disallow changing from ORPort==0 to ORPort>0 on hup
svn:r1172
2004-02-28 23:30:41 +00:00
Roger Dingledine
dd632e697e clean up some log messages and severities
still plenty more left to clean


svn:r1158
2004-02-28 07:01:22 +00:00
Roger Dingledine
b354ecfecd rename ExcludedNodes config option to ExcludeNodes
svn:r1155
2004-02-28 05:09:37 +00:00
Roger Dingledine
d3e9afda27 When it can't resolve any dirservers, it was useless from then on.
Now it reloads the RouterFile (or default dirservers) if it has no
dirservers.


svn:r1130
2004-02-26 22:56:36 +00:00
Roger Dingledine
0b27ae0c2d if the default torrc isn't there, just use some default defaults
plus provide an internal dirservers file if they don't have one

having no config files will make it easier to run on windows


svn:r1124
2004-02-26 21:25:51 +00:00
Roger Dingledine
67c0c64aa4 go back to a single exitpolicy parameter
if your exitpolicy includes " *:*" then it is final,
else we append the default exit policy.
(thanks weasel)


svn:r1105
2004-02-18 07:23:38 +00:00
Roger Dingledine
4e178907ab allow imaps and pop3s in default exit policy
svn:r1104
2004-02-18 04:02:05 +00:00
Roger Dingledine
7562a62ef0 Get rid of the notion of a separate default default exit policy.
Create ExitPolicyPrepend config parameter, to customize the default
exit policy.


svn:r1103
2004-02-18 03:56:12 +00:00
Roger Dingledine
5086300815 split the token bucket into 'rate' and 'burst' params
we're not entirely migrated to burst yet, for backward compatibility

note some win32 probable-bugs

clean up routerlist.c


svn:r982
2004-01-10 23:40:38 +00:00
Roger Dingledine
6a19e64066 remove trailing whitespace
svn:r951
2003-12-17 21:09:31 +00:00
Roger Dingledine
1096eae543 add options.ExcludedNodes -- nodes that are never picked in path building
svn:r924
2003-12-14 05:08:28 +00:00
Roger Dingledine
a1745b6895 slightly different default default exit policy.
svn:r917
2003-12-14 00:18:57 +00:00
Nick Mathewson
911f155f94 Make default exit policy reject 127.*:*
svn:r902
2003-12-13 03:37:25 +00:00
Roger Dingledine
41bb717241 reasonably permissive exit policy if you don't set one
svn:r901
2003-12-13 02:53:35 +00:00
Roger Dingledine
727a260a81 prevent assert failure on -HUP when options->PidFile==NULL
svn:r885
2003-12-03 22:00:20 +00:00
Roger Dingledine
975bb68010 simplify: options.OnionRouter==1 iff options.ORPort>0
svn:r857
2003-11-20 17:49:45 +00:00
Roger Dingledine
91cf5e44cc default log level is now warn
(info is too noisy)


svn:r855
2003-11-19 22:48:48 +00:00
Roger Dingledine
d6601f8cff make pidfile default to null rather than writing to your cwd
svn:r853
2003-11-19 22:45:06 +00:00
Roger Dingledine
a18ced652b finally find and possibly fix the circuit_deliver_relay_cell warn bug
svn:r827
2003-11-17 07:43:03 +00:00
Roger Dingledine
c8639b2bbc bump default pathlen to 3; clean up surrounding code
svn:r810
2003-11-13 23:01:56 +00:00
Roger Dingledine
56cd147eb9 let getconfig survive repeated calls. now we call it again when we hup.
change RecommendedVersions into a config option, so dirservers can hup
  for a new one


svn:r809
2003-11-13 06:49:25 +00:00
Roger Dingledine
f5829aa723 lay groundwork for EntryNodes and ExitNodes
svn:r805
2003-11-12 19:34:34 +00:00
Roger Dingledine
1969c8a92f client now survives going offline better
fix badness in usage()
if neither socksport nor orrport is defined, quit
obsolete connection_flush_buf()


svn:r780
2003-11-10 08:06:55 +00:00
Roger Dingledine
52589289fe add DirBindAddress, parse the BindAddress's when you bind
exit if bind fails
add usage printfs
rearrange config options for readability


svn:r674
2003-10-25 12:01:09 +00:00
Roger Dingledine
c6b442a346 make end relay cells have payloads
move default exit policy into config files


svn:r653
2003-10-22 07:55:44 +00:00
Steven Hazel
b1eca56b77 added User and Group options -- if you set them, tor will try to
setuid and setgid respectively, and die if it can't.

(If the User option is set, tor will setgid to the user's gid as well.)

This happens after the pidfile is created, so that in cases where tor
needs to be root to work with the pidfile, it will at least be able to
create it, although it won't be able to delete it.  That sucks, but
it's somewhat better than not being able to create the pidfile in the
first place.


svn:r652
2003-10-22 06:03:11 +00:00
Roger Dingledine
e4127e4d36 move closer to being able to reload config on HUP
rename APPort to SocksPort
introduce new tor_free() macro


svn:r642
2003-10-21 09:48:17 +00:00
Roger Dingledine
b40d0bffa7 a skeletal print_usage() function
svn:r634
2003-10-20 01:19:54 +00:00
Roger Dingledine
11a23fc280 clean up logging, allow user to specify log files
If DebugLogFile is specified, log to it at -l debug
If LogFile is specified, log to it at the -l from the commandline
  (default info)
If no LogFile *and* not a Daemon, then log to stdout.
Make conn->s = -1 by default (this might break things)
When kill -USR1, prefer to log at INFO, but make sure they always see it.


svn:r596
2003-10-15 18:50:16 +00:00
Steven Hazel
a54a65dfb6 - cause configure to create a tor.sh which will have directories set
correctly based on how configure was run

- cause tor to guess the location of torrc more intelligently

- cause cause src/config/torrc and src/conf/sample-server-torrc to be
  generated with contents that are correct for the way configure was
  run

- cause "make install" to put torrc, sample-server-torrc, and
  dirservers somewhere intelligent


svn:r587
2003-10-15 07:19:38 +00:00
Roger Dingledine
b9628f266f change WARNING to WARN
and fix a few typos


svn:r571
2003-10-10 01:48:32 +00:00
Roger Dingledine
746d64e631 add in basic support for pidfiles
(patch courtesy aaron turner)


svn:r565
2003-10-08 08:54:52 +00:00
Roger Dingledine
8b80362c76 0.0.2pre11, new license
svn:r564
2003-10-08 04:10:59 +00:00
Nick Mathewson
36939303c9 Update LICENSE and copyright dates.
svn:r560
2003-10-08 02:04:08 +00:00
Roger Dingledine
e6847c4420 add ExitPolicy line to config file
svn:r552
2003-10-07 22:04:17 +00:00
Roger Dingledine
16778795f3 minor fixes; bump to 0.0.2pre10
svn:r551
2003-10-07 21:27:33 +00:00
Roger Dingledine
be874358a4 wrap strdup; prefer time() to gettimeofday()
svn:r538
2003-10-04 03:29:09 +00:00
Roger Dingledine
efa8e288ef my_routerinfo, router_is_me, and learn_my_address are obsolete
ACIs are decided now by strcmp'ing nicknames, rather than comparing addr:port


svn:r529
2003-10-01 01:49:53 +00:00
Roger Dingledine
2cfc6f0379 ORs post descriptors periodically too
svn:r523
2003-09-30 23:06:23 +00:00
Roger Dingledine
467d278b8b more cleanup and rearranging
still not finished integrating new dirserv stuff


svn:r507
2003-09-29 07:50:08 +00:00
Roger Dingledine
9899e09b3b add Address config element, use it in descriptor
svn:r496
2003-09-27 07:21:36 +00:00
Roger Dingledine
bf10a3c0f1 finish enforcing the log convention
svn:r494
2003-09-26 22:27:24 +00:00
Roger Dingledine
9e5cafc395 first pass: obey log convention
ERR is if something fatal just happened

WARNING is something bad happened, but we're still running. The bad thing
is either a bug in the code, an attack or buggy protocol/implementation
of the remote peer, etc. The operator should examine the bad thing and
try to correct it.
(No error or warning messages should be expected. I expect most people
to run on -l warning eventually.)

NOTICE is never ever used.

INFO means something happened (maybe bad, maybe ok), but there's nothing
you need to (or can) do about it.

DEBUG is for everything louder than INFO.


svn:r486
2003-09-26 10:03:50 +00:00
Nick Mathewson
3d4ccb781a Refactor buffers; implement descriptors.
'buf_t' is now an opaque type defined in buffers.c .

Router descriptors now include all keys; routers generate keys as
needed on startup (in a newly defined "data directory"), and generate
their own descriptors.  Descriptors are now self-signed.

Implementation is not complete: descriptors are never published; and
upon receiving a descriptor, the directory doesn't do anything with
it.

At least "routers.or" and orkeygen are now obsolete, BTW.


svn:r483
2003-09-25 05:17:11 +00:00
Roger Dingledine
40d0fca63a cleanups, bugfixes, more verbose logs
Fixed up the assert_*_ok funcs some (more work remains)

Changed config so it reads either /etc/torrc or the -f arg, never both

Finally tracked down a nasty bug with our use of tls:
  It turns out that if you ask SSL_read() for no more than n bytes, it
  will read the entire record from the network (and maybe part of the next
  record, I'm not sure), give you n bytes of it, and keep the remaining
  bytes internally. This is fine, except our poll-for-read looks at the
  network, and there are no bytes pending on the network, so we never know
  to ask SSL_read() for more bytes. Currently I've hacked it so if we ask
  for n bytes and it returns n bytes, then it reads again right then. This
  will interact poorly with our rate limiting; we need a cleaner solution.


svn:r481
2003-09-24 21:24:52 +00:00
Roger Dingledine
31bf3ec420 reshuffle functions for cleaner organization
svn:r451
2003-09-12 22:45:31 +00:00
Roger Dingledine
a6a5784bca add CertFile, Nickname
write new certfile if you don't have one already
set up a tls context on startup


svn:r432
2003-09-08 06:26:38 +00:00
Roger Dingledine
413c7a19ed clean up config.c so it doesn't expose as much
svn:r430
2003-09-08 05:16:18 +00:00
Roger Dingledine
36f055e7ee start honoring the recommended_versions string
your client exits if you're running a version not in the
directory's list of acceptable versions (unless you have a
config variable set to override).


svn:r408
2003-08-23 10:09:25 +00:00
Roger Dingledine
88edae9407 start refactoring dnsworker so testing won't be so darn hard
add NumCpus config variable in preparation for cpuworkers
hardcode /etc/torrc path for config (simplifies win32 port)
improve exit policy debugging during router entry parsing


svn:r397
2003-08-14 03:52:51 +00:00
Nick Mathewson
c336c99e60 Start of port to win32. Missing are:
- signal support
  - forking for DNS farm
  - changes for async IO
  - daemonizing

In other words, some files still don't build, and the ones that do build,
do nonblocking IO incorrectly.

I'm also not checking in the project files till I have a good place
for them.


svn:r380
2003-08-12 03:08:41 +00:00
Roger Dingledine
c6f70e36e0 implemented total read rate limiting
svn:r365
2003-07-05 07:10:34 +00:00
Nick Mathewson
95e5384af3 Change many files to new log_fn format
svn:r333
2003-06-17 22:18:26 +00:00
Roger Dingledine
fa1d446440 OPport is gone. So is conn type OP.
svn:r298
2003-05-28 02:03:25 +00:00
Roger Dingledine
39e9d79038 add circuit-level sendme relay cells
remove sendme cells
replace malloc with tor_malloc
patch (but not track down) bug in onion pending list
streamline connection_ap handshake


svn:r293
2003-05-20 06:41:23 +00:00
Roger Dingledine
2c7e660c62 sign directories with the signing key
svn:r274
2003-05-07 22:40:03 +00:00
Roger Dingledine
f39ca8a3aa further cleanup, test.c still has some bugs
svn:r241
2003-04-16 23:21:44 +00:00
Roger Dingledine
e1d37ed6ab divorce circuit building from user connections
now we rebuild the circuit periodically (but only if it's been used),
and we can further abstract it to do incremental circuit building, etc.


svn:r233
2003-04-16 06:18:31 +00:00
Nick Mathewson
c217b1ca71 Add magic to end of C files to make emacs happy; split test invocation into separate file.
svn:r224
2003-04-07 02:12:02 +00:00
Roger Dingledine
d07146b778 cleaner errors
svn:r205
2003-03-19 22:02:35 +00:00
Roger Dingledine
64e46988f6 greatly simplify this notion of 'roles':
if your ORPort is non-zero then you must connect to all nodes
if your DirPort is non-zero then you must act like a directory server


svn:r192
2003-03-18 01:49:55 +00:00
Nick Mathewson
5dc443a8c5 Add daemon option and bool config type
svn:r184
2003-03-17 02:27:19 +00:00
Roger Dingledine
c35373a2cf major overhaul: dns slave subsystem, topics
on startup, it forks off a master dns handler, which forks off dns
slaves (like the apache model). slaves as spawned as load increases,
and then reused. excess slaves are not ever killed, currently.

implemented topics. each topic has a receive window in each direction
at each edge of the circuit, and sends sendme's at the data level, as
per before. each circuit also has receive windows in each direction at
each hop; an edge sends a circuit-level sendme as soon as enough data
cells have arrived (regardless of whether the data cells were flushed
to the exit conns). removed the 'connected' cell type, since it's now
a topic command within data cells.

at the edge of the circuit, there can be multiple connections associated
with a single circuit. you find them via the linked list conn->next_topic.

currently each new ap connection starts its own circuit, so we ought
to see comparable performance to what we had before. but that's only
because i haven't written the code to reattach to old circuits. please
try to break it as-is, and then i'll make it reuse the same circuit and
we'll try to break that.


svn:r152
2003-01-26 09:02:24 +00:00
Roger Dingledine
cbd2cdf04f onions go on and off the network correctly now
we're closer to an OS X port
 CVS: ----------------------------------------------------------------------


svn:r146
2002-12-03 22:18:23 +00:00
Roger Dingledine
8f18647a33 create cells are now queued and processed only when idle
we also queue data cells destined for a circuit that is
pending, and process them once the circuit opens

destroys reach into the queue and remove the pending onion,
along with its collected data cells


svn:r142
2002-11-27 04:08:20 +00:00
Roger Dingledine
ab0aee04d9 added OnionsPerSecond to prevent create flooding
first cut, probably needs more playing with


svn:r137
2002-11-23 08:49:03 +00:00
Roger Dingledine
00a9e3732e remove popt dependency, consolidate config stuff
reformat parts of onion.c


svn:r136
2002-11-23 06:49:01 +00:00
Roger Dingledine
74787aa2d4 cell.c is now obsolete
svn:r133
2002-10-03 02:17:41 +00:00
Roger Dingledine
7ed6c8bd39 introduced a periodic keepalive padding cell
now tor can be run safely inside nat'ed areas that kill idle
connections; and the proxy can handle when you suspend your laptop
and then emerge hours later from a new domain.


svn:r125
2002-10-01 23:37:31 +00:00
Roger Dingledine
22285e6ff1 cleanup
prkey is only fetched when it's needed
tor nodes who aren't dirservers now fetch directories and autoconnect
  to new nodes listed in the directory
default role is a non-dirserver node


svn:r120
2002-09-28 00:52:59 +00:00
Roger Dingledine
01f6727306 directory servers in and functional
proxies now periodically pull down an hourly-updated directory,
and replace their router list with it if it parses correctly.


svn:r112
2002-09-26 12:09:10 +00:00
Roger Dingledine
ddc2b69a28 onion proxies now work (i think)
svn:r96
2002-09-04 06:29:28 +00:00
Roger Dingledine
ca834335da resolve warnings
svn:r89
2002-09-03 19:03:16 +00:00
Nick Mathewson
fdb31225b7 Port to MacOS X
svn:r88
2002-09-03 18:44:24 +00:00
Roger Dingledine
27adc0f20b enforce maxconn; bugfix to not tear down the parent when we hit maxconn
svn:r86
2002-09-03 18:36:40 +00:00
Roger Dingledine
d8c0d21b49 linkpadding is now off by default.
svn:r79
2002-08-23 06:49:43 +00:00
Roger Dingledine
117cbeeaaf Implemented link padding and receiver token buckets
Each socket reads at most 'bandwidth' bytes per second sustained, but
can handle bursts of up to 10*bandwidth bytes.

Cells are now sent out at evenly-spaced intervals, with padding sent
out otherwise. Set Linkpadding=0 in the rc file to send cells as soon
as they're available (and to never send padding cells).

Added license/copyrights statements at the top of most files.

router->min and router->max have been merged into a single 'bandwidth'
value. We should make the routerinfo_t reflect this (want to do that,
Mat?)

As the bandwidth increases, and we want to stop sleeping more and more
frequently to send a single cell, cpu usage goes up. At 128kB/s we're
pretty much calling poll with a timeout of 1ms or even 0ms. The current
code takes a timeout of 0-9ms and makes it 10ms. prepare_for_poll()
handles everything that should have happened in the past, so as long as
our buffers don't get too full in that 10ms, we're ok.

Speaking of too full, if you run three servers at 100kB/s with -l debug,
it spends too much time printing debugging messages to be able to keep
up with the cells. The outbuf ultimately fills up and it kills that
connection. If you run with -l err, it works fine up through 500kB/s and
probably beyond. Down the road we'll want to teach it to recognize when
an outbuf is getting full, and back off.


svn:r50
2002-07-16 01:12:15 +00:00
Bruce Montrose
52311e1b78 corrected some string literals
svn:r47
2002-07-15 16:42:27 +00:00
Bruce Montrose
aaca91109f finishing touches. think its ready for integration now.
svn:r42
2002-07-11 19:03:44 +00:00
Bruce Montrose
3ee59f2325 added new option GlobalRole to getoptions()
svn:r41
2002-07-11 18:38:16 +00:00
Bruce Montrose
4c65f31340 cleaned up some, added validation to getoptions()
svn:r40
2002-07-11 14:50:26 +00:00
Bruce Montrose
6a58057a6e Added usage display on error.
svn:r36
2002-07-10 12:37:49 +00:00
Bruce Montrose
62ead018a1 Miscellaneous bug fixes / activated "make check" for src/or
svn:r31
2002-07-09 19:51:41 +00:00
Bruce Montrose
bb163ca830 minor bug fix in error checking
svn:r28
2002-07-03 19:58:18 +00:00
Bruce Montrose
a5be23d475 added error checking into getoptions()
svn:r26
2002-07-03 16:53:34 +00:00
Bruce Montrose
a3609f4d5d Added getoptions() and made minor adjustment to poptReadDefaultOptions()
svn:r25
2002-07-03 16:31:22 +00:00
Roger Dingledine
9a928eeb12 Initial revision
svn:r2
2002-06-26 22:45:49 +00:00