chiark / gitweb /
Works at least without crypto.
[userv-utils] / ipif / udptunnel
index 6b3d1eae679dfc24dcce50292981e532d5f10dc4..2ea5cb8dfcd4ee2f469a8e1f651f21208e9c7714 100755 (executable)
@@ -8,6 +8,7 @@
 #        | -m   (`masquerade support': subcommand gets `Wait' instead of our addr/port)
 #        | -d   (`dump keys': when no subcmd, spew keys rather than reading them;
 #                we always send keys to our subcmd if there is one)
+#        | -Dcrypto  (debug crypto - use with care, prints keys, packets &c on screen!)
 #        | -f<path-to-udptunnel-forwarder>
 #          ...
 #        ]
@@ -97,7 +98,7 @@
 # along with userv-utils; if not, write to the Free Software
 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
-# $Id: udptunnel,v 1.11 2000/05/30 22:49:36 ian Exp $
+# $Id: udptunnel,v 1.12 2000/05/30 23:06:46 ian Exp $
 
 use Socket;
 use POSIX;
@@ -172,6 +173,7 @@ $|=1;
 $masq= 0;
 $dump= 0;
 $fcmd= 'udptunnel-forwarder';
+$xfwdopts= '';
 
 while ($ARGV[0] =~ m/^-/) {
     $_= shift @ARGV;
@@ -191,6 +193,8 @@ while ($ARGV[0] =~ m/^-/) {
            $masq= 1;
        } elsif (s/^-d/-/) {
            $dump= 1;
+       } elsif (s/^-Dcrypto$/-/) {
+           $xfwdopts.= 'K';
        } else {
            quit("unknown option \`$_'");
        }
@@ -345,11 +349,12 @@ if (!$c_lcmd) {
 close UW;
 close DR;
 
-@fcmd= ($fcmd,
-       fileno(L), fileno(DW), fileno(UR),
+$xfwdopts.= 'w' if $dump;
+
+@fcmd= ($fcmd, $xfwdopts,
+       fileno(L), fileno(DW), fileno(UR), fileno(DUMPKEYS),
        $mtu, $keepalive, $timeout,
        @rapf,
-       fileno(DUMPKEYS), $dump ? 'y' : '',
        @encryption);
 debug("forwarding command @fcmd.");