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.

335 lines
6.7 KiB

  1. #ifndef _RPLMSGF_
  2. #define _RPLMSGF_
  3. /*++
  4. Copyright (c) 1989 Microsoft Corporation
  5. Module Name:
  6. rplmsgf.h
  7. Abstract:
  8. header file for interfacing with the rplmsgf.c module
  9. Functions:
  10. Portability:
  11. This header is portable.
  12. Author:
  13. Pradeep Bahl (PradeepB) Jan-1993
  14. Revision History:
  15. Modification Date Person Description of Modification
  16. ------------------ ------- ---------------------------
  17. --*/
  18. /*
  19. includes
  20. */
  21. #include "wins.h"
  22. #include "comm.h"
  23. #include "rpl.h"
  24. /*
  25. defines
  26. */
  27. /*
  28. Sizes for the different messages to be sent between replicators
  29. */
  30. #define RPLMSGF_ADDVERSMAP_REQ_SIZE (sizeof(LONG) + COMM_N_TCP_HDR_SZ)
  31. #define RPLMSGF_SNDENTRIES_REQ_SIZE (COMM_N_TCP_HDR_SZ + sizeof(RPLMSGF_SENDENTRIES_REQ_T))
  32. #define RPLMSGF_ADDVERSMAP_RSP_SIZE_M(_NoOfOwners) \
  33. (COMM_N_TCP_HDR_SZ + \
  34. sizeof(RPLMSGF_ADDVERSMAP_RSP_T) + \
  35. (sizeof(RPLMSGF_OWNER_MAP_INFO_T) * (_NoOfOwners)));
  36. //
  37. // RPLMSGF_UPD_VERS_NO_REQ_T includes COMM_N_TCP_HDR
  38. //
  39. #define RPLMSGF_UPDVERSNO_REQ_SIZE sizeof(RPLMSGF_UPD_VERS_NO_REQ_T)
  40. #define RPLMSGF_UPDVERSNO_RSP_SIZE (sizeof(RPLMSGF_UPD_VERS_NO_RSP_T) + \
  41. COMM_N_TCP_HDR_SZ)
  42. /*
  43. macros
  44. */
  45. #define RPLMSGF_SET_OPC_M(pTmpB, Opc_e) \
  46. { \
  47. *(pTmpB)++ = 0; \
  48. *(pTmpB)++ = 0; \
  49. *(pTmpB)++ = 0; \
  50. *(pTmpB)++ = (BYTE)(Opc_e); \
  51. }
  52. //
  53. // Opcode is stored in the 4th byte of the message (in keeping with the
  54. // convention of passing the MSB first).
  55. //
  56. #define RPLMSGF_GET_OPC_FROM_MSG_M(pBuff, Opc_e) \
  57. { \
  58. Opc_e = *(pBuff + 3); \
  59. }
  60. /*
  61. * externs
  62. */
  63. /*
  64. * typedef definitions
  65. */
  66. //
  67. // Message structures
  68. //
  69. //
  70. // Some of these structures are used just for determining the sizes of the
  71. // buffers used for formatting the messages corresponding to them
  72. //
  73. typedef struct _RPLMSGF_ADD_VERS_MAP_REQ_T {
  74. DWORD Opcode;
  75. } RPLMSGF_ADD_VERS_MAP_REQ_T, *PRPLMSGF_ADD_VERS_MAP_REQ_T;
  76. typedef struct _RPLMSGF_OWNER_MAP_INFO_T {
  77. COMM_ADD_T Add;
  78. VERS_NO_T MaxVersNo;
  79. VERS_NO_T StartVersNo;
  80. DWORD Uid;
  81. } RPLMSGF_OWNER_MAP_INFO_T, *PRPLMSGF_OWNER_MAP_INFO_T;
  82. typedef struct _RPLMSGF_ADDVERSMAP_RSP_T {
  83. DWORD LengthOfMsg;
  84. DWORD Opcode;
  85. DWORD NoOfOwners;
  86. PRPLMSGF_OWNER_MAP_INFO_T pOwnerInfo;
  87. DWORD RplTimeInterval;
  88. } RPLMSGF_ADDVERSMAP_RSP_T, *PRPLMSGF_ADDVERSMAP_RSP_T;
  89. typedef struct _RPLMSGF_SENDENTRIES_REQ_T {
  90. DWORD LengthOfMsg;
  91. DWORD Opcode;
  92. COMM_ADD_T Add;
  93. VERS_NO_T MaxVersNo;
  94. VERS_NO_T MinVersNo;
  95. DWORD TypOfRec;
  96. } RPLMSGF_SENDENTRIES_REQ_T, PRPLMSGF_SENDENTRIES_REQ_T;
  97. typedef struct _RPLMSGF_UPD_VERS_NO_REQ_T {
  98. COMM_TCP_HDR_T TcpHdr;
  99. DWORD Opcode;
  100. BYTE Name[NMSDB_MAX_NAM_LEN];
  101. DWORD NameLen;
  102. } RPLMSGF_UPD_VERS_NO_REQ_T, *PRPLMSGF_UPD_VERS_NO_REQ_T;
  103. typedef struct _RPLMSGF_UPD_VERS_NO_RSP_T {
  104. DWORD Opcode;
  105. BYTE Rcode;
  106. } RPLMSGF_UPD_VERS_NO_RSP_T, *PRPLMSGF_UPD_VERS_NO_RSP_T;
  107. /*
  108. RPLMSGF_MSG_OPCODE_E -- lists the various opcodes used in messages sent
  109. between replicators of different WINS servers.
  110. These opcodes are used by the formatting and unformatting
  111. functions of module rplmsgf.c
  112. */
  113. typedef enum _RPLMSGF_MSG_OPCODE_E {
  114. RPLMSGF_E_ADDVERSNO_MAP_REQ = 0,
  115. RPLMSGF_E_ADDVERSNO_MAP_RSP,
  116. RPLMSGF_E_SNDENTRIES_REQ,
  117. RPLMSGF_E_SNDENTRIES_RSP,
  118. RPLMSGF_E_UPDATE_NTF, //update notification
  119. RPLMSGF_E_UPDATE_NTF_PROP, //update notification (to be
  120. //propagated
  121. RPLMSGF_E_UPDVERSNO_REQ, //update vers. no request
  122. RPLMSGF_E_UPDVERSNO_RSP, //update vers. no response
  123. //adding the following two at the end
  124. //so as to not mess up the parser's notion
  125. //of the above ones
  126. RPLMSGF_E_UPDATE_NTF_PRS, //update notification on a pers. conn
  127. RPLMSGF_E_UPDATE_NTF_PROP_PRS //update notification (to be propagated
  128. } RPLMSGF_MSG_OPCODE_E, *PRPLMSGF_MSG_OPCODE_E;
  129. /*
  130. function declarations
  131. */
  132. extern
  133. VOID
  134. RplMsgfFrmAddVersMapReq(
  135. IN LPBYTE pBuff,
  136. OUT LPDWORD pMsgLen
  137. );
  138. extern
  139. VOID
  140. RplMsgfFrmAddVersMapRsp(
  141. #if SUPPORT612WINS > 0
  142. IN BOOL fPnrIsBeta1Wins,
  143. #endif
  144. IN RPLMSGF_MSG_OPCODE_E Opcode_e,
  145. IN LPBYTE pBuff,
  146. IN DWORD BuffLen,
  147. IN PRPL_ADD_VERS_NO_T pOwnerAddVersNoMap,
  148. IN DWORD MaxNoOfOwners,
  149. IN DWORD RplTimeInterval,
  150. OUT LPDWORD pMsgLen
  151. );
  152. extern
  153. VOID
  154. RplMsgfFrmSndEntriesReq(
  155. #if SUPPORT612WINS > 0
  156. IN BOOL fPnrIsBeta1Wins,
  157. #endif
  158. IN LPBYTE pBuff,
  159. IN PCOMM_ADD_T pWinsAdd,
  160. IN VERS_NO_T MaxversNo,
  161. IN VERS_NO_T MinVersNo,
  162. IN DWORD RplType,
  163. OUT LPDWORD pMsgLen
  164. );
  165. extern
  166. VOID
  167. RplMsgfFrmSndEntriesRsp (
  168. #if SUPPORT612WINS > 0
  169. IN BOOL fPnrIsBeta1Wins,
  170. #endif
  171. IN LPBYTE pBuff,
  172. IN DWORD NoOfRecs,
  173. IN LPBYTE pName,
  174. IN DWORD NameLen,
  175. IN BOOL fGrp,
  176. IN DWORD NoOfAdd,
  177. IN PCOMM_ADD_T pNodeAdd,
  178. IN DWORD Flag,
  179. IN VERS_NO_T VersNo,
  180. IN BOOL fFirstTime,
  181. OUT LPBYTE *ppNewPos
  182. );
  183. extern
  184. VOID
  185. RplMsgfFrmUpdVersNoReq(
  186. IN LPBYTE pBuff,
  187. IN LPBYTE pName,
  188. IN DWORD NameLen,
  189. #if 0
  190. IN BOOL fBrowserName,
  191. IN BOOL fStatic,
  192. IN BYTE NodeTyp,
  193. IN PCOMM_ADD_T pNodeAdd,
  194. #endif
  195. OUT LPDWORD pMsgLen
  196. );
  197. extern
  198. VOID
  199. RplMsgfFrmUpdVersNoRsp(
  200. IN LPBYTE pBuff,
  201. IN BYTE Rcode,
  202. OUT LPDWORD pMsgLen
  203. );
  204. extern
  205. VOID
  206. RplMsgfUfmAddVersMapRsp(
  207. #if SUPPORT612WINS > 0
  208. IN BOOL fPnrIsBeta1Wins,
  209. #endif
  210. IN LPBYTE pBuff,
  211. OUT LPDWORD pNoOfMaps,
  212. OUT LPDWORD pRplTimeInterval,
  213. IN OUT PRPL_ADD_VERS_NO_T *ppAddVers
  214. );
  215. extern
  216. VOID
  217. RplMsgfUfmSndEntriesReq(
  218. #if SUPPORT612WINS > 0
  219. IN BOOL fPnrIsBeta1Wins,
  220. #endif
  221. IN LPBYTE pBuff,
  222. OUT PCOMM_ADD_T pWinsAdd,
  223. OUT PVERS_NO_T pMaxVersNo,
  224. OUT PVERS_NO_T pMinVersNo,
  225. OUT LPDWORD pRplType
  226. );
  227. extern
  228. VOID
  229. RplMsgfUfmSndEntriesRsp(
  230. #if SUPPORT612WINS > 0
  231. IN BOOL fPnrIsBeta1Wins,
  232. #endif
  233. IN OUT LPBYTE *ppBuff,
  234. OUT LPDWORD pNoOfRecs,
  235. OUT IN LPBYTE pName,
  236. OUT LPDWORD pNameLen,
  237. OUT LPBOOL pfGrp,
  238. OUT LPDWORD pNoOfAdd,
  239. OUT PCOMM_ADD_T pNodeAdd,
  240. OUT LPDWORD pFlag,
  241. OUT PVERS_NO_T pVersNo,
  242. IN BOOL fFirstTime
  243. );
  244. extern
  245. VOID
  246. RplMsgfUfmUpdVersNoReq(
  247. IN LPBYTE pBuff,
  248. IN LPBYTE pName,
  249. IN LPDWORD pNameLen
  250. #if 0
  251. IN LPBOOL pfBrowserName,
  252. IN LPBOOL pfStatic,
  253. IN LPBYTE pNodeTyp,
  254. IN PCOMM_ADD_T pNodeAdd
  255. #endif
  256. );
  257. extern
  258. VOID
  259. RplMsgfUfmUpdVersNoRsp(
  260. IN LPBYTE pBuff,
  261. IN LPBYTE pRcode
  262. );
  263. extern
  264. VOID
  265. RplMsgfUfmPullPnrReq(
  266. LPBYTE pMsg,
  267. DWORD MsgLen,
  268. PRPLMSGF_MSG_OPCODE_E pPullReqType_e
  269. );
  270. #endif //_RPLMSGF_