14 #define RELAY_TRANSPORT_CONFIG_PRIVATE
31 STMT_BEGIN *msg = tor_strdup(arg); return -1; STMT_END
44 const char *transport)
47 const char *parsed_transport = NULL;
48 char *addrport = NULL;
54 SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, -1);
56 if (smartlist_len(items) < 2) {
57 log_warn(
LD_CONFIG,
"Too few arguments on ServerTransportListenAddr line.");
61 parsed_transport = smartlist_get(items, 0);
62 addrport = tor_strdup(smartlist_get(items, 1));
65 if (transport && strcmp(transport, parsed_transport))
70 log_warn(
LD_CONFIG,
"Error parsing ServerTransportListenAddr "
71 "address '%s'", addrport);
83 smartlist_free(items);
118 const char *transport)
122 const char *parsed_transport = NULL;
125 SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, -1);
127 if (smartlist_len(items) < 2) {
128 log_warn(
LD_CONFIG,
"Too few arguments on ServerTransportOptions line.");
132 parsed_transport = smartlist_get(items, 0);
134 if (transport && strcmp(transport, parsed_transport))
138 if (option_sl_idx == 0)
150 } SMARTLIST_FOREACH_END(option);
156 smartlist_free(pt_options);
161 smartlist_free(items);
209 log_notice(
LD_GENERAL,
"Tor is not configured as a relay but you specified"
210 " a ServerTransportPlugin line (%s). The ServerTransportPlugin "
211 "line will be ignored.",
216 log_notice(
LD_GENERAL,
"You need at least a single managed-proxy to "
217 "specify a transport listen address. The "
218 "ServerTransportListenAddr line will be ignored.");
223 REJECT(
"Invalid server transport line. See logs for details.");
232 REJECT(
"ServerTransportListenAddr did not parse. See logs for details.");
243 REJECT(
"ServerTransportOptions did not parse. See logs for details.");
246 smartlist_free(options_sl);
275 log_notice(
LD_CONFIG,
"We use pluggable transports but the Extended "
276 "ORPort is disabled. Tor and your pluggable transports proxy "
277 "communicate with each other via the Extended ORPort so it "
278 "is suggested you enable it: it will also allow your Bridge "
279 "to collect statistics about its clients that use pluggable "
280 "transports. Please enable it using the ExtORPort torrc option "
281 "(e.g. set 'ExtORPort auto').");
287 log_warn(
LD_CONFIG,
"Error creating Extended ORPort cookie file.");
297 "Previously validated ServerTransportPlugin line "
298 "could not be added!");
int tor_addr_port_parse(int severity, const char *addrport, tor_addr_t *address_out, uint16_t *port_out, int default_port)
int pt_parse_transport_line(const or_options_t *options, const char *line, int validate_only, int server)
const or_options_t * get_options(void)
Header file for config.c.
const char * escaped(const char *s)
int string_is_key_value(int severity, const char *string)
Master header file for Tor-specific functionality.
int server_mode(const or_options_t *options)
Header file for routermode.c.
smartlist_t * smartlist_new(void)
void smartlist_add_strdup(struct smartlist_t *sl, const char *string)
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
#define SMARTLIST_FOREACH(sl, type, var, cmd)
int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep, int flags, int max)
struct config_line_t * ServerTransportOptions
struct config_line_t * ServerTransportListenAddr
struct config_line_t * ExtORPort_lines
struct config_line_t * ServerTransportPlugin
tor_cmdline_mode_t command
char * pt_get_bindaddr_from_config(const char *transport)
int options_act_server_transport(const or_options_t *old_options)
int options_validate_server_transport(const or_options_t *old_options, or_options_t *options, char **msg)
STATIC smartlist_t * get_options_from_transport_options_line(const char *line, const char *transport)
static char * get_bindaddr_from_transport_listen_line(const char *line, const char *transport)
smartlist_t * pt_get_options_for_server_transport(const char *transport)
Header for feature/relay/transport_config.c.