00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef _PQOS
00044 #define _PQOS
00045
00046 #ifdef P_USE_PRAGMA
00047 #pragma interface
00048 #endif
00049
00050 #if P_HAS_QOS
00051 #ifdef _WIN32
00052 #ifndef P_KNOCKOUT_WINSOCK2
00053 #include <winsock2.h>
00054 #include <ws2tcpip.h>
00055
00056 #ifndef P_KNOCKOUT_QOS
00057 #include <qossp.h>
00058 #endif // KNOCKOUT_QOS
00059 #endif // KNOCKOUT_WINSOCK2
00060 #endif // _WIN32
00061 #endif // P_HAS_QOS
00062
00063 #ifndef QOS_NOT_SPECIFIED
00064 #define QOS_NOT_SPECIFIED 0xFFFFFFFF
00065 #endif
00066
00067 #ifndef SERVICETYPE
00068 #define SERVICETYPE DWORD
00069 #endif
00070
00071 #ifndef SERVICETYPE_GUARANTEED
00072 #define SERVICETYPE_GUARANTEED 0x00000003
00073 #endif
00074
00075 #ifndef SERVICETYPE_CONTROLLEDLOAD
00076 #define SERVICETYPE_CONTROLLEDLOAD 0x00000002
00077 #endif
00078
00079 #ifndef SERVICETYPE_BESTEFFORT
00080 #define SERVICETYPE_BESTEFFORT 0x00000001
00081 #endif
00082
00083 #define SERVICETYPE_PNOTDEFINED 0xFFFFFFFF
00084
00085 class PQoS : public PObject
00086 {
00087 PCLASSINFO(PQoS, PObject);
00088
00089 public:
00090 PQoS();
00091 PQoS(DWORD avgBytesPerSec,
00092 DWORD winServiceType,
00093 int DSCPalternative = -1,
00094 DWORD maxFrameBytes = 1500,
00095 DWORD peakBytesPerSec = QOS_NOT_SPECIFIED);
00096 PQoS(int DSCPvalue);
00097
00098 void SetAvgBytesPerSec(DWORD avgBytesPerSec);
00099 void SetWinServiceType(DWORD winServiceType);
00100 void SetDSCP(int DSCPvalue);
00101 void SetMaxFrameBytes(DWORD maxFrameBytes);
00102 void SetPeakBytesPerSec(DWORD peakBytesPerSec);
00103
00104 DWORD GetTokenRate() const { return tokenRate;}
00105 DWORD GetTokenBucketSize() const { return tokenBucketSize;}
00106 DWORD GetPeakBandwidth() const { return peakBandwidth;}
00107 DWORD GetServiceType() const { return serviceType;}
00108 int GetDSCP() const { return dscp;}
00109
00110 static void SetDSCPAlternative(DWORD winServiceType,
00111 UINT dscp);
00112 static char bestEffortDSCP;
00113 static char controlledLoadDSCP;
00114 static char guaranteedDSCP;
00115
00116 protected:
00117 int dscp;
00118 DWORD tokenRate;
00119 DWORD tokenBucketSize;
00120 DWORD peakBandwidth;
00121 DWORD serviceType;
00122
00123 };
00124
00125 #endif // _PQOS