DSCP Marker.
More...
#include <DSCPMarker.h>
inet::DSCPMarker::DSCPMarker |
( |
| ) |
|
|
inline |
void inet::DSCPMarker::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
57 cPacket *packet =
dynamic_cast<cPacket *
>(msg);
60 int dscp =
dscps.at(msg->getArrivalGate()->getIndex());
69 throw cRuntimeError(
"DSCPMarker expects cPackets");
int numRcvd
Definition: DSCPMarker.h:33
virtual bool markPacket(cPacket *msg, int dscp)
Definition: DSCPMarker.cc:81
int numMarked
Definition: DSCPMarker.h:34
std::vector< int > dscps
Definition: DSCPMarker.h:31
static simsignal_t markPkSignal
Definition: DSCPMarker.h:36
void inet::DSCPMarker::initialize |
( |
| ) |
|
|
overrideprotectedvirtual |
46 while ((
int)
dscps.size() < gateSize(
"in"))
int numRcvd
Definition: DSCPMarker.h:33
int numMarked
Definition: DSCPMarker.h:34
void parseDSCPs(const char *attrValue, const char *attrName, std::vector< int > &result)
Parses a space separated list of DSCP values and puts them into the result vector.
Definition: DiffservUtil.cc:147
std::vector< int > dscps
Definition: DSCPMarker.h:31
bool inet::DSCPMarker::markPacket |
( |
cPacket * |
msg, |
|
|
int |
dscp |
|
) |
| |
|
protectedvirtual |
83 EV_DETAIL <<
"Marking packet with dscp=" <<
dscpToString(dscp) <<
"\n";
85 for ( ; packet; packet = packet->getEncapsulatedPacket()) {
87 IPv4Datagram *ipv4Datagram =
dynamic_cast<IPv4Datagram *
>(packet);
89 ipv4Datagram->setDiffServCodePoint(dscp);
92 #endif // ifdef WITH_IPv4 94 IPv6Datagram *ipv6Datagram =
dynamic_cast<IPv6Datagram *
>(packet);
96 ipv6Datagram->setDiffServCodePoint(dscp);
99 #endif // ifdef WITH_IPv6 std::string dscpToString(int dscp)
Returns the string representation of the given DSCP value.
Definition: DiffservUtil.cc:162
void inet::DSCPMarker::refreshDisplay |
( |
| ) |
const |
|
overrideprotectedvirtual |
75 sprintf(buf + strlen(buf),
"rcvd: %d ",
numRcvd);
77 sprintf(buf + strlen(buf),
"mark:%d ",
numMarked);
78 getDisplayString().setTagArg(
"t", 0, buf);
int numRcvd
Definition: DSCPMarker.h:33
int numMarked
Definition: DSCPMarker.h:34
std::vector<int> inet::DSCPMarker::dscps |
|
protected |
simsignal_t inet::DSCPMarker::markPkSignal = registerSignal("markPk") |
|
staticprotected |
int inet::DSCPMarker::numMarked = 0 |
|
protected |
int inet::DSCPMarker::numRcvd = 0 |
|
protected |
The documentation for this class was generated from the following files: