diff options
author | GDR! <gdr@gdr.name> | 2017-10-20 22:53:03 +0200 |
---|---|---|
committer | GDR! <gdr@gdr.name> | 2017-10-20 22:53:03 +0200 |
commit | a2ad73a5b544459a3d0ee8c7e408ac058c040dc0 (patch) | |
tree | 6289ab7251ca0d4190c0538c91cf7318c43b6555 | |
parent | 77177d357b5bcb2e7fedabcceab3df085b73e9f0 (diff) |
Rename -P to -W for consistency with SSH client
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | VPN.md | 4 | ||||
-rw-r--r-- | main.c | 6 | ||||
-rwxr-xr-x | scripts/tokssh | 4 | ||||
-rw-r--r-- | util.c | 2 |
5 files changed, 9 insertions, 9 deletions
@@ -54,7 +54,7 @@ The -L switch works (almost) the same way it does in SSH. For the uninitiated, - | |||
54 | 54 | ||
55 | Alternatively, SSH ProxyCommand mode works too: | 55 | Alternatively, SSH ProxyCommand mode works too: |
56 | 56 | ||
57 | ssh -o ProxyCommand='./tuntox -i <ToxID> -P localhost:22' gdr@localhost | 57 | ssh -o ProxyCommand='./tuntox -i <ToxID> -W localhost:22' gdr@localhost |
58 | 58 | ||
59 | Fun stuff: [VPN over Tox](VPN.md) | 59 | Fun stuff: [VPN over Tox](VPN.md) |
60 | 60 | ||
@@ -8,7 +8,7 @@ On the server (where tuntox is already running): | |||
8 | 8 | ||
9 | On the client: | 9 | On the client: |
10 | 10 | ||
11 | socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:./tuntox -P 127.0.0.1@9876 -i 86e70ffe9f835b12667d296f2df9c307ba1aff06' | 11 | socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:./tuntox -W 127.0.0.1@9876 -i 86e70ffe9f835b12667d296f2df9c307ba1aff06' |
12 | 12 | ||
13 | Viola, you have a point-to-point VPN. On client: | 13 | Viola, you have a point-to-point VPN. On client: |
14 | 14 | ||
@@ -28,7 +28,7 @@ Also: inefficient, insecure (requires PermitRootLogin yes on server). | |||
28 | 28 | ||
29 | On the client: | 29 | On the client: |
30 | 30 | ||
31 | socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:ssh root@localhost -o ProxyCommand=\"./tuntox -P "127.0.0.1:22" -d -i 86e70ffe9f835b12667d296f2df9c307ba1aff06\" socat -d -d - "TUN:10.20.30.41/24,up"' | 31 | socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:ssh root@localhost -o ProxyCommand=\"./tuntox -W "127.0.0.1:22" -d -i 86e70ffe9f835b12667d296f2df9c307ba1aff06\" socat -d -d - "TUN:10.20.30.41/24,up"' |
32 | 32 | ||
33 | # ping 10.20.30.41 | 33 | # ping 10.20.30.41 |
34 | PING 10.20.30.41 (10.20.30.41) 56(84) bytes of data. | 34 | PING 10.20.30.41 (10.20.30.41) 56(84) bytes of data. |
@@ -1181,7 +1181,7 @@ void help() | |||
1181 | fprintf(stderr, " -i <toxid> - remote point Tox ID\n"); | 1181 | fprintf(stderr, " -i <toxid> - remote point Tox ID\n"); |
1182 | fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n"); | 1182 | fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n"); |
1183 | fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); | 1183 | fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); |
1184 | fprintf(stderr, " -P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n"); | 1184 | fprintf(stderr, " -W <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n"); |
1185 | fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n"); | 1185 | fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n"); |
1186 | fprintf(stderr, " -p - ping the server from -i and exit\n"); | 1186 | fprintf(stderr, " -p - ping the server from -i and exit\n"); |
1187 | fprintf(stderr, " Common:\n"); | 1187 | fprintf(stderr, " Common:\n"); |
@@ -1237,13 +1237,13 @@ int main(int argc, char *argv[]) | |||
1237 | } | 1237 | } |
1238 | log_printf(L_DEBUG, "Forwarding remote port %d to local port %d\n", remote_port, local_port); | 1238 | log_printf(L_DEBUG, "Forwarding remote port %d to local port %d\n", remote_port, local_port); |
1239 | break; | 1239 | break; |
1240 | case 'P': | 1240 | case 'W': |
1241 | /* Pipe forwarding */ | 1241 | /* Pipe forwarding */ |
1242 | client_mode = 1; | 1242 | client_mode = 1; |
1243 | client_pipe_mode = 1; | 1243 | client_pipe_mode = 1; |
1244 | if(parse_pipe_port_forward(optarg, &remote_host, &remote_port) < 0) | 1244 | if(parse_pipe_port_forward(optarg, &remote_host, &remote_port) < 0) |
1245 | { | 1245 | { |
1246 | log_printf(L_ERROR, "Invalid value for -P option - use something like -P 127.0.0.1:22\n"); | 1246 | log_printf(L_ERROR, "Invalid value for -W option - use something like -W 127.0.0.1:22\n"); |
1247 | exit(1); | 1247 | exit(1); |
1248 | } | 1248 | } |
1249 | if(min_log_level == L_UNSET) | 1249 | if(min_log_level == L_UNSET) |
diff --git a/scripts/tokssh b/scripts/tokssh index 0017221..6bdb74d 100755 --- a/scripts/tokssh +++ b/scripts/tokssh | |||
@@ -29,9 +29,9 @@ then | |||
29 | # last argument is user@toxid | 29 | # last argument is user@toxid |
30 | user=${arruserhost[0]} | 30 | user=${arruserhost[0]} |
31 | toxid=${arruserhost[1]} | 31 | toxid=${arruserhost[1]} |
32 | ssh -o ProxyCommand="tuntox -i $toxid -P 127.0.0.1:%p $secret" $args $user@localhost | 32 | ssh -o ProxyCommand="tuntox -i $toxid -W 127.0.0.1:%p $secret" $args $user@localhost |
33 | else | 33 | else |
34 | # last argument is just toxid | 34 | # last argument is just toxid |
35 | ssh -o ProxyCommand="tuntox -i $userhost -P 127.0.0.1:%p $secret" $args localhost | 35 | ssh -o ProxyCommand="tuntox -i $userhost -W 127.0.0.1:%p $secret" $args localhost |
36 | fi | 36 | fi |
37 | 37 | ||
@@ -114,7 +114,7 @@ int parse_local_port_forward(char *string, int *local_port, char **hostname, int | |||
114 | return 0; | 114 | return 0; |
115 | } | 115 | } |
116 | 116 | ||
117 | /* Parse the -P parameter */ | 117 | /* Parse the -W parameter */ |
118 | /* 0 = success */ | 118 | /* 0 = success */ |
119 | int parse_pipe_port_forward(char *string, char **hostname, int *remote_port) | 119 | int parse_pipe_port_forward(char *string, char **hostname, int *remote_port) |
120 | { | 120 | { |