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.

134 lines
4.1 KiB

  1. /*****************************************************************************
  2. ******************************************************************************
  3. **
  4. **
  5. ** ICShelp.h
  6. ** Contains the useful public entry points to an ICS-assistance library
  7. ** created for the Salem/PCHealth Remote Assistance feature in Whistler
  8. **
  9. ** Dates:
  10. ** 11-1-2000 created by TomFr
  11. ** 11-17-2000 re-written as a DLL, had been an object.
  12. **
  13. ******************************************************************************
  14. *****************************************************************************/
  15. #ifndef __ICSHELP_HH__
  16. #define __ICSHELP_HH__
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /****************************************************************************
  21. **
  22. ** OpenPort(int port)
  23. ** if there is no ICS available, then we should just return...
  24. **
  25. ** Of course, we save away the Port, as it goes back in the
  26. ** FetchAllAddresses call, asthe formatted "port" whenever a
  27. ** different one is not specified.
  28. **
  29. ****************************************************************************/
  30. DWORD APIENTRY OpenPort(int Port);
  31. /****************************************************************************
  32. **
  33. ** Called to close a port, whenever a ticket is expired or closed.
  34. **
  35. ****************************************************************************/
  36. DWORD APIENTRY ClosePort(DWORD dwHandle);
  37. /****************************************************************************
  38. **
  39. ** FetchAllAddresses
  40. ** Returns a string listing all the valid IP addresses for the machine,
  41. ** followed by the DNS name of the machine.
  42. ** Formatting details:
  43. ** 1. Each address is seperated with a ";" (semicolon)
  44. ** 2. Each address consists of the "1.2.3.4", and is followed by ":p"
  45. ** where the colon is followed by the port number
  46. **
  47. ****************************************************************************/
  48. DWORD APIENTRY FetchAllAddresses(WCHAR *lpszAddr, int iBufSize);
  49. /****************************************************************************
  50. **
  51. **
  52. **
  53. **
  54. **
  55. **
  56. ****************************************************************************/
  57. DWORD APIENTRY CloseAllOpenPorts(void);
  58. /****************************************************************************
  59. **
  60. **
  61. **
  62. **
  63. **
  64. **
  65. ****************************************************************************/
  66. DWORD APIENTRY StartICSLib(void);
  67. /****************************************************************************
  68. **
  69. **
  70. **
  71. **
  72. **
  73. **
  74. ****************************************************************************/
  75. DWORD APIENTRY StopICSLib(void);
  76. /****************************************************************************
  77. **
  78. ** FetchAllAddressesEx
  79. **
  80. ****************************************************************************/
  81. // these are the flag bits to use.
  82. #define IPF_ADD_DNS 1
  83. #define IPF_NO_SORT 4
  84. DWORD APIENTRY FetchAllAddressesEx(WCHAR *lpszAddr, int iBufSize, int IPflags);
  85. /****************************************************************************
  86. **
  87. ** GetIcsStatus(PICSSTAT pStat)
  88. ** Returns a structure detailing much of what is going on inside this
  89. ** library. The dwSize entry must be filled in before calling this
  90. ** function. Use "sizeof(ICSSTAT))" to populate this before calling.
  91. **
  92. ****************************************************************************/
  93. typedef struct _ICSSTAT {
  94. DWORD dwSize;
  95. BOOL bIcsFound; // TRUE if we found a NAT to negotiate
  96. BOOL bFwFound; // TRUE if we found a FIREWALL to negotiate
  97. BOOL bIcsServer; // TRUE if this machine is the ICS server (NAT)
  98. BOOL bUsingDP; // TRUE if using the DPNHxxxx.DLL support
  99. BOOL bUsingUpnp; // TRUE for uPnP, FALSE for PAST
  100. BOOL bModemPresent;
  101. BOOL bVpnPresent;
  102. WCHAR wszPubAddr[25]; // filled in with the public side addr of ICS
  103. WCHAR wszLocAddr[25]; // IP of local NIC used for PAST bindings
  104. WCHAR wszDllName[32]; // name of DLL used for ICS support
  105. DWORD dwFlags;
  106. } ICSSTAT, *PICSSTAT;
  107. DWORD APIENTRY GetIcsStatus(PICSSTAT pStat);
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111. #endif // __ICSHELP_HH__