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.

291 lines
6.0 KiB

  1. //--------------------------------------------------------------------------
  2. //
  3. // Module Name: ULP.H
  4. //
  5. // Brief Description: This module contains declarations for the MS Internet
  6. // User Location Protocol.
  7. //
  8. // Author: Kent Settle (kentse)
  9. // Created: 22-Mar-1996
  10. //
  11. // Copyright (c) 1996 Microsoft Corporation
  12. //
  13. //--------------------------------------------------------------------------
  14. #ifndef ULP_H
  15. #define ULP_H
  16. #include <pshpack1.h> /* Assume 1 byte packing throughout */
  17. #define MAX_MIME_TYPE_LENGTH 32 // need to be changed later
  18. #define SIZEOF_MIME_TYPE (MAX_MIME_TYPE_LENGTH * sizeof (TCHAR))
  19. #define MAX_NM_APP_ID 32
  20. #define MAX_PROTOCOL_ID 32
  21. // ULP opcodes.
  22. #define ULP_OPCODE_CLIENT_REG 0 // register client.
  23. #define ULP_OPCODE_CLIENT_UNREG 1 // unregister client.
  24. #define ULP_OPCODE_APP_REG 2 // register app.
  25. #define ULP_OPCODE_APP_UNREG 3 // unregister app.
  26. #define ULP_OPCODE_RESOLVE 4 // resolve name.
  27. #define ULP_OPCODE_DIRECTORY 5 // directory query.
  28. #define ULP_OPCODE_KEEPALIVE 6 // keepalive record.
  29. #define ULP_OPCODE_SETPROPS 7 // set properties.
  30. #define ULP_OPCODE_RESOLVE_EX 8 // expanded resolve.
  31. #define ULP_OPCODE_APP_REG_EX 9 // expanded register app.
  32. #define ULP_OPCODE_DIRECTORY_EX 10 // expanded directory.
  33. // return codes.
  34. #define ULP_RCODE_SUCCESS 0
  35. #define ULP_RCODE_SERVER_ERROR 1
  36. #define ULP_RCODE_REFUSED 2
  37. #define ULP_RCODE_CONFLICT 3
  38. #define ULP_RCODE_NAME_NOT_FOUND 4
  39. #define ULP_RCODE_APP_NOT_FOUND 5
  40. #define ULP_RCODE_INCORRECT_VERSION 6
  41. #define ULP_RCODE_CLIENT_NOT_FOUND 7
  42. #define ULP_RCODE_CLIENT_NEED_RELOGON 8
  43. #define ULP_RCODE_INVALID_PARAMETER 9
  44. #define ULP_RCODE_NEED_APPLICATION_ID 10
  45. // ULP flags.
  46. #define ULP_FLAG_PUBLISH 0x01 // show in directory.
  47. // default TTL value.
  48. #define ULP_TTL_DEFAULT 10 // ten minutes.
  49. // ULP protocol version. the version number is in 5.3 format. that is
  50. // 5 bits of major version, and 3 bits of minor version.
  51. #define ULP_VERSION 0x04 // version 1.0.
  52. #define ULP_MAJOR_VERSION_MASK 0xF8
  53. #define ULP_MINOR_VERSION_MASK 0x07
  54. // version macros.
  55. #define ULP_GET_MAJOR_VERSION(ver) (((ver) & ULP_MAJOR_VERSION_MASK) >> 3)
  56. #define ULP_GET_MINOR_VERSION(ver) ((ver) & ULP_MINOR_VERSION_MASK)
  57. #define ULP_MAKE_VERSION(maj, min) (((maj) << 3) | \
  58. ((min) & ULP_MINOR_VERSION_MASK))
  59. // structures.
  60. typedef struct _ULP_PROP
  61. {
  62. DWORD dwPropertyTag;
  63. BYTE Value[1];
  64. } ULP_PROP;
  65. typedef struct _ULP_PROPERTY_ARRAY
  66. {
  67. DWORD dwTotalSize;
  68. DWORD dwVariableSize;
  69. DWORD dwPropCount;
  70. ULP_PROP Properties[1];
  71. } ULP_PROPERTY_ARRAY;
  72. typedef struct _ULP_CLIENT_REGISTER
  73. {
  74. BYTE bOpcode;
  75. BYTE bVersion;
  76. WORD wMessageID;
  77. DWORD dwMessageSize;
  78. WORD wFlags;
  79. WORD wCRP;
  80. DWORD dwLastClientSig;
  81. DWORD dwIPAddress;
  82. BYTE bData[1];
  83. } ULP_CLIENT_REGISTER;
  84. typedef struct _ULP_CLIENT_REG_RESPONSE
  85. {
  86. BYTE bOpcode;
  87. BYTE bRetcode;
  88. WORD wMessageID;
  89. HANDLE hClient;
  90. DWORD dwClientSig;
  91. } ULP_CLIENT_REG_RESPONSE;
  92. typedef struct _ULP_CLIENT_UNREGISTER
  93. {
  94. BYTE bOpcode;
  95. BYTE bVersion;
  96. WORD wMessageID;
  97. HANDLE hClient;
  98. DWORD dwClientSig;
  99. } ULP_CLIENT_UNREGISTER;
  100. typedef struct _ULP_CLIENT_UNREG_RESPONSE
  101. {
  102. BYTE bOpcode;
  103. BYTE bRetcode;
  104. WORD wMessageID;
  105. } ULP_CLIENT_UNREG_RESPONSE;
  106. typedef struct _ULP_CLIENT_KEEPALIVE
  107. {
  108. BYTE bOpcode;
  109. BYTE bVersion;
  110. WORD wMessageID;
  111. HANDLE hClient;
  112. DWORD dwClientSig;
  113. DWORD dwIPAddress;
  114. } ULP_CLIENT_KEEPALIVE;
  115. typedef struct _ULP_KEEPALIVE_RESPONSE
  116. {
  117. BYTE bOpcode;
  118. BYTE bRetcode;
  119. WORD wMessageID;
  120. WORD wNewCRP;
  121. DWORD dwReserved;
  122. } ULP_KEEPALIVE_RESPONSE;
  123. #define ULP_KA_RESERVED ((DWORD) 0xFFF98052)
  124. typedef struct _ULP_APP_REGISTER
  125. {
  126. BYTE bOpcode;
  127. BYTE bVersion;
  128. WORD wMessageID;
  129. DWORD dwMessageSize;
  130. HANDLE hClient;
  131. GUID ApplicationID;
  132. GUID ProtocolID;
  133. WORD wPort;
  134. BYTE bData[1];
  135. } ULP_APP_REGISTER;
  136. typedef struct _ULP_APP_REGISTER_EX
  137. {
  138. BYTE bOpcode;
  139. BYTE bVersion;
  140. WORD wMessageID;
  141. DWORD dwMessageSize;
  142. HANDLE hClient;
  143. WORD wPort;
  144. BYTE bData[1];
  145. // appid
  146. // appmime
  147. // protid
  148. // protmime
  149. // PROPERTIES
  150. } ULP_APP_REGISTER_EX;
  151. typedef struct _ULP_APP_REGISTER_RESPONSE
  152. {
  153. BYTE bOpcode;
  154. BYTE bRetcode;
  155. WORD wMessageID;
  156. HANDLE hApplication;
  157. } ULP_APP_REGISTER_RESPONSE;
  158. typedef struct _ULP_APP_UNREGISTER
  159. {
  160. BYTE bOpcode;
  161. BYTE bVersion;
  162. WORD wMessageID;
  163. HANDLE hApplication;
  164. HANDLE hClient;
  165. DWORD dwClientSig;
  166. } ULP_APP_UNREGISTER;
  167. typedef struct _ULP_APP_UNREG_RESPONSE
  168. {
  169. BYTE bOpcode;
  170. BYTE bRetcode;
  171. WORD wMessageID;
  172. } ULP_APP_UNREG_RESPONSE;
  173. typedef struct _ULP_SETPROP
  174. {
  175. BYTE bOpcode;
  176. BYTE bVersion;
  177. WORD wMessageID;
  178. DWORD dwMessageSize;
  179. HANDLE hClient;
  180. HANDLE hApplication;
  181. DWORD dwClientSig;
  182. BYTE bData[1];
  183. } ULP_SETPROP;
  184. typedef struct _ULP_SETPROP_RESPONSE
  185. {
  186. BYTE bOpcode;
  187. BYTE bRetcode;
  188. WORD wMessageID;
  189. } ULP_SETPROP_RESPONSE;
  190. typedef struct _ULP_RESOLVE
  191. {
  192. BYTE bOpcode;
  193. BYTE bVersion;
  194. WORD wMessageID;
  195. DWORD dwMessageSize;
  196. GUID ApplicationID;
  197. BYTE bData[1];
  198. } ULP_RESOLVE;
  199. typedef struct _ULP_RESOLVE_EX
  200. {
  201. BYTE bOpcode;
  202. BYTE bVersion;
  203. WORD wMessageID;
  204. DWORD dwMessageSize;
  205. BYTE bData[1];
  206. // appid
  207. // protid
  208. // OTHERS
  209. } ULP_RESOLVE_EX;
  210. typedef struct _ULP_RESOLVE_RESPONSE
  211. {
  212. BYTE bOpcode;
  213. BYTE bRetcode;
  214. WORD wMessageID;
  215. DWORD dwMessageSize;
  216. DWORD dwIPAddress;
  217. WORD wPort;
  218. BYTE bData[1];
  219. } ULP_RESOLVE_RESPONSE;
  220. typedef struct _ULP_DIRECTORY
  221. {
  222. BYTE bOpcode;
  223. BYTE bVersion;
  224. WORD wMessageID;
  225. DWORD dwMessageSize;
  226. GUID ApplicationID;
  227. GUID ProtocolID;
  228. DWORD dwFilterSize;
  229. WORD wNextNameCount;
  230. BYTE bData[1];
  231. } ULP_DIRECTORY;
  232. typedef struct _ULP_DIRECTORY_EX
  233. {
  234. BYTE bOpcode;
  235. BYTE bVersion;
  236. WORD wMessageID;
  237. DWORD dwMessageSize;
  238. DWORD dwFilterSize;
  239. WORD wNextNameCount;
  240. BYTE bData[1];
  241. } ULP_DIRECTORY_EX;
  242. typedef struct _ULP_DIRECTORY_RESPONSE
  243. {
  244. BYTE bOpcode;
  245. BYTE bRetcode;
  246. WORD wMessageID;
  247. DWORD dwMessageSize;
  248. DWORD dwMatchesReturned;
  249. BYTE bData[1];
  250. } ULP_DIRECTORY_RESPONSE;
  251. #include <poppack.h> /* End byte packing */
  252. #endif // ULP_H