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.

237 lines
5.9 KiB

  1. /******************************************************************************
  2. *
  3. * INTEL Corporation Proprietary Information
  4. * Copyright (c) 1994, 1995, 1996 Intel Corporation.
  5. *
  6. * This listing is supplied under the terms of a license agreement
  7. * with INTEL Corporation and may not be used, copied, nor disclosed
  8. * except in accordance with the terms of that agreement.
  9. *
  10. *****************************************************************************/
  11. /******************************************************************************
  12. *
  13. * $Workfile: api.h $
  14. * $Revision: 1.5 $
  15. * $Modtime: 06 Jun 1996 17:10:36 $
  16. * $Log: S:/STURGEON/SRC/H245/INCLUDE/VCS/api.h_v $
  17. *
  18. * Rev 1.5 06 Jun 1996 18:43:08 EHOWARDX
  19. * Unnested tracker structure and eliminated PLOCK macros.
  20. *
  21. * Rev 1.4 29 May 1996 15:20:40 EHOWARDX
  22. * Change to use HRESULT.
  23. *
  24. * Rev 1.3 20 May 1996 14:31:54 EHOWARDX
  25. * Got rid of asynchronous EndSession/Shutdown stuff.
  26. *
  27. * Rev 1.2 16 May 1996 15:55:56 EHOWARDX
  28. * Replaced LocalSequenceNum with LocalCapDescIdNum.
  29. *
  30. * Rev 1.1 13 May 1996 23:15:46 EHOWARDX
  31. * Fixed remote termcap handling.
  32. *
  33. * Rev 1.0 09 May 1996 21:04:42 EHOWARDX
  34. * Initial revision.
  35. *
  36. * Rev 1.17 09 May 1996 19:38:20 EHOWARDX
  37. * Redesigned locking logic and added new functionality.
  38. *
  39. * Rev 1.16 15 Apr 1996 15:58:14 cjutzi
  40. *
  41. * - added phase2 back
  42. *
  43. * Rev 1.15 15 Apr 1996 13:59:42 cjutzi
  44. *
  45. * - added conflict resolution
  46. * needed to change the api data structure to keep track of the
  47. * outstanding data type..
  48. *
  49. *
  50. * Rev 1.13 01 Apr 1996 16:50:48 cjutzi
  51. *
  52. * - Completed ENdConnection, and made asynch.. rather
  53. * than sync.. as before
  54. * Changed H245ShutDown to be sync rather than async..
  55. *
  56. * Rev 1.12 26 Mar 1996 09:49:08 cjutzi
  57. *
  58. * - ok.. Added Enter&Leave&Init&Delete Critical Sections for Ring 0
  59. *
  60. * Rev 1.11 13 Mar 1996 14:11:38 cjutzi
  61. *
  62. * - removed trace message from PLOCK and VLOCK
  63. * d
  64. *
  65. * Rev 1.10 13 Mar 1996 09:14:06 cjutzi
  66. * - changed LPCRITICAL SECTION to CRITICAL_SECITON *
  67. *
  68. * Rev 1.9 12 Mar 1996 15:49:08 cjutzi
  69. *
  70. * - added locking
  71. *
  72. * Rev 1.8 08 Mar 1996 14:08:02 cjutzi
  73. *
  74. * - added MuxCapsSet and MuxTable stuff for tracking..
  75. *
  76. * Rev 1.7 05 Mar 1996 09:55:08 cjutzi
  77. *
  78. * - added mux table stuff
  79. *
  80. * Rev 1.6 01 Mar 1996 13:47:26 cjutzi
  81. *
  82. * - added a state to Tracker for release indications from fsm
  83. *
  84. * Rev 1.5 15 Feb 1996 10:48:00 cjutzi
  85. * - added some structs to API
  86. * - added some defines for API
  87. *
  88. * Rev 1.4 09 Feb 1996 16:43:06 cjutzi
  89. *
  90. * - added some states
  91. * - added some tracker types
  92. * $Ident$
  93. *
  94. *****************************************************************************/
  95. #ifndef _API_H
  96. #define _API_H
  97. /********************************************************/
  98. /* api Decl */
  99. /********************************************************/
  100. #include <h245api.h> /* Instance and TypeDefs */
  101. #include <h245sys.x> /* critical section stuff */
  102. #include <h245asn1.h> /* for TermCaps */
  103. /* STATES */
  104. #define TRANSMIT 0
  105. #define RECEIVE 1
  106. #define H245_LOCAL 2
  107. #define H245_REMOTE 3
  108. /* from api_util.c */
  109. HRESULT api_init (struct InstanceStruct *pInstance);
  110. HRESULT api_deinit (struct InstanceStruct *pInstance);
  111. typedef struct H245_LINK_T
  112. {
  113. struct H245_LINK_T *p_next;
  114. } H245_LINK_T;
  115. typedef
  116. enum {
  117. API_TERMCAP_T = 0,
  118. API_OPEN_CHANNEL_T,
  119. API_CLOSE_CHANNEL_T,
  120. API_MSTSLV_T,
  121. API_SEND_MUX_T,
  122. API_RECV_MUX_T,
  123. } API_TRACKER_T;
  124. typedef
  125. enum {
  126. API_ST_WAIT_RMTACK = 0x10, /* waiting for remote ask */
  127. API_ST_WAIT_LCLACK, /* waiting for local ack */
  128. API_ST_WAIT_LCLACK_CANCEL, /* request was canceled.. */
  129. API_ST_WAIT_CONF, /* waiting for open confirm (bi only) */
  130. API_ST_IDLE /* for open only */
  131. } API_TRACKER_STATE_T;
  132. typedef
  133. enum {
  134. API_CH_ALLOC_UNDEF = 0x20,
  135. API_CH_ALLOC_LCL,
  136. API_CH_ALLOC_RMT
  137. } API_TRACKER_CH_ALLOC_T;
  138. typedef
  139. enum {
  140. API_CH_TYPE_UNDEF = 0x030,
  141. API_CH_TYPE_UNI,
  142. API_CH_TYPE_BI
  143. } API_TRACKER_CH_T;
  144. /* Tracker Structure */
  145. typedef struct
  146. {
  147. API_TRACKER_CH_ALLOC_T ChannelAlloc; /* who allocated the channel */
  148. API_TRACKER_CH_T ChannelType; /* either bi or uni */
  149. DWORD TxChannel; /* for bi&uni-directional channel */
  150. DWORD RxChannel; /* for bi-directional channel only */
  151. H245_CLIENT_T DataType; /* data type used for conflict */
  152. /* detection */
  153. } TrackerChannelStruct;
  154. typedef union
  155. {
  156. /*
  157. API_OPEN_CHANNEL_T,
  158. API_CLOSE_CHANNEL_T,
  159. */
  160. TrackerChannelStruct Channel;
  161. /*
  162. API_SEND_MUX_T,
  163. API_RECV_MUX_T,
  164. */
  165. DWORD MuxEntryCount;
  166. /* don't care */
  167. /*
  168. API_MSTSLV_T,
  169. API_TERMCAP_T
  170. */
  171. } TrackerUnion;
  172. typedef struct TrackerStruct
  173. {
  174. struct TrackerStruct *p_next;
  175. struct TrackerStruct *p_prev;
  176. DWORD_PTR TransId;
  177. API_TRACKER_STATE_T State;
  178. API_TRACKER_T TrackerType;
  179. TrackerUnion u;
  180. } Tracker_T;
  181. /* API Structure */
  182. typedef struct
  183. {
  184. enum {
  185. APIMS_Undef,
  186. APIMS_InProcess,
  187. APIMS_Master,
  188. APIMS_Slave
  189. } MasterSlave; /* master or slave or inprocess */
  190. enum {
  191. APIST_Undef,
  192. APIST_Inited,
  193. APIST_Connecting,
  194. APIST_Connected,
  195. APIST_Disconnected
  196. } SystemState; /* */
  197. DWORD MuxCapsSet;
  198. DWORD_PTR dwPreserved;
  199. H245_CONF_IND_CALLBACK_T ConfIndCallBack;/* callback for H245 Client */
  200. H245_CAPID_T LocalCapIdNum;
  201. H245_CAPDESCID_T LocalCapDescIdNum;
  202. MltmdSystmCntrlMssg PDU_LocalTermCap;
  203. MltmdSystmCntrlMssg PDU_RemoteTermCap;
  204. #define TERMCAPSET u.MltmdSystmCntrlMssg_rqst.u.terminalCapabilitySet
  205. Tracker_T *pTracker;
  206. } API_STRUCT_T;
  207. #endif // _API_H_
  208.