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 #ifndef _PQOS
00041 #define _PQOS
00042
00043 #ifdef P_USE_PRAGMA
00044 #pragma interface
00045 #endif
00046
00047 #if P_HAS_QOS
00048 #ifdef _WIN32
00049 #ifndef P_KNOCKOUT_WINSOCK2
00050 #include <winsock2.h>
00051 #include <Ws2tcpip.h>
00052
00053 #ifndef P_KNOCKOUT_QOS
00054 #include <qossp.h>
00055 #endif // KNOCKOUT_QOS
00056 #endif // KNOCKOUT_WINSOCK2
00057 #endif // _WIN32
00058 #endif // P_HAS_QOS
00059
00060 #ifndef QOS_NOT_SPECIFIED
00061 #define QOS_NOT_SPECIFIED 0xFFFFFFFF
00062 #endif
00063
00064 #ifndef SERVICETYPE
00065 #define SERVICETYPE DWORD
00066 #endif
00067
00068 #ifndef SERVICETYPE_GUARANTEED
00069 #define SERVICETYPE_GUARANTEED 0x00000003
00070 #endif
00071
00072 #ifndef SERVICETYPE_CONTROLLEDLOAD
00073 #define SERVICETYPE_CONTROLLEDLOAD 0x00000002
00074 #endif
00075
00076 #ifndef SERVICETYPE_BESTEFFORT
00077 #define SERVICETYPE_BESTEFFORT 0x00000001
00078 #endif
00079
00080 #define SERVICETYPE_PNOTDEFINED 0xFFFFFFFF
00081
00082 class PQoS : public PObject
00083 {
00084 PCLASSINFO(PQoS, PObject);
00085
00086 public:
00087 PQoS();
00088 PQoS(DWORD avgBytesPerSec,
00089 DWORD winServiceType,
00090 int DSCPalternative = -1,
00091 DWORD maxFrameBytes = 1500,
00092 DWORD peakBytesPerSec = QOS_NOT_SPECIFIED);
00093 PQoS(int DSCPvalue);
00094
00095 void SetAvgBytesPerSec(DWORD avgBytesPerSec);
00096 void SetWinServiceType(DWORD winServiceType);
00097 void SetDSCP(int DSCPvalue);
00098 void SetMaxFrameBytes(DWORD maxFrameBytes);
00099 void SetPeakBytesPerSec(DWORD peakBytesPerSec);
00100
00101 DWORD GetTokenRate() const { return tokenRate;}
00102 DWORD GetTokenBucketSize() const { return tokenBucketSize;}
00103 DWORD GetPeakBandwidth() const { return peakBandwidth;}
00104 DWORD GetServiceType() const { return serviceType;}
00105 int GetDSCP() const { return dscp;}
00106
00107 static void SetDSCPAlternative(DWORD winServiceType,
00108 UINT dscp);
00109 static char bestEffortDSCP;
00110 static char controlledLoadDSCP;
00111 static char guaranteedDSCP;
00112
00113 protected:
00114 int dscp;
00115 DWORD tokenRate;
00116 DWORD tokenBucketSize;
00117 DWORD peakBandwidth;
00118 DWORD serviceType;
00119
00120 };
00121
00122 #endif // _PQOS