Browse Source

Change Natd into NATD in our options.

Breaking this out of the last commit because this might be more
controversial.
Sebastian Hahn 15 years ago
parent
commit
556a1b9e45
7 changed files with 21 additions and 21 deletions
  1. 1 1
      doc/spec/address-spec.txt
  2. 1 1
      doc/tor.1.txt
  3. 10 10
      src/or/config.c
  4. 2 2
      src/or/connection.c
  5. 4 4
      src/or/connection_edge.c
  6. 2 2
      src/or/or.h
  7. 1 1
      src/or/router.c

+ 1 - 1
doc/spec/address-spec.txt

@@ -12,7 +12,7 @@
 
 
   These hostnames can be passed to Tor as the address part of a SOCKS4a or
   These hostnames can be passed to Tor as the address part of a SOCKS4a or
   SOCKS5 request.  If the application is connected to Tor using an IP-only
   SOCKS5 request.  If the application is connected to Tor using an IP-only
-  method (such as SOCKS4, TransPort, or NatdPort), these hostnames can be
+  method (such as SOCKS4, TransPort, or NATDPort), these hostnames can be
   substituted for certain IP addresses using the MapAddress configuration
   substituted for certain IP addresses using the MapAddress configuration
   option or the MAPADDRESS control command.
   option or the MAPADDRESS control command.
 
 

+ 1 - 1
doc/tor.1.txt

@@ -670,7 +670,7 @@ The following options are useful only for clients (that is, if
 
 
 **AllowDotExit** **0**|**1**::
 **AllowDotExit** **0**|**1**::
     If enabled, we convert "www.google.com.foo.exit" addresses on the
     If enabled, we convert "www.google.com.foo.exit" addresses on the
-    SocksPort/TransPort/NatdPort into "www.google.com" addresses that exit from
+    SocksPort/TransPort/NATDPort into "www.google.com" addresses that exit from
     the node "foo". Disabled by default since attacking websites and exit
     the node "foo". Disabled by default since attacking websites and exit
     relays can use it to manipulate your path selection. (Default: 0)
     relays can use it to manipulate your path selection. (Default: 0)
 
 

+ 10 - 10
src/or/config.c

@@ -300,8 +300,8 @@ static config_var_t _option_vars[] = {
   V(MyFamily,                    STRING,   NULL),
   V(MyFamily,                    STRING,   NULL),
   V(NewCircuitPeriod,            INTERVAL, "30 seconds"),
   V(NewCircuitPeriod,            INTERVAL, "30 seconds"),
   VAR("NamingAuthoritativeDirectory",BOOL, NamingAuthoritativeDir, "0"),
   VAR("NamingAuthoritativeDirectory",BOOL, NamingAuthoritativeDir, "0"),
-  V(NatdListenAddress,           LINELIST, NULL),
-  V(NatdPort,                    UINT,     "0"),
+  V(NATDListenAddress,           LINELIST, NULL),
+  V(NATDPort,                    UINT,     "0"),
   V(Nickname,                    STRING,   NULL),
   V(Nickname,                    STRING,   NULL),
   V(WarnUnsafeSocks,              BOOL,     "1"),
   V(WarnUnsafeSocks,              BOOL,     "1"),
   V(NoPublish,                   BOOL,     "0"),
   V(NoPublish,                   BOOL,     "0"),
@@ -2918,8 +2918,8 @@ options_validate(or_options_t *old_options, or_options_t *options,
   if (options->TransPort == 0 && options->TransListenAddress != NULL)
   if (options->TransPort == 0 && options->TransListenAddress != NULL)
     REJECT("TransPort must be defined if TransListenAddress is defined.");
     REJECT("TransPort must be defined if TransListenAddress is defined.");
 
 
-  if (options->NatdPort == 0 && options->NatdListenAddress != NULL)
-    REJECT("NatdPort must be defined if NatdListenAddress is defined.");
+  if (options->NATDPort == 0 && options->NATDListenAddress != NULL)
+    REJECT("NATDPort must be defined if NATDListenAddress is defined.");
 
 
   /* Don't gripe about SocksPort 0 with SocksListenAddress set; a standard
   /* Don't gripe about SocksPort 0 with SocksListenAddress set; a standard
    * configuration does this. */
    * configuration does this. */
@@ -2938,8 +2938,8 @@ options_validate(or_options_t *old_options, or_options_t *options,
       old = old_options ? old_options->TransListenAddress : NULL;
       old = old_options ? old_options->TransListenAddress : NULL;
       tp = "transparent proxy";
       tp = "transparent proxy";
     } else {
     } else {
-      opt = options->NatdListenAddress;
-      old = old_options ? old_options->NatdListenAddress : NULL;
+      opt = options->NATDListenAddress;
+      old = old_options ? old_options->NATDListenAddress : NULL;
       tp = "natd proxy";
       tp = "natd proxy";
     }
     }
 
 
@@ -3031,14 +3031,14 @@ options_validate(or_options_t *old_options, or_options_t *options,
   if (options->TransPort < 0 || options->TransPort > 65535)
   if (options->TransPort < 0 || options->TransPort > 65535)
     REJECT("TransPort option out of bounds.");
     REJECT("TransPort option out of bounds.");
 
 
-  if (options->NatdPort < 0 || options->NatdPort > 65535)
-    REJECT("NatdPort option out of bounds.");
+  if (options->NATDPort < 0 || options->NATDPort > 65535)
+    REJECT("NATDPort option out of bounds.");
 
 
   if (options->SocksPort == 0 && options->TransPort == 0 &&
   if (options->SocksPort == 0 && options->TransPort == 0 &&
-      options->NatdPort == 0 && options->ORPort == 0 &&
+      options->NATDPort == 0 && options->ORPort == 0 &&
       options->DNSPort == 0 && !options->RendConfigLines)
       options->DNSPort == 0 && !options->RendConfigLines)
     log(LOG_WARN, LD_CONFIG,
     log(LOG_WARN, LD_CONFIG,
-        "SocksPort, TransPort, NatdPort, DNSPort, and ORPort are all "
+        "SocksPort, TransPort, NATDPort, DNSPort, and ORPort are all "
         "undefined, and there aren't any hidden services configured.  "
         "undefined, and there aren't any hidden services configured.  "
         "Tor will still run, but probably won't do anything.");
         "Tor will still run, but probably won't do anything.");
 
 

+ 2 - 2
src/or/connection.c

@@ -1862,8 +1862,8 @@ retry_all_listeners(smartlist_t *replaced_conns,
                       replaced_conns, new_conns, 0,
                       replaced_conns, new_conns, 0,
                       AF_INET)<0)
                       AF_INET)<0)
     return -1;
     return -1;
-  if (retry_listeners(CONN_TYPE_AP_NATD_LISTENER, options->NatdListenAddress,
-                      options->NatdPort, "127.0.0.1",
+  if (retry_listeners(CONN_TYPE_AP_NATD_LISTENER, options->NATDListenAddress,
+                      options->NATDPort, "127.0.0.1",
                       replaced_conns, new_conns, 0,
                       replaced_conns, new_conns, 0,
                       AF_INET)<0)
                       AF_INET)<0)
     return -1;
     return -1;

+ 4 - 4
src/or/connection_edge.c

@@ -2001,13 +2001,13 @@ connection_ap_process_natd(edge_connection_t *conn)
   if (err == 0)
   if (err == 0)
     return 0;
     return 0;
   if (err < 0) {
   if (err < 0) {
-    log_warn(LD_APP,"Natd handshake failed (DEST too long). Closing");
+    log_warn(LD_APP,"NATD handshake failed (DEST too long). Closing");
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
     return -1;
     return -1;
   }
   }
 
 
   if (strcmpstart(tmp_buf, "[DEST ")) {
   if (strcmpstart(tmp_buf, "[DEST ")) {
-    log_warn(LD_APP,"Natd handshake was ill-formed; closing. The client "
+    log_warn(LD_APP,"NATD handshake was ill-formed; closing. The client "
              "said: %s",
              "said: %s",
              escaped(tmp_buf));
              escaped(tmp_buf));
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
@@ -2016,7 +2016,7 @@ connection_ap_process_natd(edge_connection_t *conn)
 
 
   daddr = tbuf = &tmp_buf[0] + 6; /* after end of "[DEST " */
   daddr = tbuf = &tmp_buf[0] + 6; /* after end of "[DEST " */
   if (!(tbuf = strchr(tbuf, ' '))) {
   if (!(tbuf = strchr(tbuf, ' '))) {
-    log_warn(LD_APP,"Natd handshake was ill-formed; closing. The client "
+    log_warn(LD_APP,"NATD handshake was ill-formed; closing. The client "
              "said: %s",
              "said: %s",
              escaped(tmp_buf));
              escaped(tmp_buf));
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
@@ -2030,7 +2030,7 @@ connection_ap_process_natd(edge_connection_t *conn)
   socks->port = (uint16_t)
   socks->port = (uint16_t)
     tor_parse_long(tbuf, 10, 1, 65535, &port_ok, &daddr);
     tor_parse_long(tbuf, 10, 1, 65535, &port_ok, &daddr);
   if (!port_ok) {
   if (!port_ok) {
-    log_warn(LD_APP,"Natd handshake failed; port %s is ill-formed or out "
+    log_warn(LD_APP,"NATD handshake failed; port %s is ill-formed or out "
              "of range.", escaped(tbuf));
              "of range.", escaped(tbuf));
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
     return -1;
     return -1;

+ 2 - 2
src/or/or.h

@@ -2379,7 +2379,7 @@ typedef struct {
    * connections. */
    * connections. */
   config_line_t *TransListenAddress;
   config_line_t *TransListenAddress;
   /** Addresses to bind for listening for transparent natd connections */
   /** Addresses to bind for listening for transparent natd connections */
-  config_line_t *NatdListenAddress;
+  config_line_t *NATDListenAddress;
   /** Addresses to bind for listening for SOCKS connections. */
   /** Addresses to bind for listening for SOCKS connections. */
   config_line_t *DNSListenAddress;
   config_line_t *DNSListenAddress;
   /** Addresses to bind for listening for OR connections. */
   /** Addresses to bind for listening for OR connections. */
@@ -2403,7 +2403,7 @@ typedef struct {
   int SocksPort; /**< Port to listen on for SOCKS connections. */
   int SocksPort; /**< Port to listen on for SOCKS connections. */
   /** Port to listen on for transparent pf/netfilter connections. */
   /** Port to listen on for transparent pf/netfilter connections. */
   int TransPort;
   int TransPort;
-  int NatdPort; /**< Port to listen on for transparent natd connections. */
+  int NATDPort; /**< Port to listen on for transparent natd connections. */
   int ControlPort; /**< Port to listen on for control connections. */
   int ControlPort; /**< Port to listen on for control connections. */
   config_line_t *ControlSocket; /**< List of Unix Domain Sockets to listen on
   config_line_t *ControlSocket; /**< List of Unix Domain Sockets to listen on
                                  * for control connections. */
                                  * for control connections. */

+ 1 - 1
src/or/router.c

@@ -1099,7 +1099,7 @@ proxy_mode(or_options_t *options)
 {
 {
   return (options->SocksPort != 0 || options->SocksListenAddress ||
   return (options->SocksPort != 0 || options->SocksListenAddress ||
           options->TransPort != 0 || options->TransListenAddress ||
           options->TransPort != 0 || options->TransListenAddress ||
-          options->NatdPort != 0 || options->NatdListenAddress ||
+          options->NATDPort != 0 || options->NATDListenAddress ||
           options->DNSPort != 0 || options->DNSListenAddress);
           options->DNSPort != 0 || options->DNSListenAddress);
 }
 }