| 478 | } |
| 479 | |
| 480 | int wmain(int argc, WCHAR **argv) |
| 481 | { |
| 482 | WSADATA dat; |
| 483 | if (WSAStartup(MAKEWORD(2, 2), &dat)) { |
| 484 | std::cout << "WSAStartup failed\n"; |
| 485 | return 3; |
| 486 | } |
| 487 | |
| 488 | po::variables_map vm; |
| 489 | printInfoStruct printInfo; |
| 490 | if (parseArguments(argc, argv, vm, printInfo) != -1) |
| 491 | return 3; |
| 492 | |
| 493 | if (!resolveHostname(printInfo.host, printInfo.ipv6, printInfo.ip)) |
| 494 | return 3; |
| 495 | |
| 496 | response response; |
| 497 | |
| 498 | if (printInfo.ipv6) { |
| 499 | if (check_ping6(printInfo, response) != -1) |
| 500 | return 3; |
| 501 | } else { |
| 502 | if (check_ping4(printInfo, response) != -1) |
| 503 | return 3; |
| 504 | } |
| 505 | |
| 506 | WSACleanup(); |
| 507 | |
| 508 | return printOutput(printInfo, response); |
| 509 | } |
nothing calls this directly
no test coverage detected