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.

182 lines
10 KiB

  1. #ifdef ENABLE_PC
  2. /****************************************************************************/
  3. /* */
  4. /* ERNCPC.HPP */
  5. /* */
  6. /* Physical Connection class for the Reference System Node Controller. */
  7. /* */
  8. /* Copyright Data Connection Ltd. 1995 */
  9. /* */
  10. /****************************************************************************/
  11. /* Changes: */
  12. /* */
  13. /* 16Jun95 NFC Created. */
  14. /* */
  15. /****************************************************************************/
  16. #ifndef __ERNCPC_HPP_
  17. #define __ERNCPC_HPP_
  18. #include "events.hpp"
  19. /****************************************************************************/
  20. /* */
  21. /* CONSTANTS */
  22. /* */
  23. /****************************************************************************/
  24. /****************************************************************************/
  25. /* States */
  26. /****************************************************************************/
  27. typedef enum
  28. {
  29. PC_ST_UNINITIALIZED,
  30. PC_ST_CONNECTING,
  31. PC_ST_CONNECTED,
  32. PC_ST_DISCONNECTING,
  33. PC_ST_REMOVED,
  34. }
  35. PC_STATE;
  36. /****************************************************************************/
  37. /* Return codes */
  38. /****************************************************************************/
  39. #define PC_RC_BAD_STATE 1
  40. #define PC_RC_INTERNAL_ERROR 3
  41. class CONFERENCE;
  42. class PC_MANAGER;
  43. class DCRNCPhysicalConnection : public CRefCount, public CPendingEventList
  44. {
  45. friend class PC_MANAGER;
  46. friend class NCUI;
  47. protected:
  48. /************************************************************************/
  49. /* State of this connection. */
  50. /************************************************************************/
  51. PC_STATE conState;
  52. BOOL bDisconnectPending;
  53. /************************************************************************/
  54. /* Address we are calling/connected to. */
  55. /************************************************************************/
  56. RNC_NODE_DETAILS UserNodeDetails;
  57. UINT asymmetry_type;
  58. public:
  59. /************************************************************************/
  60. /* FUNCTION: DCRNCPhysicalConnection Constructor. */
  61. /* */
  62. /* DESCRIPTION: */
  63. /* */
  64. /* This is the constructor for physical connection class. */
  65. /* */
  66. /* This function */
  67. /* - saves the supplied transport drivers. */
  68. /* */
  69. /* PARAMETERS: */
  70. /* */
  71. /* pManager - pointer to the physical connection manager class. */
  72. /* */
  73. /* pSuccess - pointer to BOOL holding result of constructor on return. */
  74. /* */
  75. /* RETURNS: */
  76. /* */
  77. /* Nothing (result is returned in the pSuccess parameter). */
  78. /* */
  79. /************************************************************************/
  80. DCRNCPhysicalConnection(PRNC_NODE_DETAILS pNodeDetails,
  81. UINT _asymmetry_type,
  82. PBOOL pSuccess);
  83. /************************************************************************/
  84. /* FUNCTION: DCRNCPhysicalConnection Destructor. */
  85. /* */
  86. /* DESCRIPTION: */
  87. /* */
  88. /* This is the destructor for the transport driver wrapper clas. */
  89. /* */
  90. /* PARAMETERS: */
  91. /* */
  92. /* None. */
  93. /* */
  94. /* RETURNS: */
  95. /* */
  96. /* Nothing. */
  97. /* */
  98. /************************************************************************/
  99. virtual ~DCRNCPhysicalConnection();
  100. void AddRefEvent(CEvent * pEvent);
  101. /*
  102. * The Core does not currently do anything with the status we report.
  103. * We leave the code though, in case it starts using the status info
  104. * we provide. See file erncpc.cpp
  105. */
  106. void ReportStatus(PC_STATE _conState, NCSTATUS Reason = NO_ERROR) { conState = _conState; };
  107. UINT AsymmetryType() {return asymmetry_type;};
  108. /************************************************************************/
  109. /* FUNCTION: Connect(). */
  110. /* */
  111. /* DESCRIPTION: */
  112. /* */
  113. /* This function is called to start this physical connection. */
  114. /* */
  115. /* PARAMETERS: */
  116. /* */
  117. /* RETURNS: */
  118. /* */
  119. /************************************************************************/
  120. void Connect();
  121. /************************************************************************/
  122. /* FUNCTION: Disconnect(). */
  123. /* */
  124. /* DESCRIPTION: */
  125. /* */
  126. /* This function is called to end this physical connection. */
  127. /* */
  128. /* PARAMETERS: */
  129. /* */
  130. /* None. */
  131. /* */
  132. /* RETURNS: */
  133. /* */
  134. /************************************************************************/
  135. NCSTATUS Disconnect(void);
  136. /************************************************************************/
  137. /* FUNCTION: GetNodeDetails */
  138. /* */
  139. /* DESCRIPTION: */
  140. /* */
  141. /* This function returns details of the node that this physical */
  142. /* connection refers to. */
  143. /* */
  144. /* PARAMETERS: */
  145. /* */
  146. /* Pointer to hold the node details on return. */
  147. /* */
  148. /* RETURNS: */
  149. /* */
  150. /* None. */
  151. /* */
  152. /************************************************************************/
  153. PRNC_NODE_DETAILS GetUserNodeDetails();
  154. PRNC_NODE_DETAILS GetTransportNodeDetails() { return &UserNodeDetails; };
  155. };
  156. /****************************************************************************/
  157. /* MACROS */
  158. /****************************************************************************/
  159. #endif /* __ERNCPC_HPP_ */
  160. #endif // ENABLE_PC