Source code of Windows XP (NT5)
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.

162 lines
4.9 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. ** SetAlertEvent
  79. ** Pass in an event handle. Then, whenever the ICS changes state, I
  80. ** will signal that event.
  81. **
  82. ****************************************************************************/
  83. DWORD APIENTRY SetAlertEvent(HANDLE hEvent);
  84. /****************************************************************************
  85. **
  86. ** ExpandAddress(char *szIp, char *szCompIp)
  87. ** Takes a compressed IP address and returns it to
  88. ** "normal"
  89. **
  90. ****************************************************************************/
  91. DWORD APIENTRY ExpandAddress(WCHAR *szIp, WCHAR *szCompIp);
  92. /****************************************************************************
  93. **
  94. ** SquishAddress(char *szIp, char *szCompIp)
  95. ** Takes one IP address and compresses it to minimum size
  96. **
  97. ****************************************************************************/
  98. DWORD APIENTRY SquishAddress(WCHAR *szIp, WCHAR *szCompIp);
  99. /****************************************************************************
  100. **
  101. ** FetchAllAddressesEx
  102. **
  103. ****************************************************************************/
  104. // these are the flag bits to use.
  105. #define IPF_ADD_DNS 1
  106. #define IPF_COMPRESS 2
  107. #define IPF_NO_SORT 4
  108. DWORD APIENTRY FetchAllAddressesEx(WCHAR *lpszAddr, int iBufSize, int IPflags);
  109. /****************************************************************************
  110. **
  111. ** GetIcsStatus(PICSSTAT pStat)
  112. ** Returns a structire detailing much of what is going on inside this
  113. ** library. The dwSize entry must be filled in before calling this
  114. ** function. Use "sizeof(ICSSTAT))" to populate this.
  115. **
  116. ****************************************************************************/
  117. typedef struct _ICSSTAT {
  118. DWORD dwSize;
  119. BOOL bIcsFound; // TRUE if we found an ICS wse can talk to
  120. BOOL bIcsServer; // TRUE if this machine is the ICS server
  121. BOOL bUsingDP; // TRUE if using the DPNATHLP.DLL support
  122. BOOL bUsingUpnp; // TRUE for uPnP, FALSE for PAST
  123. BOOL bModemPresent;
  124. BOOL bVpnPresent;
  125. WCHAR wszPubAddr[25]; // filled in with the public side addr of ICS
  126. WCHAR wszLocAddr[25]; // IP of local NIC used for PAST bindings
  127. WCHAR wszDllName[32]; // name of DLL used for ICS support
  128. } ICSSTAT, *PICSSTAT;
  129. DWORD APIENTRY GetIcsStatus(PICSSTAT pStat);
  130. #ifdef __cplusplus
  131. }
  132. #endif
  133. #endif // __ICSHELP_HH__