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.

203 lines
6.9 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. qos.h - QoS definitions for NDIS components.
  5. Abstract:
  6. This module defines the Quality of Service structures and types used
  7. by Winsock applications.
  8. Revision History:
  9. --*/
  10. #ifndef __QOS_H_
  11. #define __QOS_H_
  12. /*
  13. * Definitions for valued-based Service Type for each direction of data flow.
  14. */
  15. typedef ULONG SERVICETYPE;
  16. #define SERVICETYPE_NOTRAFFIC 0x00000000 /* No data in this
  17. * direction */
  18. #define SERVICETYPE_BESTEFFORT 0x00000001 /* Best Effort */
  19. #define SERVICETYPE_CONTROLLEDLOAD 0x00000002 /* Controlled Load */
  20. #define SERVICETYPE_GUARANTEED 0x00000003 /* Guaranteed */
  21. #define SERVICETYPE_NETWORK_UNAVAILABLE 0x00000004 /* Used to notify
  22. * change to user */
  23. #define SERVICETYPE_GENERAL_INFORMATION 0x00000005 /* corresponds to
  24. * "General Parameters"
  25. * defined by IntServ */
  26. #define SERVICETYPE_NOCHANGE 0x00000006 /* used to indicate
  27. * that the flow spec
  28. * contains no change
  29. * from any previous
  30. * one */
  31. #define SERVICETYPE_NONCONFORMING 0x00000009 /* Non-Conforming Traffic */
  32. #define SERVICETYPE_NETWORK_CONTROL 0x0000000A /* Network Control traffic */
  33. #define SERVICETYPE_QUALITATIVE 0x0000000D /* Qualitative applications */
  34. /********* The usage of these is currently not supported. ***************/
  35. #define SERVICE_BESTEFFORT 0x80010000
  36. #define SERVICE_CONTROLLEDLOAD 0x80020000
  37. #define SERVICE_GUARANTEED 0x80040000
  38. #define SERVICE_QUALITATIVE 0x80200000
  39. /* **************************** ***** ************************************ */
  40. /*
  41. * Flags to control the usage of RSVP on this flow.
  42. */
  43. /*
  44. * to turn off traffic control, 'OR' ( | ) this flag with the
  45. * ServiceType field in the FLOWSPEC
  46. */
  47. #define SERVICE_NO_TRAFFIC_CONTROL 0x81000000
  48. /*
  49. * this flag can be used to prevent any rsvp signaling messages from being
  50. * sent. Local traffic control will be invoked, but no RSVP Path messages
  51. * will be sent.This flag can also be used in conjunction with a receiving
  52. * flowspec to suppress the automatic generation of a Reserve message.
  53. * The application would receive notification that a Path message had arrived
  54. * and would then need to alter the QOS by issuing WSAIoctl( SIO_SET_QOS ),
  55. * to unset this flag and thereby causing Reserve messages to go out.
  56. */
  57. #define SERVICE_NO_QOS_SIGNALING 0x40000000
  58. /*
  59. * Flow Specifications for each direction of data flow.
  60. */
  61. typedef struct _flowspec
  62. {
  63. ULONG TokenRate; /* In Bytes/sec */
  64. ULONG TokenBucketSize; /* In Bytes */
  65. ULONG PeakBandwidth; /* In Bytes/sec */
  66. ULONG Latency; /* In microseconds */
  67. ULONG DelayVariation; /* In microseconds */
  68. SERVICETYPE ServiceType;
  69. ULONG MaxSduSize; /* In Bytes */
  70. ULONG MinimumPolicedSize; /* In Bytes */
  71. } FLOWSPEC, *PFLOWSPEC, * LPFLOWSPEC;
  72. /*
  73. * this value can be used in the FLOWSPEC structure to instruct the Rsvp Service
  74. * provider to derive the appropriate default value for the parameter. Note
  75. * that not all values in the FLOWSPEC structure can be defaults. In the
  76. * ReceivingFlowspec, all parameters can be defaulted except the ServiceType.
  77. * In the SendingFlowspec, the MaxSduSize and MinimumPolicedSize can be
  78. * defaulted. Other defaults may be possible. Refer to the appropriate
  79. * documentation.
  80. */
  81. #define QOS_NOT_SPECIFIED 0xFFFFFFFF
  82. /*
  83. * define a value that can be used for the PeakBandwidth, which will map into
  84. * positive infinity when the FLOWSPEC is converted into IntServ floating point
  85. * format. We can't use (-1) because that value was previously defined to mean
  86. * "select the default".
  87. */
  88. #define POSITIVE_INFINITY_RATE 0xFFFFFFFE
  89. /*
  90. * the provider specific structure can have a number of objects in it.
  91. * Each next structure in the
  92. * ProviderSpecific will be the QOS_OBJECT_HDR struct that prefaces the actual
  93. * data with a type and length for that object. This QOS_OBJECT struct can
  94. * repeat several times if there are several objects. This list of objects
  95. * terminates either when the buffer length has been reached ( WSABUF ) or
  96. * an object of type QOS_END_OF_LIST is encountered.
  97. */
  98. typedef struct {
  99. ULONG ObjectType;
  100. ULONG ObjectLength; /* the length of object buffer INCLUDING
  101. * this header */
  102. } QOS_OBJECT_HDR, *LPQOS_OBJECT_HDR;
  103. /*
  104. * general QOS objects start at this offset from the base and have a range
  105. * of 1000
  106. */
  107. #define QOS_GENERAL_ID_BASE 2000
  108. #define QOS_OBJECT_END_OF_LIST (0x00000001 + QOS_GENERAL_ID_BASE)
  109. /* QOS_End_of_list structure passed */
  110. #define QOS_OBJECT_SD_MODE (0x00000002 + QOS_GENERAL_ID_BASE)
  111. /* QOS_ShapeDiscard structure passed */
  112. #define QOS_OBJECT_SHAPING_RATE (0x00000003 + QOS_GENERAL_ID_BASE)
  113. /* QOS_ShapingRate structure */
  114. #define QOS_OBJECT_DESTADDR (0x00000004 + QOS_GENERAL_ID_BASE)
  115. /* QOS_DestAddr structure (defined in qossp.h) */
  116. /*
  117. * This structure is used to define the behaviour that the traffic
  118. * control packet shaper will apply to the flow.
  119. *
  120. * TC_NONCONF_BORROW - the flow will receive resources remaining
  121. * after all higher priority flows have been serviced. If a
  122. * TokenRate is specified, packets may be non-conforming and
  123. * will be demoted to less than best-effort priority.
  124. *
  125. * TC_NONCONF_SHAPE - TokenRate must be specified. Non-conforming
  126. * packets will be retianed in the packet shaper until they become
  127. * conforming.
  128. *
  129. * TC_NONCONF_DISCARD - TokenRate must be specified. Non-conforming
  130. * packets will be discarded.
  131. *
  132. */
  133. typedef struct _QOS_SD_MODE {
  134. QOS_OBJECT_HDR ObjectHdr;
  135. ULONG ShapeDiscardMode;
  136. } QOS_SD_MODE, *LPQOS_SD_MODE;
  137. #define TC_NONCONF_BORROW 0
  138. #define TC_NONCONF_SHAPE 1
  139. #define TC_NONCONF_DISCARD 2
  140. #define TC_NONCONF_BORROW_PLUS 3 // Not supported currently
  141. /*
  142. * This structure allows an app to specify a prorated "average token rate" using by
  143. * the traffic shaper under SHAPE modehaper queue. It is expressed in bytes per sec.
  144. *
  145. * ShapingRate (bytes per sec.)
  146. *
  147. */
  148. typedef struct _QOS_SHAPING_RATE {
  149. QOS_OBJECT_HDR ObjectHdr;
  150. ULONG ShapingRate;
  151. } QOS_SHAPING_RATE, *LPQOS_SHAPING_RATE;
  152. #endif /* __QOS_H_ */