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.

242 lines
6.2 KiB

  1. /*++
  2. Copyright (c) 1999, Microsoft Corporation
  3. Module Name:
  4. ipqosrm.h
  5. Abstract:
  6. The file contains the IP router manager
  7. interface for the QOS Mgr Protocol.
  8. Revision History:
  9. --*/
  10. #ifndef __IPQOSRM_H_
  11. #define __IPQOSRM_H_
  12. //
  13. // Constants
  14. //
  15. //
  16. // Current QOS configuration version
  17. //
  18. #define QOS_CONFIG_VERSION_500 500
  19. //
  20. // Constants for the field
  21. // IPQOS_GLOBAL_CONFIG::LoggingLevel
  22. //
  23. #define IPQOS_LOGGING_NONE 0
  24. #define IPQOS_LOGGING_ERROR 1
  25. #define IPQOS_LOGGING_WARN 2
  26. #define IPQOS_LOGGING_INFO 3
  27. //
  28. // Constants identifying QOS's MIB tables
  29. //
  30. #define IPQOS_GLOBAL_STATS_ID 0
  31. #define IPQOS_GLOBAL_CONFIG_ID 1
  32. #define IPQOS_IF_STATS_ID 2
  33. #define IPQOS_IF_CONFIG_ID 3
  34. //
  35. // Structures
  36. //
  37. //
  38. // In the following structures, all IP
  39. // addresses are in network byte order
  40. //
  41. typedef struct _IPQOS_NAMED_FLOWSPEC
  42. {
  43. WCHAR FlowspecName[MAX_STRING_LENGTH];
  44. FLOWSPEC FlowspecDesc;
  45. }
  46. IPQOS_NAMED_FLOWSPEC, *PIPQOS_NAMED_FLOWSPEC;
  47. typedef struct _IPQOS_NAMED_QOSOBJECT
  48. {
  49. WCHAR QosObjectName[MAX_STRING_LENGTH];
  50. QOS_OBJECT_HDR QosObjectHdr;
  51. }
  52. IPQOS_NAMED_QOSOBJECT, *PIPQOS_NAMED_QOSOBJECT;
  53. //
  54. // This MIB entry stores global config
  55. // info for IP QOS MGR protocol.
  56. //
  57. typedef struct _IPQOS_GLOBAL_CONFIG
  58. {
  59. DWORD LoggingLevel; // Detail of debug logging in qos
  60. ULONG NumFlowspecs; // Number of flowspecs defined
  61. ULONG NumQosObjects; // Number of qos objects defined
  62. // IPQOS_NAMED_FLOWSPEC FlowSpecs[0]; // Array of all flowspecs
  63. //
  64. // IPQOS_NAMED_QOSOBJECTS QosObjects[0]; // Array of all q objects
  65. }
  66. IPQOS_GLOBAL_CONFIG, *PIPQOS_GLOBAL_CONFIG;
  67. //
  68. // Macros to operate on global config
  69. //
  70. #define IPQOS_GET_FIRST_FLOWSPEC_IN_CONFIG(Config) \
  71. (PIPQOS_NAMED_FLOWSPEC)((PUCHAR)(Config) + \
  72. sizeof(IPQOS_GLOBAL_CONFIG)) \
  73. #define IPQOS_GET_NEXT_FLOWSPEC_IN_CONFIG(Flowspec) \
  74. (Flowspec + 1)
  75. #define IPQOS_GET_FIRST_QOSOBJECT_IN_CONFIG(Config) \
  76. (PIPQOS_NAMED_QOSOBJECT)((PUCHAR)(Config) + \
  77. sizeof(IPQOS_GLOBAL_CONFIG) + \
  78. (Config->NumFlowspecs * \
  79. sizeof(IPQOS_NAMED_FLOWSPEC)))
  80. #define IPQOS_GET_NEXT_QOSOBJECT_IN_CONFIG(QosObject) \
  81. (PIPQOS_NAMED_QOSOBJECT)((PUCHAR) QosObject + \
  82. FIELD_OFFSET(IPQOS_NAMED_QOSOBJECT, \
  83. QosObjectHdr) + \
  84. QosObject->QosObjectHdr.ObjectLength)
  85. typedef struct _IPQOS_NAMED_FLOW
  86. {
  87. WCHAR SendingFlowspecName[MAX_STRING_LENGTH];
  88. WCHAR RecvingFlowspecName[MAX_STRING_LENGTH];
  89. ULONG NumTcObjects;
  90. // WCHAR TcObjectNames[0];
  91. }
  92. IPQOS_NAMED_FLOW, *PIPQOS_NAMED_FLOW;
  93. //
  94. // Macros to operate on a named flow
  95. //
  96. #define IPQOS_GET_FIRST_OBJECT_NAME_ON_NAMED_FLOW(FlowDesc) \
  97. (PWCHAR) ((PUCHAR)(FlowDesc) + sizeof(IPQOS_NAMED_FLOW))
  98. #define IPQOS_GET_NEXT_OBJECT_NAME_ON_NAMED_FLOW(ObjectName) \
  99. (ObjectName + MAX_STRING_LENGTH)
  100. //
  101. // Describes a generic flow description
  102. //
  103. typedef struct _IPQOS_IF_FLOW
  104. {
  105. WCHAR FlowName[MAX_STRING_LENGTH];
  106. // Name used to identify the flow
  107. ULONG FlowSize; // Number of bytes in description
  108. IPQOS_NAMED_FLOW FlowDesc; // Traffic Control API def'nd flow
  109. }
  110. IPQOS_IF_FLOW, *PIPQOS_IF_FLOW;
  111. //
  112. // This MIB entry describes per-interface
  113. // config for IP QOS MGR protocol
  114. //
  115. typedef struct _IPQOS_IF_CONFIG
  116. {
  117. DWORD QosState; // QOS State on this interface
  118. ULONG NumFlows; // Number of flows on this "if"
  119. // IPQOS_IF_FLOW Flows[0]; // Variable length list of flows
  120. }
  121. IPQOS_IF_CONFIG, *PIPQOS_IF_CONFIG;
  122. // State of IF
  123. #define IPQOS_STATE_DISABLED 0x00
  124. #define IPQOS_STATE_ENABLED 0x01
  125. //
  126. // Macros to operate on if config
  127. //
  128. #define IPQOS_GET_FIRST_FLOW_ON_IF(Config) \
  129. (PIPQOS_IF_FLOW) ((PUCHAR)(Config) + sizeof(IPQOS_IF_CONFIG))
  130. #define IPQOS_GET_NEXT_FLOW_ON_IF(CurrFlow) \
  131. (PIPQOS_IF_FLOW) ((PUCHAR)(CurrFlow) + (CurrFlow)->FlowSize)
  132. //
  133. // This MIB entry stores per-interface
  134. // statistics for IP QOS MGR protocol.
  135. //
  136. typedef struct _IPQOS_GLOBAL_STATS
  137. {
  138. DWORD LoggingLevel; // Detail of debug logging in qos
  139. }
  140. IPQOS_GLOBAL_STATS, *PIPQOS_GLOBAL_STATS;
  141. //
  142. // This MIB entry stores per-interface
  143. // statistics for IP QOS MGR protocol.
  144. //
  145. typedef struct _IPQOS_IF_STATS
  146. {
  147. DWORD QosState; // QOS State on this interface
  148. ULONG NumFlows; // Number of flows on this "if"
  149. }
  150. IPQOS_IF_STATS, *PIPQOS_IF_STATS;
  151. //
  152. // This is passed as input data for MibSet
  153. // Note that only the global config and
  154. // interface config are writable structs.
  155. //
  156. typedef struct _IPQOS_MIB_SET_INPUT_DATA
  157. {
  158. DWORD TypeID;
  159. DWORD IfIndex;
  160. DWORD BufferSize;
  161. DWORD Buffer[1];
  162. }
  163. IPQOS_MIB_SET_INPUT_DATA, *PIPQOS_MIB_SET_INPUT_DATA;
  164. //
  165. // This is passed as input data for -
  166. // MibGet, MibGetFirst and MibGetNext
  167. //
  168. typedef struct _IPQOS_MIB_GET_INPUT_DATA
  169. {
  170. DWORD TypeID;
  171. DWORD IfIndex;
  172. }
  173. IPQOS_MIB_GET_INPUT_DATA, *PIPQOS_MIB_GET_INPUT_DATA;
  174. //
  175. // This is passed as output data for -
  176. // MibGet, MibGetFirst, and MibGetNext.
  177. // [
  178. // Note that at the end of a table
  179. // MibGetNext wraps to the next,
  180. // and therefore the value TypeID
  181. // should be examined to see the
  182. // type of data returned in output
  183. // ]
  184. //
  185. typedef struct _IPQOS_MIB_GET_OUTPUT_DATA
  186. {
  187. DWORD TypeID;
  188. DWORD IfIndex;
  189. BYTE Buffer[1];
  190. }
  191. IPQOS_MIB_GET_OUTPUT_DATA, *PIPQOS_MIB_GET_OUTPUT_DATA;
  192. #endif // __IPQOSRM_H_