diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-01-03 12:44:10 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-16 09:22:49 -0500 |
commit | f444f2b1d3e045d30cc15e6c1e4d890c40c82b3d (patch) | |
tree | f2ca040147db83d3893b94ffe5fa481175df5f7f /src/or/or.h | |
parent | fc0febc5c62a8c5ad2373b43641a70a8d793a469 (diff) | |
download | tor-f444f2b1d3e045d30cc15e6c1e4d890c40c82b3d.tar.gz tor-f444f2b1d3e045d30cc15e6c1e4d890c40c82b3d.zip |
Split client-specific and server-specific parts of port_cfg_t
Also, apply this cocci script to transform accesses. (Plus manual
migration for accesses inside smartlist_foreach loops.)
@@
port_cfg_t *cfgx;
@@
cfgx->
+server_cfg.
\(
no_advertise
\|
no_listen
\|
all_addrs
\|
bind_ipv4_only
\|
bind_ipv6_only
\)
@@
port_cfg_t *cfgx;
@@
cfgx->
+entry_cfg.
\(
isolation_flags
\|
session_group
\|
socks_prefer_no_auth
\|
ipv4_traffic
\|
ipv6_traffic
\|
prefer_ipv6
\|
cache_ipv4_answers
\|
cache_ipv6_answers
\|
use_cached_ipv4_answers
\|
use_cached_ipv6_answers
\|
prefer_ipv6_virtaddr
\)
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/or/or.h b/src/or/or.h index 4a014c1321..678dfbe3c5 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3334,30 +3334,17 @@ typedef enum invalid_router_usage_t { /** First automatically allocated session group number */ #define SESSION_GROUP_FIRST_AUTO -4 -/** Configuration for a single port that we're listening on. */ -typedef struct port_cfg_t { - tor_addr_t addr; /**< The actual IP to listen on, if !is_unix_addr. */ - int port; /**< The configured port, or CFG_AUTO_PORT to tell Tor to pick its - * own port. */ - uint8_t type; /**< One of CONN_TYPE_*_LISTENER */ - unsigned is_unix_addr : 1; /**< True iff this is an AF_UNIX address. */ - +typedef struct entry_port_cfg_t { /* Client port types (socks, dns, trans, natd) only: */ uint8_t isolation_flags; /**< Zero or more isolation flags */ int session_group; /**< A session group, or -1 if this port is not in a * session group. */ + /* Socks only: */ /** When both no-auth and user/pass are advertised by a SOCKS client, select * no-auth. */ unsigned int socks_prefer_no_auth : 1; - /* Server port types (or, dir) only: */ - unsigned int no_advertise : 1; - unsigned int no_listen : 1; - unsigned int all_addrs : 1; - unsigned int bind_ipv4_only : 1; - unsigned int bind_ipv6_only : 1; - /* Client port types only: */ unsigned int ipv4_traffic : 1; unsigned int ipv6_traffic : 1; @@ -3381,6 +3368,29 @@ typedef struct port_cfg_t { * do we prefer IPv6? */ unsigned int prefer_ipv6_virtaddr : 1; +} entry_port_cfg_t; + +typedef struct server_port_cfg_t { + /* Server port types (or, dir) only: */ + unsigned int no_advertise : 1; + unsigned int no_listen : 1; + unsigned int all_addrs : 1; + unsigned int bind_ipv4_only : 1; + unsigned int bind_ipv6_only : 1; +} server_port_cfg_t; + +/** Configuration for a single port that we're listening on. */ +typedef struct port_cfg_t { + tor_addr_t addr; /**< The actual IP to listen on, if !is_unix_addr. */ + int port; /**< The configured port, or CFG_AUTO_PORT to tell Tor to pick its + * own port. */ + uint8_t type; /**< One of CONN_TYPE_*_LISTENER */ + unsigned is_unix_addr : 1; /**< True iff this is an AF_UNIX address. */ + + entry_port_cfg_t entry_cfg; + + server_port_cfg_t server_cfg; + /* Unix sockets only: */ /** Path for an AF_UNIX address */ char unix_addr[FLEXIBLE_ARRAY_MEMBER]; |