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.

264 lines
9.2 KiB

  1. #ifndef _ISDMAPI_H_
  2. #define _ISDMAPI_H_
  3. /****************************************************************************
  4. *
  5. * $Archive: /rtp/support/isdm/ISDMAPI.H $
  6. *
  7. * INTEL Corporation Prorietary Information
  8. *
  9. * This listing is supplied under the terms of a license agreement
  10. * with INTEL Corporation and may not be copied nor disclosed except
  11. * in accordance with the terms of that agreement.
  12. *
  13. * Copyright (c) 1993-1994 Intel Corporation.
  14. *
  15. * $Revision: 5 $
  16. * $Date: 6/13/96 2:55p $
  17. * $Author: Cmaciocc $
  18. *
  19. * Deliverable:
  20. *
  21. * Abstract:
  22. *
  23. * Notes:
  24. *
  25. ***************************************************************************/
  26. #ifdef __cplusplus
  27. extern "C" { // Assume C declarations for C++.
  28. #endif // __cplusplus
  29. #ifndef DllExport
  30. #define DllExport __declspec( dllexport )
  31. #endif // DllExport
  32. typedef DWORD HSTATSESSION, *LPHSTATSESSION;
  33. #define MAX_SESSNAME_LENGTH 25
  34. #define MAX_MODNAME_LENGTH 20
  35. #define MAX_SESSIDENT_LENGTH 256 //consistant with max cName length
  36. #define MAX_STATNAME_LENGTH 256
  37. //stat item string name
  38. typedef char STATNAME[MAX_STATNAME_LENGTH], *LPSTATNAME;
  39. //session string name
  40. typedef char SESSIONNAME[MAX_SESSNAME_LENGTH], *LPSESSIONNAME;
  41. //module name
  42. typedef char MODULENAME[MAX_MODNAME_LENGTH], *LPMODULENAME;
  43. //identifier length
  44. typedef char SESSIONIDENT[MAX_SESSIDENT_LENGTH], *LPSESSIONIDENT;
  45. typedef struct STATSTRUCT
  46. {
  47. DWORD dwStructSize; // size of the structure
  48. STATNAME szStatName; // string name of the stat item
  49. DWORD dwToken; // session unique id of the stat item
  50. DWORD dwValue; // value(data) of the stat item
  51. DWORD dwLow; // low value for range of value
  52. DWORD dwHigh; // hi value for range of value
  53. DWORD dwLastUpdate; // time stamp of last update
  54. } STAT, *LPSTAT;
  55. // Typedefs for ISDM application entry points to ensure stricter checking
  56. // when functions are called via pointers
  57. //
  58. typedef HRESULT (*ISD_REGISTER_SESSION) (LPMODULENAME, LPSESSIONNAME, LPSESSIONIDENT, LPHSTATSESSION);
  59. typedef HRESULT (*ISD_CREATESTAT) (HSTATSESSION, LPSTAT, WORD);
  60. typedef HRESULT (*ISD_UNREGISTERSESSION) (HSTATSESSION);
  61. typedef HRESULT (*ISD_DELETESTAT) (HSTATSESSION, LPSTAT, WORD);
  62. typedef HRESULT (*ISD_UPDATESTAT) (HSTATSESSION, LPSTAT, WORD);
  63. typedef HRESULT (*ISD_GETFIRSTSESSION) (LPMODULENAME, LPSESSIONNAME, LPSESSIONIDENT, LPHSTATSESSION);
  64. typedef HRESULT (*ISD_GETNEXTSESSION) (HSTATSESSION, LPMODULENAME, LPSESSIONNAME, LPSESSIONIDENT, LPHSTATSESSION);
  65. typedef HRESULT (*ISD_GETNUMSESSIONS) (WORD *);
  66. typedef HRESULT (*ISD_GETFIRSTSTAT) (HSTATSESSION, LPSTAT);
  67. typedef HRESULT (*ISD_GETNEXTSTAT) (HSTATSESSION, LPSTAT, LPSTAT);
  68. typedef HRESULT (*ISD_GETNUMSTATS) (HSTATSESSION, WORD *);
  69. typedef HRESULT (*ISD_GETSESSIONSTATS) (HSTATSESSION, LPSTAT, WORD);
  70. typedef struct _ISDMAPI
  71. {
  72. ISD_REGISTER_SESSION ISD_RegisterSession;
  73. ISD_CREATESTAT ISD_CreateStat;
  74. ISD_UNREGISTERSESSION ISD_UnregisterSession;
  75. ISD_DELETESTAT ISD_DeleteStat;
  76. ISD_UPDATESTAT ISD_UpdateStat;
  77. ISD_GETFIRSTSESSION ISD_GetFirstSession;
  78. ISD_GETNEXTSESSION ISD_GetNextSession;
  79. ISD_GETNUMSESSIONS ISD_GetNumSessions;
  80. ISD_GETFIRSTSTAT ISD_GetFirstStat;
  81. ISD_GETNEXTSTAT ISD_GetNextStat;
  82. ISD_GETNUMSTATS ISD_GetNumStats;
  83. ISD_GETSESSIONSTATS ISD_GetSessionStats;
  84. }
  85. ISDMAPI, *LPISDMAPI;
  86. //HRESULT error defines
  87. #define ISDM_ERROR_BASE 0x7000
  88. #define ERROR_HIT_MAX_SESSIONS ISDM_ERROR_BASE + 1
  89. #define ERROR_HIT_MAX_STATS ISDM_ERROR_BASE + 2
  90. #define ERROR_ACCESSING_SESSION ISDM_ERROR_BASE + 3
  91. #define ERROR_SESSION_EXISTS ISDM_ERROR_BASE + 4
  92. #define ERROR_INVALID_SESS_HANDLE ISDM_ERROR_BASE + 5
  93. #define ERROR_INVALID_STAT_HANDLE ISDM_ERROR_BASE + 6
  94. #define ERROR_NO_SESSIONS ISDM_ERROR_BASE + 7
  95. #define ERROR_NO_STATS ISDM_ERROR_BASE + 8
  96. #define ERROR_SESSION_NOT_FOUND ISDM_ERROR_BASE + 9
  97. #define ERROR_MUTEX_WAIT_FAIL ISDM_ERROR_BASE + 10
  98. #define ERROR_TOKEN_NOT_UNIQUE ISDM_ERROR_BASE + 11
  99. #define ERROR_NO_FREE_SESSIONS ISDM_ERROR_BASE + 12
  100. #define ERROR_SESSION_GET_FAIL ISDM_ERROR_BASE + 13
  101. #define ERROR_BAD_STAT_ARRAY ISDM_ERROR_BASE + 14
  102. #define ERROR_BAD_STAT_TOKEN ISDM_ERROR_BASE + 15
  103. #define ERROR_BAD_SESSION_NAME ISDM_ERROR_BASE + 16
  104. #define ERROR_NO_FREE_STATS ISDM_ERROR_BASE + 17
  105. #define ERROR_BAD_MODULE_NAME ISDM_ERROR_BASE + 18
  106. //token defines
  107. //RRCM
  108. #define RRCM_LOCAL_STREAM 1
  109. #define RRCM_REMOTE_STREAM 2
  110. #define ISDM_TOKEN_BASE 0x0000
  111. #define ISDM_CC_CODEC ISDM_TOKEN_BASE + 1
  112. #define ISDM_CC_REMOTE ISDM_TOKEN_BASE + 2
  113. #define ISDM_CC_LOCAL ISDM_TOKEN_BASE + 3
  114. #define ISDM_RRCM_BASE 0x1000
  115. #define ISDM_SSRC ISDM_RRCM_BASE + 1
  116. #define ISDM_NUM_PCKT_SENT ISDM_RRCM_BASE + 2
  117. #define ISDM_NUM_BYTES_SENT ISDM_RRCM_BASE + 3
  118. #define ISDM_FRACTION_LOST ISDM_RRCM_BASE + 4
  119. #define ISDM_CUM_NUM_PCKT_LOST ISDM_RRCM_BASE + 5
  120. #define ISDM_XTEND_HIGHEST_SEQ_NUM ISDM_RRCM_BASE + 6
  121. #define ISDM_INTERARRIVAL_JITTER ISDM_RRCM_BASE + 7
  122. #define ISDM_LAST_SR ISDM_RRCM_BASE + 8
  123. #define ISDM_DLSR ISDM_RRCM_BASE + 9
  124. #define ISDM_NUM_BYTES_RCVD ISDM_RRCM_BASE + 10
  125. #define ISDM_NUM_PCKT_RCVD ISDM_RRCM_BASE + 11
  126. #define ISDM_NTP_FRAC ISDM_RRCM_BASE + 12
  127. #define ISDM_NTP_SEC ISDM_RRCM_BASE + 13
  128. #define ISDM_WHO_AM_I ISDM_RRCM_BASE + 14
  129. #define ISDM_FDBK_FRACTION_LOST ISDM_RRCM_BASE + 15
  130. #define ISDM_FDBK_CUM_NUM_PCKT_LOST ISDM_RRCM_BASE + 16
  131. #define ISDM_FDBK_LAST_SR ISDM_RRCM_BASE + 17
  132. #define ISDM_FDBK_DLSR ISDM_RRCM_BASE + 18
  133. #define ISDM_FDBK_INTERARRIVAL_JITTER ISDM_RRCM_BASE + 19
  134. //
  135. //Supplier calls
  136. //
  137. //registration call
  138. //This call is made whenever a new session is desired. The session name passed in must be unique
  139. //across all sessions.
  140. extern DllExport HRESULT ISD_RegisterSession
  141. (
  142. LPMODULENAME pszModuleName, // module who owns session
  143. LPSESSIONNAME pszSessionName, // string name of new session to register
  144. LPSESSIONIDENT pszSessionIdent, // further level identifier for session
  145. LPHSTATSESSION phSession // return; handle to new session
  146. );
  147. //stat creation call
  148. //add 1+ stat item(s) to a session.
  149. extern DllExport HRESULT ISD_CreateStat
  150. (
  151. HSTATSESSION hSession, // handle to session
  152. LPSTAT pStatArray, // array of structs holding new stats to create
  153. WORD wNumItems // size of array(number of new stats)
  154. );
  155. //unregistration call
  156. //deletes a session and all associated stat structs
  157. extern DllExport HRESULT ISD_UnregisterSession
  158. (
  159. HSTATSESSION hSession // handle of session to remove
  160. );
  161. //stat deletion call
  162. //delete 1+ stat item(s) from a session
  163. extern DllExport HRESULT ISD_DeleteStat
  164. (
  165. HSTATSESSION hSession, // handle to session
  166. LPSTAT pStatArray, // array of structs
  167. WORD wNumItems // size of array(number of stats to remove)
  168. );
  169. //set stat data call
  170. extern DllExport HRESULT ISD_UpdateStat
  171. (
  172. HSTATSESSION hSession, // handle of session with stat item(s)
  173. LPSTAT pStatArray, // array of structs holding items to update
  174. WORD wNumItems // size of array(number of stats to update)
  175. );
  176. //
  177. //Consumer calls
  178. //
  179. //query calls
  180. //session query
  181. extern DllExport HRESULT ISD_GetFirstSession
  182. (
  183. LPMODULENAME pszModuleName, // module who owns session
  184. LPSESSIONNAME pszSessionName, // string name of new session to register
  185. LPSESSIONIDENT pszSessionIdent, // further level identifier for session
  186. LPHSTATSESSION phSession // return; the session handle or null if empty list
  187. );
  188. //GetNext uses hCurSession to determine the next item..returned in phNextSession
  189. extern DllExport HRESULT ISD_GetNextSession
  190. (
  191. HSTATSESSION hCurSession, // the current session handle
  192. LPMODULENAME pszModuleName, // module who owns session
  193. LPSESSIONNAME pszSessionName, // string name of new session to register
  194. LPSESSIONIDENT pszSessionIdent, // further level identifier for session
  195. LPHSTATSESSION phNextSession // return; the session handle or null if at the end
  196. );
  197. extern DllExport HRESULT ISD_GetNumSessions
  198. (
  199. WORD *wNumSessions // return; number of sessions
  200. );
  201. //stat query..retreive structs for the first time(get unique ids..initial values..etc)
  202. extern DllExport HRESULT ISD_GetFirstStat
  203. (
  204. HSTATSESSION hSession, // handle to session containing stat
  205. LPSTAT pStat // return; filled struct for first stat item
  206. );
  207. //pCurrentStat and pNextStat can be identical for saving memory.
  208. extern DllExport HRESULT ISD_GetNextStat
  209. (
  210. HSTATSESSION hSession, // handle to session containing stat
  211. LPSTAT pCurrentStat, // pointer to current stat item(for determining next)
  212. LPSTAT pNextStat // return; filled struct for next stat item
  213. );
  214. extern DllExport HRESULT ISD_GetNumStats
  215. (
  216. HSTATSESSION hSession, // what session we are interested in
  217. WORD *wNumStats // return; number of stats in session
  218. );
  219. //stat retreival
  220. extern DllExport HRESULT ISD_GetSessionStats
  221. (
  222. HSTATSESSION hSession, // what session we are interested in
  223. LPSTAT pStatArray, // return; array of structs holding items
  224. WORD wNumStats // return; number of items in session
  225. );
  226. #ifdef __cplusplus
  227. } // End of extern "C" {
  228. #endif // __cplusplus
  229. #endif // ISDTAT.H