PWLib
1.10.10
|
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 * $Log: qos.h,v $ 00021 * Revision 1.4 2005/11/30 12:47:38 csoutheren 00022 * Removed tabs, reformatted some code, and changed tags for Doxygen 00023 * 00024 * Revision 1.3 2005/07/13 11:48:53 csoutheren 00025 * Backported QOS changes from isvo branch 00026 * 00027 * Revision 1.2.10.1 2005/04/25 13:37:10 shorne 00028 * Added P_KNOCKOUT_WINSOCK32 to avoid compilation errors 00029 * 00030 * Revision 1.2 2003/10/27 03:51:38 csoutheren 00031 * Added ifdef to disable QoS code on systems that do not support it 00032 * 00033 * Revision 1.1 2003/10/27 03:20:10 csoutheren 00034 * Initial version of QoS implementation 00035 * Thanks to Henry Harrison of AliceStreet 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