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.

167 lines
5.3 KiB

  1. /*
  2. * mcatmcs.h
  3. *
  4. * Copyright (c) 1993 - 1995 by DataBeam Corporation, Lexington, KY
  5. *
  6. * Abstract:
  7. * This is the interface file for the MCS DLL. This file defines all
  8. * macros, types, and functions needed to use the MCS DLL, allowing MCS
  9. * services to be accessed from user applications.
  10. *
  11. * Basically, an application requests services from MCS by making direct
  12. * calls into the DLL (this includes T.122 requests and responses). MCS
  13. * sends information back to the application through a callback (this
  14. * includes T.122 indications and confirms). The callback
  15. * for a particular user attachment is specified in the call
  16. * MCS_AttachRequest.
  17. *
  18. * Note that this is a "C" language interface in order to prevent any "C++"
  19. * naming conflicts between different compiler manufacturers. Therefore,
  20. * if this file is included in a module that is being compiled with a "C++"
  21. * compiler, it is necessary to use the following syntax:
  22. *
  23. * extern "C"
  24. * {
  25. * #include "mcatmcs.h"
  26. * }
  27. *
  28. * This disables C++ name mangling on the API entry points defined within
  29. * this file.
  30. *
  31. * Author:
  32. * James P. Galvin, Jr.
  33. */
  34. #ifndef __MCATMCS_H__
  35. #define __MCATMCS_H__
  36. #include "databeam.h"
  37. #include "mcspdu.h"
  38. #include <t120type.h>
  39. /*
  40. * The following definitions are used to identify various parameters within
  41. * MCS, and are part of the MCS protocol definition.
  42. *
  43. * Priority
  44. * MCS specifies the use of up to four levels of priority. An application
  45. * should NOT use TOP_PRIORITY (this level is reserved for MCS traffic).
  46. * Segmentation
  47. * This type is used when specifying whether a given data indication is the
  48. * first or last one in a user data block (or both or neither).
  49. * TokenStatus
  50. * This type is returned when testing the current state of a token.
  51. * Reason
  52. * When MCS issues an indication to a user application, it often includes a
  53. * reason parameter informing the user of why the activity is occurring.
  54. * Result
  55. * When a user makes a request of MCS, MCS often responds with a result,
  56. * letting the user know whether or not the request succeeded.
  57. */
  58. typedef PDUPriority Priority;
  59. typedef PDUSegmentation Segmentation;
  60. typedef Priority * PPriority;
  61. typedef Segmentation * PSegmentation;
  62. #define SEGMENTATION_BEGIN 0x80
  63. #define SEGMENTATION_END 0x40
  64. /*
  65. * The following type is used to indicate what merge state the local provider
  66. * is in. Note that this is a local implementation feature that is not part
  67. * of the standard MCS definition.
  68. *
  69. * Whenever the former Top Provider of a domain enters the domain merge state,
  70. * it indicates this to all applications locally attached to that domain by
  71. * sending an MCS_MERGE_DOMAIN_INDICATION. This type (MergeStatus) is the
  72. * parameter to that call. It will be called twice, the first time indicating
  73. * that the domain is entering the merge state. The second time indicates that
  74. * the domain merger is complete.
  75. *
  76. * All T.122 primitives (requests and responses) will be rejected during the
  77. * time that the domain merger is in progress. It is the repsonsibility of
  78. * the user application to re-try the primitive once the merge is complete.
  79. */
  80. typedef unsigned short MergeStatus;
  81. typedef MergeStatus * PMergeStatus;
  82. #define MERGE_DOMAIN_IN_PROGRESS 0
  83. #define MERGE_DOMAIN_COMPLETE 1
  84. /*
  85. * This type is the signature of an MCS call back function. MCS uses this
  86. * function to let the application know when an event occurs.
  87. *
  88. * Note that an MCS callback routine needs to return a value to MCS. This
  89. * value should either be MCS_NO_ERROR if the callback was successfully
  90. * processed, or MCS_CALLBACK_NOT_PROCESSED if the callback was not processed.
  91. * In the latter case, MCS will hold on to the information contained in the
  92. * callback message, so that it can try issuing the same callback during the
  93. * next time slice. It will keep retrying until the user application accepts
  94. * the callback message (by returning MCS_NO_ERROR). This is how flow control
  95. * works for information flowing upward from MCS to the application.
  96. */
  97. typedef void (CALLBACK *MCSCallBack) (UINT, LPARAM, LPVOID);
  98. /*
  99. typedef struct
  100. {
  101. ChannelID channel_id;
  102. Priority priority;
  103. UserID sender_id;
  104. Segmentation segmentation;
  105. unsigned char * user_data;
  106. unsigned long user_data_length;
  107. } SendData;
  108. */
  109. typedef SendDataRequestPDU SendData;
  110. typedef SendData * PSendData;
  111. // This constant defines the maximum MCS PDU size for applications
  112. #define MAX_MCS_DATA_SIZE 4096
  113. /*
  114. * This section defines the messages that can be sent to the application
  115. * through the callback facility. These messages correspond to the indications
  116. * and confirms that are defined within T.122.
  117. */
  118. typedef T120MessageType MCSMessageType;
  119. /*
  120. * The following declaration defines the flags that can be set when
  121. * calling MCSSendDataRequest.
  122. */
  123. typedef enum {
  124. APP_ALLOCATION,
  125. MCS_ALLOCATION
  126. } SendDataFlags, *PSendDataFlags;
  127. /*
  128. * The following type defines whether the SendDataRequest
  129. * is a normal send or a uniform send.
  130. */
  131. typedef enum {
  132. NORMAL_SEND_DATA,
  133. UNIFORM_SEND_DATA
  134. } DataRequestType, *PDataRequestType;
  135. typedef enum
  136. {
  137. TOP_PRIORITY_MASK =0x0001,
  138. HIGH_PRIORITY_MASK =0x0002,
  139. LOW_MEDIUM_MASK =0x0004,
  140. LOW_PRIORITY_MASK =0x0008,
  141. UNIFORM_SEND_DATA_MASK =0x0010,
  142. NORMAL_SEND_DATA_MASK =0x0020,
  143. MCS_ALLOCATION_MASK =0x0040,
  144. APP_ALLOCATION_MASK =0x0080
  145. } MCSSenDataMasks;
  146. #endif // __MCATMCS_H__