aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.h
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'public/bug3940_redux'Nick Mathewson2012-06-13
|\
| * An attempt at bug3940 and making AllowDotExit 0 work with MapAddressNick Mathewson2012-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This time, I follow grarpamp's suggestion and move the check for .exit+AllowDotExit 0 to the top of connection_ap_rewrite_and_attach, before any rewriting occurs. This way, .exit addresses are forbidden as they arrive from a socks connection or a DNSPort request, and not otherwise. It _is_ a little more complicated than that, though. We need to treat any .exit addresses whose source is TrackHostExits as meaning that we can retry without that exit. We also need to treat any .exit address that comes from an AutomapHostsOnResolve operation as user-provided (and thus forbidden if AllowDotExits==0), so that transitioning from AllowDotExits==1 to AllowDotExits==0 will actually turn off automapped .exit addresses.
* | Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson2012-06-04
| |
* | MSVC build issue: make 'const' in declaration match 'const' in definitionNick Mathewson2012-05-14
|/ | | | | | MSVC warns if you declare a function as having a "int foo" argument and then implement it with a "const int foo" argument, even though the latter "const" is not a part of the function's interface.
* Refactor addressmap_match_superdomains and representation of wildcardsNick Mathewson2011-11-30
| | | | | | | | | | | | | | | In this new representation for wildcarded addresses, there are no longer any 'magic addresses': rather, "a.b c.d", "*.a.b c.d" and "*.a.b *.c.d" are all represented by a mapping from "a.b" to "c.d". we now distinguish them by setting bits in the addressmap_entry_t structure, where src_wildcard is set if the source address had a wildcard, and dst_wildcard is set if the target address had a wildcard. This lets the case where "*.a.b *.c.d" or "*.a.b c.d" remap the address "a.b" get handled trivially, and lets us simplify and improve the addressmap_match_superdomains implementation: we can now have it run in O(parts of address) rather than O(entries in addressmap).
* Fix whitespace issues in patches merged today so farNick Mathewson2011-09-07
|
* Merge remote-tracking branch 'public/split_entry_conn'Nick Mathewson2011-09-07
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/or/connection.c src/or/connection_edge.c src/or/connection_edge.h src/or/dnsserv.c Some of these were a little tricky, since they touched code that changed because of the prop171 fixes.
| * Move entry-only fields from edge_connection_t to entry_connection_tNick Mathewson2011-07-21
| | | | | | | | Also, refactor the code accordingly.
* | Remove connection_edge_streams_are_compatibleRobert Ransom2011-08-08
|/ | | | It's dead code (not used anywhere by the current proposal 171 algorithm).
* Implement sensible isolation for tunneled directory connsNick Mathewson2011-07-19
| | | | | | | | | One-hop dirconn streams all share a session group, and get the ISO_SESSIONGRP flag: they may share circuits with each other and nothing else. Anonymized dirconn streams get a new internal-use-only ISO_STREAM flag: they may not share circuits with anything, including each other.
* Launch sufficient circuits to satisfy pending isolated streamsNick Mathewson2011-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | Our old "do we need to launch a circuit for stream S" logic was, more or less, that if we had a pending circuit that could handle S, we didn't need to launch a new one. But now that we have streams isolated from one another, we need something stronger here: It's possible that some pending C can handle either S1 or S2, but not both. This patch reuses the existing isolation logic for a simple solution: when we decide during circuit launching that some pending C would satisfy stream S1, we "hypothetically" mark C as though S1 had been connected to it. Now if S2 is incompatible with S1, it won't be something that can attach to C, and so we'll launch a new stream. When the circuit becomes OPEN for the first time (with no streams attached to it), we reset the circuit's isolation status. I'm not too sure about this part: I wanted some way to be sure that, if all streams that would have used a circuit die before the circuit is done, the circuit can still get used. But I worry that this approach could also lead to us launching too many circuits. Careful thought needed here.
* Const-ify a few functionsNick Mathewson2011-07-19
|
* (Unused) backend logic for stream isolationNick Mathewson2011-07-19
| | | | | | | | This patch adds fields to track how streams should be isolated, and ensures that those fields are set correctly. It also adds fields to track what streams can go on a circuit, and adds functions to see whether a streams can go on a circuit and update the circuit accordingly. Those functions aren't yet called.
* Split connection_about_to_close_connection into separate functionsNick Mathewson2011-07-11
| | | | | | | | This patch does NOTHING but: - move code - add declarations and includes as needed to make the new code work - declare the new functions.
* Make the get_options() return constNick Mathewson2011-06-14
| | | | | | | | This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output!
* Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-15
|\ | | | | | | | | Conflicts: src/or/connection_edge.c
| * Handle transitions in Automap*, VirtualAddrNetwork correctlyNick Mathewson2011-05-13
| | | | | | | | | | | | | | | | | | | | Previously, if they changed in torrc during a SIGHUP, all was well, since we would just clear all transient entries from the addrmap thanks to bug 1345. But if you changed them from the controller, Tor would leave old mappings in place. The VirtualAddrNetwork bug has been here since 0.1.1.19-rc; the AutomapHosts* bug has been here since 0.2.0.1-alpha.
* | Merge maint-0.2.2 for the bug1090-part1-squashed branchNick Mathewson2011-04-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved conflicts in: doc/tor.1.txt src/or/circuitbuild.c src/or/circuituse.c src/or/connection_edge.c src/or/connection_edge.h src/or/directory.c src/or/rendclient.c src/or/routerlist.c src/or/routerlist.h These were mostly releated to the routerinfo_t->node_t conversion.
| * revert most of ef81649d2fcRoger Dingledine2011-04-27
| | | | | | | | | | | | | | | | Now we believe it to be the case that we never build a circuit for our stream that has an unsuitable exit, so we'll never need to use such a circuit. The risk is that we have some code that builds the circuit, but now we refuse to use it, meaning we just build a bazillion circuits and ignore them all.
| * When there is a transition in permitted nodes, apply it to trackexithosts mapNick Mathewson2011-04-26
| | | | | | | | | | | | | | | | | | IOW, if we were using TrackExitHosts, and we added an excluded node or removed a node from exitnodes, we wouldn't actually remove the mapping that points us at the new node. Also, note with an XXX022 comment a place that I think we are looking at the wrong string.
* | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-03-15
|\|
| * Consider sending stream-level SENDME cells on partial flushes.Nick Mathewson2011-03-14
| | | | | | | | | | | | | | | | | | | | | | | | Right now, we only consider sending stream-level SENDME cells when we have completely flushed a connection_edge's outbuf, or when it sends us a DATA cell. Neither of these is ideal for throughput. This patch changes the behavior so we now call connection_edge_consider_sending_sendme when we flush _some_ data from an edge outbuf. Fix for bug 2756; bugfix on svn r152.
* | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-03
|\|
| * Bump copyright statements to 2011 (0.2.2)Nick Mathewson2011-01-03
| |
* | Merge branch 'maint-0.2.2'Roger Dingledine2010-12-19
|\|
| * Merge remote branch fix_security_bug_021 into fix_security_bug_022Nick Mathewson2010-12-15
| | | | | | | | | | | | | | Conflicts: src/common/memarea.c src/or/or.h src/or/rendclient.c
* | Initial conversion to use node_t throughout our codebase.Nick Mathewson2010-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A node_t is an abstraction over routerstatus_t, routerinfo_t, and microdesc_t. It should try to present a consistent interface to all of them. There should be a node_t for a server whenever there is * A routerinfo_t for it in the routerlist * A routerstatus_t in the current_consensus. (note that a microdesc_t alone isn't enough to make a node_t exist, since microdescriptors aren't usable on their own.) There are three ways to get a node_t right now: looking it up by ID, looking it up by nickname, and iterating over the whole list of microdescriptors. All (or nearly all) functions that are supposed to return "a router" -- especially those used in building connections and circuits -- should return a node_t, not a routerinfo_t or a routerstatus_t. A node_t should hold all the *mutable* flags about a node. This patch moves the is_foo flags from routerinfo_t into node_t. The flags in routerstatus_t remain, but they get set from the consensus and should not change. Some other highlights of this patch are: * Looking up routerinfo and routerstatus by nickname is now unified and based on the "look up a node by nickname" function. This tries to look only at the values from current consensus, and not get confused by the routerinfo_t->is_named flag, which could get set for other weird reasons. This changes the behavior of how authorities (when acting as clients) deal with nodes that have been listed by nickname. * I tried not to artificially increase the size of the diff here by moving functions around. As a result, some functions that now operate on nodes are now in the wrong file -- they should get moved to nodelist.c once this refactoring settles down. This moving should happen as part of a patch that moves functions AND NOTHING ELSE. * Some old code is now left around inside #if 0/1 blocks, and should get removed once I've verified that I don't want it sitting around to see how we used to do things. There are still some unimplemented functions: these are flagged with "UNIMPLEMENTED_NODELIST()." I'll work on filling in the implementation here, piece by piece. I wish this patch could have been smaller, but there did not seem to be any piece of it that was independent from the rest. Moving flags forces many functions that once returned routerinfo_t * to return node_t *, which forces their friends to change, and so on.
* | Try to make most routerinfo_t interfaces constNick Mathewson2010-10-01
| |
* | Add support for linked connections with bufferevent_pair.Nick Mathewson2010-09-27
|/ | | | | | Also, set directory connections (linked and otherwise) to use bufferevents. Also, stop using outbuf_flushlen anywhere except for OR connections.
* Merge remote branch 'sebastian/bug1525'Nick Mathewson2010-09-13
|\
| * Ensure controller RESOLVE commands respect __LeaveStreamsUnattachedRobert Hogan2010-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://trac.torproject.org/projects/tor/ticket/1525 "The codepath taken by the control port "RESOLVE" command to create a synthetic SOCKS resolve request isn't the same as the path taken by a real SOCKS request from 'tor-resolve'. This prevents controllers who set LeaveStreamsUnattached=1 from being able to attach RESOLVE streams to circuits of their choosing." Create a new function connection_ap_rewrite_and_attach_if_allowed() and call that when Tor needs to attach a stream to a circuit but needs to know if the controller permits it. No tests added.
* | Remove unused function declarationsSebastian Hahn2010-08-17
|/ | | | | | Also remove some #if 0'd code from the unit tests for buffers. The code was killed in e6794e58081af773073c266e23fe3ab2ebecdb7e (5 years ago), and is now broken anyways.
* Create connection_edge.hSebastian Hahn2010-07-27