mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
document rewrite_result_t and export for testing
This commit is contained in:
parent
cd6a57e3d5
commit
715fdfcb7b
@ -908,21 +908,10 @@ connection_ap_rewrite_and_attach_if_allowed(entry_connection_t *conn,
|
||||
return connection_ap_handshake_rewrite_and_attach(conn, circ, cpath);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
char orig_address[MAX_SOCKS_ADDR_LEN];
|
||||
/* We set this to true if this is an address we should automatically
|
||||
* remap to a local address in VirtualAddrNetwork */
|
||||
int automap;
|
||||
addressmap_entry_source_t exit_source;
|
||||
time_t map_expires;
|
||||
|
||||
int end_reason;
|
||||
int should_close;
|
||||
} rewrite_result_t;
|
||||
|
||||
/* DOCDOC
|
||||
*/
|
||||
static void
|
||||
/* Try to perform any map-based rewriting of the target address in <b>conn</b>,
|
||||
* filling in the fields of <b>out</b> as we go.
|
||||
*/
|
||||
STATIC void
|
||||
connection_ap_handshake_rewrite(entry_connection_t *conn,
|
||||
rewrite_result_t *out)
|
||||
{
|
||||
|
@ -143,6 +143,30 @@ STATIC int begin_cell_parse(const cell_t *cell, begin_cell_t *bcell,
|
||||
STATIC int connected_cell_format_payload(uint8_t *payload_out,
|
||||
const tor_addr_t *addr,
|
||||
uint32_t ttl);
|
||||
|
||||
|
||||
typedef struct {
|
||||
/** Original address, after we lowercased it but before we started
|
||||
* mapping it.
|
||||
*/
|
||||
char orig_address[MAX_SOCKS_ADDR_LEN];
|
||||
/** True iff the address has been automatically remapped to a local
|
||||
* address in VirtualAddrNetwork */
|
||||
int automap;
|
||||
/** If this connection has a .exit address, who put it there? */
|
||||
addressmap_entry_source_t exit_source;
|
||||
/** If we've rewritten the address, when does this map expire? */
|
||||
time_t map_expires;
|
||||
/** If we should close the connection, this is the end_reason to pass
|
||||
* to connection_mark_unattached_ap */
|
||||
int end_reason;
|
||||
/** True iff we should close the connection, either because of error or
|
||||
* because of successful early RESOLVED reply. */
|
||||
int should_close;
|
||||
} rewrite_result_t;
|
||||
|
||||
STATIC void connection_ap_handshake_rewrite(entry_connection_t *conn,
|
||||
rewrite_result_t *out);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user