aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/policies.c
AgeCommit message (Collapse)Author
2020-08-05Replace several C identifiers for ticket 18106.Nick Mathewson
We used to have a single boolean, "FascistFirewall". Ages ago, in tickets #17840 and #9067, we added an improved "ReachableAddresses" mechanism. It's time to rename related identifiers in the code for consistency. This closes #18106. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ fascist_firewall_allows_address reachable_addr_allows \ fascist_firewall_use_ipv6 reachable_addr_use_ipv6 \ fascist_firewall_prefer_ipv6_impl reachable_addr_prefer_ipv6_impl \ fascist_firewall_prefer_ipv6_orport reachable_addr_prefer_ipv6_orport \ fascist_firewall_prefer_ipv6_dirport reachable_addr_prefer_ipv6_dirport \ fascist_firewall_allows_address_addr reachable_addr_allows_addr \ fascist_firewall_allows_address_ap reachable_addr_allows_ap \ fascist_firewall_allows_base reachable_addr_allows_base \ fascist_firewall_allows_ri_impl reachable_addr_allows_ri_impl \ fascist_firewall_allows_rs_impl reachable_addr_allows_rs_impl \ fascist_firewall_allows_rs reachable_addr_allows_rs \ fascist_firewall_allows_md_impl reachable_addr_allows_md_impl \ fascist_firewall_allows_node reachable_addr_allows_node \ fascist_firewall_allows_dir_server reachable_addr_allows_dir_server \ fascist_firewall_choose_address_impl reachable_addr_choose_impl \ fascist_firewall_choose_address reachable_addr_choose \ fascist_firewall_choose_address_base reachable_addr_choose_base \ fascist_firewall_choose_address_rs reachable_addr_choose_from_rs \ fascist_firewall_choose_address_ls reachable_addr_choose_from_ls \ fascist_firewall_choose_address_node reachable_addr_choose_from_node \ fascist_firewall_choose_address_dir_server reachable_addr_choose_from_dir_server
2020-07-14addr: Use tor_addr_t instead of uint32_t for IPv4David Goulet
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-05-06Merge branch 'maint-0.4.3'Nick Mathewson
Amazingly, this time we had no merge conflicts with "falls through" comments.
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; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.3 version.)
2020-04-30net: Make all address bytes functions take uint8_t *teor
Part of 33817.
2020-03-09Merge branch 'tor-github/pr/1751'David Goulet
2020-03-09Remove the ClientAutoIPv6ORPort optionNeel Chauhan
2020-02-10Use semicolons after HT_PROTOTYPE and HT_GENERATE.Nick Mathewson
2020-01-16Remove functions that checked for pre-ipv6 consensus.Nick Mathewson
We no longer need or need to test: * node_awaiting_ipv6() * networkstatus_consensus_has_ipv6().
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-04-24Add firewall_choose_address_ls() and hs_get_extend_info_from_lspecs() testsNeel Chauhan
2019-04-24Use fascist_firewall_choose_address_ls() in hs_get_extend_info_from_lspecs()Neel Chauhan
2019-04-24Add function fascist_firewall_choose_address_ls()Neel Chauhan
2019-04-16Clarify comment about IPv6Exit in policies_parse_exit_policy_from_options()Neel Chauhan
2019-04-16Add policy_using_default_exit_options() to determine if we're using the ↵Neel Chauhan
default exit options
2019-04-14Become an exit relay if IPv6Exit is 1Neel Chauhan
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-12-14Rewrite the core of parse_short_policy() to be faster.Nick Mathewson
The old implementation did some funky out-of-order lexing, and tended to parse every port twice if the %d-%d pattern didn't match. Closes ticket 28853.
2018-12-01Merge branch 'ticket27490a_squashed'Nick Mathewson
2018-12-01Add regression test for ClientAutoIPv6ORPortNeel Chauhan
2018-12-01In fascist_firewall_use_ipv6(), say we can use IPv6 if ClientAutoIPv6ORPort is 1Neel Chauhan
2018-12-01Add new option ClientAutoIPv6ORPort to switch between IPv4 and IPv6 OR portsNeel Chauhan
2018-10-01Remove routerparse include from files that dont use itNick Mathewson
2018-10-01Extract addr-policy parsing code.Nick 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-25Extract all the "am I a server" functions from router.cNick Mathewson
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-14Tweak message; only log it on a relay.Nick Mathewson
2018-09-14Merge remote-tracking branch 'neel/b21530'Nick Mathewson
2018-09-13Add log message for Tor being non-exit by defaultNeel Chauhan
2018-08-28make a comment more rightRoger Dingledine
(from #20874 fix)
2018-08-20If ExitRelay is not specified, emulate the behavior of "ExitRelay 0"Neel Chauhan
2018-07-20Add a "reject *:*" line after parsing in parse_reachable_addresses()Neel Chauhan
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.