qos.h

Go to the documentation of this file.
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.5  2006/02/26 09:30:26  shorne
00022  * renamed include file to lowercase
00023  *
00024  * Revision 1.4  2005/11/30 12:47:38  csoutheren
00025  * Removed tabs, reformatted some code, and changed tags for Doxygen
00026  *
00027  * Revision 1.3  2005/07/13 11:48:53  csoutheren
00028  * Backported QOS changes from isvo branch
00029  *
00030  * Revision 1.2.10.1  2005/04/25 13:37:10  shorne
00031  * Added P_KNOCKOUT_WINSOCK32 to avoid compilation errors
00032  *
00033  * Revision 1.2  2003/10/27 03:51:38  csoutheren
00034  * Added ifdef to disable QoS code on systems that do not support it
00035  *
00036  * Revision 1.1  2003/10/27 03:20:10  csoutheren
00037  * Initial version of QoS implementation
00038  *   Thanks to Henry Harrison of AliceStreet
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

Generated on Fri Mar 7 06:25:02 2008 for PTLib by  doxygen 1.5.1