PTLib  Version 2.10.11
qos.h
Go to the documentation of this file.
1 /*
2  * qos.h
3  *
4  * QOS class used by PWLIB dscp or Windows GQOS implementation.
5  *
6  * Copyright (c) 2003 AliceStreet Ltd
7  *
8  * The contents of this file are subject to the Mozilla Public License
9  * Version 1.0 (the "License"); you may not use this file except in
10  * compliance with the License. You may obtain a copy of the License at
11  * http://www.mozilla.org/MPL/
12  *
13  * Software distributed under the License is distributed on an "AS IS"
14  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15  * the License for the specific language governing rights and limitations
16  * under the License.
17  *
18  * Contributor(s): ______________________________________.
19  *
20  * $Revision: 21788 $
21  * $Author: rjongbloed $
22  * $Date: 2008-12-11 23:42:13 -0600 (Thu, 11 Dec 2008) $
23  */
24 
25 #ifndef PTLIB_QOS_H
26 #define PTLIB_QOS_H
27 
28 #ifdef P_USE_PRAGMA
29 #pragma interface
30 #endif
31 
32 #if P_QOS
33 #ifdef _WIN32
34 #ifndef P_KNOCKOUT_WINSOCK2
35 #include <winsock2.h>
36 #include <ws2tcpip.h>
37 
38 #ifndef P_KNOCKOUT_QOS
39 #include <qossp.h>
40 #endif // KNOCKOUT_QOS
41 #endif // KNOCKOUT_WINSOCK2
42 #endif // _WIN32
43 #endif // P_QOS
44 
45 #ifndef QOS_NOT_SPECIFIED
46 #define QOS_NOT_SPECIFIED 0xFFFFFFFF
47 #endif
48 
49 #ifndef SERVICETYPE
50 #define SERVICETYPE DWORD
51 #endif
52 
53 #ifndef SERVICETYPE_GUARANTEED
54 #define SERVICETYPE_GUARANTEED 0x00000003
55 #endif
56 
57 #ifndef SERVICETYPE_CONTROLLEDLOAD
58 #define SERVICETYPE_CONTROLLEDLOAD 0x00000002
59 #endif
60 
61 #ifndef SERVICETYPE_BESTEFFORT
62 #define SERVICETYPE_BESTEFFORT 0x00000001
63 #endif
64 
65 #define SERVICETYPE_PNOTDEFINED 0xFFFFFFFF
66 
67 class PQoS : public PObject
68 {
69  PCLASSINFO(PQoS, PObject);
70 
71 public:
72  PQoS();
73  PQoS(DWORD avgBytesPerSec,
74  DWORD winServiceType,
75  int DSCPalternative = -1,
76  DWORD maxFrameBytes = 1500,
77  DWORD peakBytesPerSec = QOS_NOT_SPECIFIED);
78  PQoS(int DSCPvalue);
79 
80  void SetAvgBytesPerSec(DWORD avgBytesPerSec);
81  void SetWinServiceType(DWORD winServiceType);
82  void SetDSCP(int DSCPvalue);
83  void SetMaxFrameBytes(DWORD maxFrameBytes);
84  void SetPeakBytesPerSec(DWORD peakBytesPerSec);
85 
86  DWORD GetTokenRate() const { return tokenRate;}
87  DWORD GetTokenBucketSize() const { return tokenBucketSize;}
88  DWORD GetPeakBandwidth() const { return peakBandwidth;}
89  DWORD GetServiceType() const { return serviceType;}
90  int GetDSCP() const { return dscp;}
91 
92  static void SetDSCPAlternative(DWORD winServiceType,
93  UINT dscp);
94  static char bestEffortDSCP;
95  static char controlledLoadDSCP;
96  static char guaranteedDSCP;
97 
98  protected:
99  int dscp;
100  DWORD tokenRate;
103  DWORD serviceType;
104 
105 };
106 
107 
108 #endif // PTLIB_QOS_H
109 
110 
111 // End Of File ///////////////////////////////////////////////////////////////
void SetWinServiceType(DWORD winServiceType)
void SetDSCP(int DSCPvalue)
DWORD GetPeakBandwidth() const
Definition: qos.h:88
DWORD GetServiceType() const
Definition: qos.h:89
DWORD tokenRate
Definition: qos.h:100
static char controlledLoadDSCP
Definition: qos.h:95
DWORD serviceType
Definition: qos.h:103
DWORD tokenBucketSize
Definition: qos.h:101
int GetDSCP() const
Definition: qos.h:90
static char guaranteedDSCP
Definition: qos.h:96
void SetAvgBytesPerSec(DWORD avgBytesPerSec)
DWORD GetTokenBucketSize() const
Definition: qos.h:87
Definition: qos.h:67
static char bestEffortDSCP
Definition: qos.h:94
DWORD peakBandwidth
Definition: qos.h:102
void SetPeakBytesPerSec(DWORD peakBytesPerSec)
#define QOS_NOT_SPECIFIED
Definition: qos.h:46
int dscp
Definition: qos.h:99
static void SetDSCPAlternative(DWORD winServiceType, UINT dscp)
DWORD GetTokenRate() const
Definition: qos.h:86
void SetMaxFrameBytes(DWORD maxFrameBytes)
Ultimate parent class for all objects in the class library.
Definition: object.h:1118