home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / qos.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  7.1 KB  |  201 lines

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