+ if (0 != strcmp (argv[2], "-"))
+ {
+ char command[LINE_LEN];
+
+ /* install our the windows NAT module*/
+ fprintf (stderr, "DEBUG: Adding NAPT/Masquerading between external IF %s and mine.\n", argv[2]);
+ local_ret = execute_shellcommand ("netsh routing ip nat install");
+ if (0 != local_ret)
+ {
+ fprintf (stderr, "FATAL: Could not install NAPT support via Netsh: %s\n", strerror (local_ret));
+ goto cleanup;
+ }
+ /* external IF */
+ snprintf (command, LINE_LEN,
+ "netsh routing ip nat add interface \"%s\" full", /*full = NAPT (addr+port)*/
+ argv[2]);
+ local_ret = execute_shellcommand (command);
+ if (0 != local_ret)
+ {
+ fprintf (stderr, "FATAL: IPv4-NAPT on external interface failed: %s\n", strerror (local_ret));
+ goto cleanup;
+ }
+ /* private/internal/virtual IF */
+ snprintf (command, LINE_LEN,
+ "netsh routing ip nat add interface \"%s\" private",
+ device_visible_name);
+ local_ret = execute_shellcommand (command);
+ if (0 != local_ret)
+ {
+ fprintf (stderr, "FATAL: IPv4-NAPT on internal interface failed: %s\n", strerror (local_ret));
+ goto cleanup;
+
+ have_nat44 = TRUE;
+ }
+ }