[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] start calling it *ListenAddress rather than *BindAddress,
Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or
Modified Files:
config.c connection.c or.h router.c
Log Message:
start calling it *ListenAddress rather than *BindAddress,
since none of our users know what it means to bind an address or port.
Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.438
retrieving revision 1.439
diff -u -d -r1.438 -r1.439
--- config.c 17 Oct 2005 03:06:00 -0000 1.438
+++ config.c 17 Oct 2005 03:17:29 -0000 1.439
@@ -67,6 +67,9 @@
{ "BandwidthBurstBytes", "BandwidthBurst", 0, 0},
{ "DirFetchPostPeriod", "StatusFetchPeriod", 0, 0},
{ "MaxConn", "ConnLimit", 0, 1},
+ { "ORBindAddress", "ORListenAddress", 0, 1},
+ { "DirBindAddress", "DirListenAddress", 0, 1},
+ { "SocksBindAddress", "SocksListenAddress", 0, 1},
{ NULL, NULL, 0, 0},
};
#undef PLURAL
@@ -115,8 +118,9 @@
VAR("DataDirectory", STRING, DataDirectory, NULL),
VAR("DebugLogFile", STRING, DebugLogFile, NULL),
VAR("DirAllowPrivateAddresses",BOOL, DirAllowPrivateAddresses, NULL),
- VAR("DirBindAddress", LINELIST, DirBindAddress, NULL),
- VAR("DirFetchPeriod", INTERVAL, DirFetchPeriod, "0 seconds"), /** DOCDOC **/
+ VAR("DirListenAddress", LINELIST, DirListenAddress, NULL),
+ /* if DirFetchPeriod is 0, see get_dir_fetch_period() in main.c */
+ VAR("DirFetchPeriod", INTERVAL, DirFetchPeriod, "0 seconds"),
VAR("DirPolicy", LINELIST, DirPolicy, NULL),
VAR("DirPort", UINT, DirPort, "0"),
OBSOLETE("DirPostPeriod"),
@@ -159,7 +163,7 @@
VAR("NodeFamily", LINELIST, NodeFamilies, NULL),
VAR("NumCpus", UINT, NumCpus, "1"),
VAR("NumHelperNodes", UINT, NumHelperNodes, "3"),
- VAR("ORBindAddress", LINELIST, ORBindAddress, NULL),
+ VAR("ORListenAddress", LINELIST, ORListenAddress, NULL),
VAR("ORPort", UINT, ORPort, "0"),
VAR("OutboundBindAddress", STRING, OutboundBindAddress, NULL),
VAR("PathlenCoinWeight", DOUBLE, PathlenCoinWeight, "0.3"),
@@ -179,10 +183,11 @@
VAR("RunTesting", BOOL, RunTesting, "0"),
VAR("SafeLogging", BOOL, SafeLogging, "1"),
VAR("ShutdownWaitLength", INTERVAL, ShutdownWaitLength, "30 seconds"),
- VAR("SocksBindAddress", LINELIST, SocksBindAddress, NULL),
+ VAR("SocksListenAddress", LINELIST, SocksListenAddress, NULL),
VAR("SocksPolicy", LINELIST, SocksPolicy, NULL),
VAR("SocksPort", UINT, SocksPort, "9050"),
- VAR("StatusFetchPeriod", INTERVAL, StatusFetchPeriod, "0 seconds"), /** DOCDOC */
+ /* if StatusFetchPeriod is 0, see get_status_fetch_period() in main.c */
+ VAR("StatusFetchPeriod", INTERVAL, StatusFetchPeriod, "0 seconds"),
VAR("StrictEntryNodes", BOOL, StrictEntryNodes, "0"),
VAR("StrictExitNodes", BOOL, StrictExitNodes, "0"),
VAR("SysLog", LINELIST_S, OldLogOptions, NULL),
@@ -1732,16 +1737,16 @@
result = -1;
}
- if (options->ORPort == 0 && options->ORBindAddress != NULL) {
- log(LOG_WARN, "ORPort must be defined if ORBindAddress is defined.");
+ if (options->ORPort == 0 && options->ORListenAddress != NULL) {
+ log(LOG_WARN, "ORPort must be defined if ORListenAddress is defined.");
result = -1;
}
- if (options->DirPort == 0 && options->DirBindAddress != NULL) {
- log(LOG_WARN, "DirPort must be defined if DirBindAddress is defined.");
+ if (options->DirPort == 0 && options->DirListenAddress != NULL) {
+ log(LOG_WARN, "DirPort must be defined if DirListenAddress is defined.");
result = -1;
}
- if (options->SocksPort == 0 && options->SocksBindAddress != NULL) {
- log(LOG_WARN, "SocksPort must be defined if SocksBindAddress is defined.");
+ if (options->SocksPort == 0 && options->SocksListenAddress != NULL) {
+ log(LOG_WARN, "SocksPort must be defined if SocksListenAddress is defined.");
result = -1;
}
Index: connection.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.410
retrieving revision 1.411
diff -u -d -r1.410 -r1.411
--- connection.c 17 Oct 2005 02:13:36 -0000 1.410
+++ connection.c 17 Oct 2005 03:17:29 -0000 1.411
@@ -13,8 +13,8 @@
#include "or.h"
-static connection_t *connection_create_listener(const char *bindaddress,
- uint16_t bindport, int type);
+static connection_t *connection_create_listener(const char *listenaddress,
+ uint16_t listenport, int type);
static int connection_init_accepted_conn(connection_t *conn);
static int connection_handle_listener_read(connection_t *conn, int new_type);
static int connection_receiver_bucket_should_increase(connection_t *conn);
@@ -474,17 +474,17 @@
}
/** Bind a new non-blocking socket listening to
- * <b>bindaddress</b>:<b>bindport</b>, and add this new connection
+ * <b>listenaddress</b>:<b>listenport</b>, and add this new connection
* (of type <b>type</b>) to the connection array.
*
- * If <b>bindaddress</b> includes a port, we bind on that port; otherwise, we
- * use bindport.
+ * If <b>listenaddress</b> includes a port, we bind on that port;
+ * otherwise, we use listenport.
*/
static connection_t *
-connection_create_listener(const char *bindaddress, uint16_t bindport,
+connection_create_listener(const char *listenaddress, uint16_t listenport,
int type)
{
- struct sockaddr_in bindaddr; /* where to bind */
+ struct sockaddr_in listenaddr; /* where to bind */
char *address = NULL;
connection_t *conn;
uint16_t usePort;
@@ -494,17 +494,17 @@
int one=1;
#endif
- memset(&bindaddr,0,sizeof(struct sockaddr_in));
- if (parse_addr_port(bindaddress, &address, &addr, &usePort)<0) {
- log_fn(LOG_WARN, "Error parsing/resolving BindAddress %s",bindaddress);
+ memset(&listenaddr,0,sizeof(struct sockaddr_in));
+ if (parse_addr_port(listenaddress, &address, &addr, &usePort)<0) {
+ log_fn(LOG_WARN, "Error parsing/resolving ListenAddress %s",listenaddress);
return NULL;
}
if (usePort==0)
- usePort = bindport;
- bindaddr.sin_addr.s_addr = htonl(addr);
- bindaddr.sin_family = AF_INET;
- bindaddr.sin_port = htons((uint16_t) usePort);
+ usePort = listenport;
+ listenaddr.sin_addr.s_addr = htonl(addr);
+ listenaddr.sin_family = AF_INET;
+ listenaddr.sin_port = htons((uint16_t) usePort);
log_fn(LOG_NOTICE, "Opening %s on %s:%d",
conn_type_to_string(type), address, usePort);
@@ -527,7 +527,7 @@
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (void*) &one, sizeof(one));
#endif
- if (bind(s,(struct sockaddr *)&bindaddr,sizeof(bindaddr)) < 0) {
+ if (bind(s,(struct sockaddr *)&listenaddr,sizeof(listenaddr)) < 0) {
log_fn(LOG_WARN, "Could not bind to %s:%u: %s", address, usePort,
tor_socket_strerror(tor_socket_errno(s)));
goto err;
@@ -803,7 +803,7 @@
/**
* Launch any configured listener connections of type <b>type</b>. (A
* listener is configured if <b>port_option</b> is non-zero. If any
- * BindAddress configuration options are given in <b>cfg</b>, create a
+ * ListenAddress configuration options are given in <b>cfg</b>, create a
* connection binding to each one. Otherwise, create a single
* connection binding to the address <b>default_addr</b>.)
*
@@ -935,15 +935,15 @@
or_options_t *options = get_options();
if (server_mode(options) &&
- retry_listeners(CONN_TYPE_OR_LISTENER, options->ORBindAddress,
+ retry_listeners(CONN_TYPE_OR_LISTENER, options->ORListenAddress,
options->ORPort, "0.0.0.0", force,
replaced_conns, new_conns)<0)
return -1;
- if (retry_listeners(CONN_TYPE_DIR_LISTENER, options->DirBindAddress,
+ if (retry_listeners(CONN_TYPE_DIR_LISTENER, options->DirListenAddress,
options->DirPort, "0.0.0.0", force,
replaced_conns, new_conns)<0)
return -1;
- if (retry_listeners(CONN_TYPE_AP_LISTENER, options->SocksBindAddress,
+ if (retry_listeners(CONN_TYPE_AP_LISTENER, options->SocksListenAddress,
options->SocksPort, "127.0.0.1", force,
replaced_conns, new_conns)<0)
return -1;
Index: or.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.717
retrieving revision 1.718
diff -u -d -r1.717 -r1.718
--- or.h 17 Oct 2005 00:35:53 -0000 1.717
+++ or.h 17 Oct 2005 03:17:29 -0000 1.718
@@ -1174,11 +1174,11 @@
config_line_t *SocksPolicy; /**< Lists of socks policy components */
config_line_t *DirPolicy; /**< Lists of dir policy components */
/** Addresses to bind for listening for SOCKS connections. */
- config_line_t *SocksBindAddress;
+ config_line_t *SocksListenAddress;
/** Addresses to bind for listening for OR connections. */
- config_line_t *ORBindAddress;
+ config_line_t *ORListenAddress;
/** Addresses to bind for listening for directory connections. */
- config_line_t *DirBindAddress;
+ config_line_t *DirListenAddress;
/** Local address to bind outbound sockets */
char *OutboundBindAddress;
/** Directory server only: which versions of
Index: router.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -d -r1.220 -r1.221
--- router.c 12 Oct 2005 22:41:16 -0000 1.220
+++ router.c 17 Oct 2005 03:17:29 -0000 1.221
@@ -524,7 +524,7 @@
server_mode(or_options_t *options)
{
if (options->ClientOnly) return 0;
- return (options->ORPort != 0 || options->ORBindAddress);
+ return (options->ORPort != 0 || options->ORListenAddress);
}
/** Remember if we've advertised ourselves to the dirservers. */
@@ -551,7 +551,7 @@
int
proxy_mode(or_options_t *options)
{
- return (options->SocksPort != 0 || options->SocksBindAddress);
+ return (options->SocksPort != 0 || options->SocksListenAddress);
}
/** Decide if we're a publishable server. We are a publishable server if: