PTLib
Version 2.10.4
|
00001 /* 00002 * qos.h 00003 * 00004 * QOS class used by PWLIB dscp or Windows GQOS implementation. 00005 * 00006 * Copyright (c) 2003 AliceStreet Ltd 00007 * 00008 * The contents of this file are subject to the Mozilla Public License 00009 * Version 1.0 (the "License"); you may not use this file except in 00010 * compliance with the License. You may obtain a copy of the License at 00011 * http://www.mozilla.org/MPL/ 00012 * 00013 * Software distributed under the License is distributed on an "AS IS" 00014 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00015 * the License for the specific language governing rights and limitations 00016 * under the License. 00017 * 00018 * Contributor(s): ______________________________________. 00019 * 00020 * $Revision: 21788 $ 00021 * $Author: rjongbloed $ 00022 * $Date: 2008-12-11 23:42:13 -0600 (Thu, 11 Dec 2008) $ 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 // End Of File ///////////////////////////////////////////////////////////////