RTP Trace System  1.0
Coral::TrafficPolicer Class Reference

Traffic Policer. More...

#include <trafficpolicer.h>

List of all members.

Classes

struct  TrafficPolicerPacket

Public Member Functions

 TrafficPolicer ()
 ~TrafficPolicer ()
card64 getBandwidth () const
void setBandwidth (const card64 bandwidth)
double getBufferDelay () const
void setBufferDelay (const double bufferDelay)
void setFlush (const bool on)
void flush ()
bool refreshBuffer (const card8 trafficClass, const bool doRemapping)
cardinal write (const cardinal bytes, const card8 trafficClass, const cardinal headerSize)
void timerEvent ()

Static Public Attributes

static card64 SimulatorTime = 0

Private Attributes

card64 SendTimeStamp
card64 Bandwidth
double BufferDelay
bool ExceedFlush
multimap< card64,
TrafficPolicerPacket * > 
PacketSet

Detailed Description

Traffic Policer.

This class is a traffic policer.

Author:
Thomas Dreibholz
Version:
1.0

Constructor & Destructor Documentation


Member Function Documentation

Flush buffer.

Get bandwidth for following packets.

Returns:
Bandwidth.
double Coral::TrafficPolicer::getBufferDelay ( ) const [inline]

Get maximum buffer delay for following packets.

Returns:
Maximum buffer delay in microseconds.
bool Coral::TrafficPolicer::refreshBuffer ( const card8  trafficClass,
const bool  doRemapping 
)

Adapt buffer's contents to changed bandwidth and delay settings.

Parameters:
trafficClassTraffic class to remap packets to.
doRemappingtrue, to do traffic class remapping; false otherwise.
Returns:
true, if buffer flush has been necessary; false otherwise.
void Coral::TrafficPolicer::setBandwidth ( const card64  bandwidth) [inline]

Set bandwidth for following packets.

Parameters:
bandwidthBandwidth.
void Coral::TrafficPolicer::setBufferDelay ( const double  bufferDelay) [inline]

Set maximum buffer delay for following packets.

Parameters:
maxDelayMaximum buffer delay in microseconds.
void Coral::TrafficPolicer::setFlush ( const bool  on) [inline]

Enable *one* buffer flush, if limits are exceeded.

Parameters:
ontrue, to enable one buffer flush; false otherwise.
cardinal Coral::TrafficPolicer::write ( const cardinal  bytes,
const card8  trafficClass,
const cardinal  headerSize 
)

Write given number of bytes into buffer.

Parameters:
bytesNumber of bytes.
trafficClassTraffic class for error output.
headerSizePacket header size (e.g. 48 for UDP/IPv6).
Returns:
0, if write was successful; 1, if limits have been exceeded but allowed by setFlush(); >1, if limits have been exceeded unallowed.

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines