Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
929 B

  1. #include <windows.h>
  2. #include <winsock2.h>
  3. #include <stdio.h>
  4. int addhost(char *host)
  5. {
  6. struct hostent *h;
  7. h = gethostbyname(host);
  8. if (h == NULL) {
  9. return (-1);
  10. }
  11. printf ("%s %s\n", inet_ntoa(*(struct in_addr*)(h->h_addr)), host);
  12. return 0;
  13. }
  14. int __cdecl main()
  15. {
  16. char host[18];
  17. WSADATA wsa;
  18. int i;
  19. WSAStartup(0x0101, &wsa);
  20. addhost("localhost");
  21. addhost("csstress");
  22. addhost("DOMINATOR");
  23. strcpy(host, "CS_A");
  24. for (i = 0; i < 26; i++) {
  25. host[3] = 'A' + i;
  26. addhost(host);
  27. }
  28. strcpy(host, "STRESS_A");
  29. for (i = 0; i < 26; i++) {
  30. host[7] = 'A' + i;
  31. addhost(host);
  32. }
  33. addhost("CS_IA");
  34. addhost("CS_IAB");
  35. addhost("mixedds1c");
  36. addhost("mixedds2c");
  37. addhost("mixedds3c");
  38. addhost("mixedds4c");
  39. WSACleanup();
  40. return 0;
  41. }