1@echo off
2rem wnattest.bat
3if defined %4 (
4	goto usage
5) else if defined %3 (
6	goto start
7) else (
8	goto usage
9)
10:start
11stunner %1 -i %2 -i2 %3
12if %errorlevel% == -1 (
13	echo "ERROR! the STUN test program had an error" (
14) else if %errorlevel% == 10 (
15	echo "[PASS] (Address) Restricted Cone NAT with Hairpinning"
16) else if %errorlevel% == 21 (
17	echo "[PASS] Port Restricted Cone NAT with Hairpinning"
18) else if %errorlevel% == 8 (
19	echo "[No NAT] You have open internet access"
20) else if %errorlevel% == 2 (
21	echo "[FAIL] Your (Address) Restricted Cone NAT doesn't do hairpinning"
22) else if %errorlevel% == 3 (
23	echo "[FAIL] Your Port Restricted Cone NAT doesn't do hairpinning"
24) else (
25	echo "[FAIL] You have a NAT or Firewall type which is NOT RECOMMENDED.  "
26	if %errorlevel% LSS 8 (
27		echo "It also does not support hairpinning"
28	) else (
29		each "it does at least support hairpinning"
30	)
31)
32goto end
33:usage
34echo Usage:
35echo         wnattest <server-ip> <client-primary-ip> <client-secondary-ip>
36echo.
37echo Example: wnattest 1.1.1.2 192.168.0.2 192.168.0.3
38echo.
39:end
40
41