aboutsummaryrefslogtreecommitdiff
path: root/src/feature/control
AgeCommit message (Collapse)Author
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-12-18Revert "Log bootstrap tag names"Nick Mathewson
This reverts commit 1b855af5e33189d70d74273af03a535c343b63a5.
2018-12-10Log bootstrap tag namesTaylor Yu
Add the bootstrap tag name to the log messages, so people troubleshooting connection problems can look up a symbol instead of a number. Closes ticket 28731.
2018-11-19Update control_free_all() for #27169Taylor Yu
Reset the added bootstrap tracking state introduced by ticket 27169. Fixes bug 28524; bugfix on 0.3.5.1-alpha.
2018-10-01Remove versions.h include from routerparse.hNick Mathewson
2018-10-01Move v2 hs parsing into feature/rendNick Mathewson
2018-10-01Move routerparse and parsecommon to their own module.Nick Mathewson
2018-09-27Extract the non-stats part of geoip into a new src/lib/geoip.Nick Mathewson
2018-09-27Split geoip from geoip-related stats.Nick Mathewson
This commit just moves the code to two separate files. The geoip code still has a few needless dependencies on core/* and features/*.
2018-09-27Move the predicted ports code out of rephist.cNick Mathewson
It differs from the rest of the rephist code in that it's actually necessary for Tor to operate, so it should probably go somewhere else. I'm not sure where yet, so I'll leave it in the same directory, but give it its own file.
2018-09-25Revise things that had included router.h beforeNick Mathewson
Make them only include the headers that they needed, and sort their headers while we're at it.
2018-09-25Extract all the "am I a server" functions from router.cNick Mathewson
2018-09-25Move all authdir_mode_*() functions into authmode.hNick Mathewson
2018-09-25Move self-test functionality into its own file.Nick Mathewson
2018-09-21Split directory.c code into several modulesNick Mathewson
Parts of this C file naturally belong in dircache, dirclient, and dircommon: so, move them there.
2018-09-21Split main.c into main.c and mainloop.cNick Mathewson
The main.c code is responsible for initialization and shutdown; the mainloop.c code is responsible for running the main loop of Tor. Splitting the "generic event loop" part of mainloop.c from the event-loop-specific part is not done as part of this patch.
2018-09-20Split most of dirserv.c into several new modulesNick Mathewson
In dirauth: * bwauth.c reads and uses bandwidth files * guardfraction.c reads and uses the guardfraction file * reachability.c tests relay reachability * recommend_pkg.c handles the recommended-packages lines. * recv_descs.c handles fingerprint files and processing incoming routerinfos that relays upload to us * voteflag.c computes flag thresholds and sets those thresholds on routerstatuses when computing votes In control: * fmt_serverstatus.c generates the ancient "v1 server status" format that controllers expect. In nodelist: * routerstatus_fmt.c formats routerstatus entries for a consensus, a vote, or for the controller.
2018-09-19Split routerlist.c into 4 separate modulesNick Mathewson
There are now separate modules for: * the list of router descriptors * the list of authorities and fallbacks * managing authority certificates * selecting random nodes
2018-09-14Merge remote-tracking branch 'tor-github/pr/329'Nick Mathewson
2018-09-14Merge branch 'ticket27247'Nick Mathewson
2018-09-13Control port call to emit a CIRC_BW event for a single circuit.Mike Perry
This commit only moves code. No functionality has been changed.
2018-09-10Defer reporting directory bootstrap progressTaylor Yu
Existing cached directory information can cause misleadingly high bootstrap percentages. To improve user experience, defer reporting of directory information progress until at least one connection has succeeded to a relay or bridge. Closes ticket 27169.
2018-09-10Track bootstrap phase independently of progressTaylor Yu
Track bootstrap phase (enumerated by bootstrap_status_t) independently from the bootstrap progress (which can represent intermediate progress). This allows control_event_bootstrap_problem() to avoid doing a linear search through the bootstrap progress space to find the current bootstrap phase.
2018-09-10Refactor control_event_bootstrap_core() moreTaylor Yu
Eliminate a few conditional expressions in control_event_bootstrap_core() by overwriting the status parameter.
2018-09-10Refactor control_event_bootstrap() somewhatTaylor Yu
Move the mostly-invariant part of control_event_boostrap() into a helper control_event_bootstrap_core(). The helper doesn't modify any state beyond doing logging and control port notifications.
2018-09-10Deindent much of control_event_bootstrapTaylor Yu
2018-09-10Make control_event_bootstrap() return voidTaylor Yu
Simplify control_event_bootstrap() by making it return void again. It is currently a fairly complicated function, and it's made more complicated by returning an int to signal whether it logged at NOTICE or INFO. The callers conditionally log messages at level NOTICE based on this return value. Change the callers to unconditionally log their verbose human-readable messages at level INFO to keep NOTICE logs less cluttered. This partially reverts the changes of #14950.
2018-09-07Use networkstatus_read_cached_consensus() for GETINFONick Mathewson
We already had fallback code for "dir/status-vote/current/consensus" to read from disk if we didn't have a cached_dir_t available. But there's a function in networkstatus_t that does it for us, so let's do that.
2018-09-06Merge remote-tracking branch 'ageis/control-getinfo-uptime'Nick Mathewson
2018-09-04Merge branch 'nss_squashed' into nss_mergeNick Mathewson
2018-08-21Rename functions that encode/decode private keysNick Mathewson
It is not nice to expose a private key's contents without having the function name advertise the fact. Fortunately, we weren't misusing these yet.
2018-08-20Fix typo in comment for getinfo_helper_current_time()Neel Chauhan
2018-08-08Fix typo in control_event_hs_descriptor_content()Neel Chauhan
2018-07-20Merge branch 'maint-0.3.4'Nick Mathewson
2018-07-16control: Add new 'uptime' message to GETINFOKevin Gallagher
Sends the Tor controller the uptime in seconds. Highly useful for monitoring purposes.
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-05Move literally everything out of src/orNick Mathewson
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.