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.

217 lines
7.3 KiB

  1. /**INC+**********************************************************************/
  2. /* Header: nc.h */
  3. /* */
  4. /* Purpose: Node Controller Class header file */
  5. /* */
  6. /* Copyright(C) Microsoft Corporation 1997-1999 */
  7. /* */
  8. /****************************************************************************/
  9. #ifndef _H_NC
  10. #define _H_NC
  11. extern "C" {
  12. #include <adcgdata.h>
  13. #include <pchannel.h>
  14. }
  15. #include "objs.h"
  16. #include "cd.h"
  17. /**STRUCT+*******************************************************************/
  18. /* Structure: NC_CONNECT_DATA */
  19. /* */
  20. /* Description: Data passed to NC_Connect by NL */
  21. /****************************************************************************/
  22. typedef struct tagNC_CONNECT_DATA
  23. {
  24. BOOL bInitateConnect; // TRUE if initate connection,
  25. // FALSE connect with already connected
  26. // socket
  27. DCUINT addressLen;
  28. DCUINT protocolLen;
  29. DCUINT userDataLen;
  30. //
  31. // The data field must be the last thing in the
  32. // structure because we have code that computes
  33. // how long the header part is based on the field offset below
  34. //
  35. #define NC_CONNECT_DATALEN 512
  36. DCUINT8 data[NC_CONNECT_DATALEN];
  37. } NC_CONNECT_DATA, DCPTR PNC_CONNECT_DATA;
  38. /**STRUCT-*******************************************************************/
  39. /**STRUCT+*******************************************************************/
  40. /* Structure: NC_GLOBAL_DATA */
  41. /* */
  42. /* Description: */
  43. /****************************************************************************/
  44. typedef struct tagNC_GLOBAL_DATA
  45. {
  46. DCUINT16 shareChannel;
  47. DCUINT userDataLenRNS;
  48. DCUINT disconnectReason;
  49. DCUINT MCSChannelCount;
  50. DCUINT MCSChannelNumber;
  51. DCUINT16 MCSChannel[CHANNEL_MAX_COUNT];
  52. PRNS_UD_SC_NET pNetData;
  53. DCUINT32 serverVersion;
  54. DCBOOL fPendingAttachUserConfirm;
  55. /************************************************************************/
  56. /* User data */
  57. /************************************************************************/
  58. PDCUINT8 pUserDataRNS;
  59. } NC_GLOBAL_DATA, DCPTR PNC_GLOBAL_DATA;
  60. /**STRUCT-*******************************************************************/
  61. /****************************************************************************/
  62. /* */
  63. /* Constants for GCC PDUs encoded in MCS User Data */
  64. /* */
  65. /****************************************************************************/
  66. /****************************************************************************/
  67. /* MCS Header bytes */
  68. /****************************************************************************/
  69. #define NC_MCS_HDRLEN 7
  70. /****************************************************************************/
  71. /* GCCCreateConferenceRequest PDU body length */
  72. /****************************************************************************/
  73. #define NC_GCC_REQLEN 8
  74. /****************************************************************************/
  75. /* GCCCreateConferenceConfirm body length */
  76. /****************************************************************************/
  77. #define NC_GCC_RSPLEN 9
  78. /****************************************************************************/
  79. /* Maximum user data allowed */
  80. /****************************************************************************/
  81. #define NC_MAX_UDLEN 1000
  82. /****************************************************************************/
  83. /* Maximum total MCS userdata for the CreateConferenceRequest - 2 bytes for */
  84. /* each length field. */
  85. /****************************************************************************/
  86. #define NC_GCCREQ_MAX_PDULEN \
  87. (NC_MCS_HDRLEN + 2 + NC_GCC_REQLEN + 2 + H221_KEY_LEN + NC_MAX_UDLEN)
  88. class CCD;
  89. class CCC;
  90. class CMCS;
  91. class CUT;
  92. class CUI;
  93. class CRCV;
  94. class CNL;
  95. class CSL;
  96. class CChan;
  97. class CNC
  98. {
  99. public:
  100. CNC(CObjs* objs);
  101. ~CNC();
  102. public:
  103. //
  104. // API Functions
  105. //
  106. DCVOID DCAPI NC_Main(DCVOID);
  107. static DCVOID DCAPI NC_StaticMain(PDCVOID param)
  108. {
  109. ((CNC*)param)->NC_Main();
  110. }
  111. DCVOID DCAPI NC_Init(DCVOID);
  112. DCVOID DCAPI NC_Term(DCVOID);
  113. DCVOID DCAPI NC_Connect(PDCVOID pUserData, DCUINT userDataLen);
  114. EXPOSE_CD_NOTIFICATION_FN(CNC, NC_Connect);
  115. DCVOID DCAPI NC_Disconnect(ULONG_PTR unused);
  116. EXPOSE_CD_SIMPLE_NOTIFICATION_FN(CNC, NC_Disconnect);
  117. public:
  118. //
  119. // Callbacks
  120. //
  121. DCVOID DCCALLBACK NC_OnMCSConnected(DCUINT result,
  122. PDCUINT8 pUserData,
  123. DCUINT userDataLen);
  124. DCVOID DCCALLBACK NC_OnMCSAttachUserConfirm(DCUINT result, DCUINT16 userID);
  125. DCVOID DCCALLBACK NC_OnMCSChannelJoinConfirm(DCUINT result, DCUINT16 channel);
  126. DCVOID DCCALLBACK NC_OnMCSDisconnected(DCUINT reason);
  127. DCVOID DCCALLBACK NC_OnMCSBufferAvailable(DCVOID);
  128. //
  129. // Static callbacks (Delegate to appropriate instance)
  130. //
  131. static DCVOID DCCALLBACK NC_StaticOnMCSConnected(CNC* inst, DCUINT result,
  132. PDCUINT8 pUserData,
  133. DCUINT userDataLen)
  134. {
  135. inst->NC_OnMCSConnected(result, pUserData, userDataLen);
  136. }
  137. static DCVOID DCCALLBACK NC_StaticOnMCSAttachUserConfirm(CNC* inst, DCUINT result, DCUINT16 userID)
  138. {
  139. inst->NC_OnMCSAttachUserConfirm(result, userID);
  140. }
  141. static DCVOID DCCALLBACK NC_StaticOnMCSChannelJoinConfirm(CNC* inst,
  142. DCUINT result, DCUINT16 channel)
  143. {
  144. inst->NC_OnMCSChannelJoinConfirm( result, channel);
  145. }
  146. static DCVOID DCCALLBACK NC_StaticOnMCSDisconnected(CNC* inst, DCUINT reason)
  147. {
  148. inst->NC_OnMCSDisconnected( reason);
  149. }
  150. static DCVOID DCCALLBACK NC_StaticOnMCSBufferAvailable(CNC* inst)
  151. {
  152. inst->NC_OnMCSBufferAvailable();
  153. }
  154. public:
  155. //
  156. // Public data members
  157. //
  158. NC_GLOBAL_DATA _NC;
  159. private:
  160. CCD* _pCd;
  161. CCC* _pCc;
  162. CMCS* _pMcs;
  163. CUT* _pUt;
  164. CUI* _pUi;
  165. CRCV* _pRcv;
  166. CNL* _pNl;
  167. CSL* _pSl;
  168. CChan* _pChan;
  169. private:
  170. CObjs* _pClientObjects;
  171. };
  172. #endif // _H_NC