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