|
INET Framework for OMNeT++/OMNEST
|
Classes | |
| class | ColorAttribute |
Enumerations | |
| enum | Color { GREEN, YELLOW, RED } |
Functions | |
| const char * | getRequiredAttribute (cXMLElement *element, const char *attrName) |
| Returns the value of the named attribute of the XML element, or throws an exception if not found. More... | |
| double | parseInformationRate (const char *attrValue, const char *attrName, IInterfaceTable *ift, cSimpleModule &owner, int defaultValue) |
| Parses the information rate parameter (bits/sec). More... | |
| int | parseIntAttribute (const char *attrValue, const char *attrName, bool isOptional=true) |
| Parses an integer attribute. More... | |
| int | parseProtocol (const char *attrValue, const char *attrName) |
| Parses an IP protocol number. More... | |
| int | parseDSCP (const char *attrValue, const char *attrName) |
| Parses a Diffserv code point. More... | |
| 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. More... | |
| std::string | dscpToString (int dscp) |
| Returns the string representation of the given DSCP value. More... | |
| std::string | colorToString (int color) |
| Returns the string representation of the given color. More... | |
| double | getInterfaceDatarate (IInterfaceTable *ift, cSimpleModule *interfaceModule) |
| Returns the datarate of the interface containing the given module. More... | |
| cPacket * | findIPDatagramInPacket (cPacket *packet) |
| Returns the IP datagram encapsulated inside packet, or the packet itself if it is an IPv4/IPv6 datagram. More... | |
| int | getColor (cPacket *packet) |
| Returns the color of the packet. More... | |
| void | setColor (cPacket *packet, int color) |
| Sets the color of the packet. More... | |
| bool | isEmpty (const char *str) |
| Returns true, if the string is empty (nullptr or "");. More... | |
Variables | |
| cEnum * | dscpEnum = nullptr |
| cEnum * | protocolEnum = nullptr |
| std::string inet::DiffservUtil::colorToString | ( | int | color | ) |
Returns the string representation of the given color.
For values defined in IMeter.h it returns their name, other values are returned as decimal constants.
Referenced by inet::DiffservUtil::ColorAttribute::info(), and isEmpty().
| std::string inet::DiffservUtil::dscpToString | ( | int | dscp | ) |
Returns the string representation of the given DSCP value.
Values defined in DSCP.msg are returned as "BE", "AF11", etc., others are returned as a decimal number.
Referenced by isEmpty(), and inet::DSCPMarker::markPacket().
| cPacket * inet::DiffservUtil::findIPDatagramInPacket | ( | cPacket * | packet | ) |
Returns the IP datagram encapsulated inside packet, or the packet itself if it is an IPv4/IPv6 datagram.
Returns nullptr, if there is no IP datagram in the packet.
Referenced by inet::TokenBucketMeter::handleMessage(), inet::SingleRateThreeColorMeter::handleMessage(), inet::TwoRateThreeColorMeter::handleMessage(), and isEmpty().
| int inet::DiffservUtil::getColor | ( | cPacket * | packet | ) |
Returns the color of the packet.
The color was set by a previous meter component. Returns -1, if the color was not set.
Referenced by inet::RSVPPathMsg_Base::getERO(), inet::visualizer::ColorSet::getSize(), isEmpty(), inet::TokenBucketMeter::meterPacket(), inet::SingleRateThreeColorMeter::meterPacket(), and inet::TwoRateThreeColorMeter::meterPacket().
| double inet::DiffservUtil::getInterfaceDatarate | ( | IInterfaceTable * | ift, |
| cSimpleModule * | interfaceModule | ||
| ) |
Returns the datarate of the interface containing the given module.
Returns -1, if the interface entry not found.
Referenced by isEmpty(), and parseInformationRate().
| const char * inet::DiffservUtil::getRequiredAttribute | ( | cXMLElement * | element, |
| const char * | attrName | ||
| ) |
Returns the value of the named attribute of the XML element, or throws an exception if not found.
Referenced by inet::MultiFieldClassifier::configureFilters(), and isEmpty().
|
inline |
Returns true, if the string is empty (nullptr or "");.
Referenced by parseDSCP(), parseDSCPs(), parseInformationRate(), parseIntAttribute(), and parseProtocol().
| int inet::DiffservUtil::parseDSCP | ( | const char * | attrValue, |
| const char * | attrName | ||
| ) |
Parses a Diffserv code point.
Recognizes the names defined in DSCP.msg (e.g. "BE", "AF11"), and accepts decimal/octal/hex/binary numbers.
Referenced by isEmpty(), and parseDSCPs().
| void inet::DiffservUtil::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.
"*" is interpreted as all possible DSCP values (i.e. the 0..63 range).
Referenced by inet::DSCPMarker::initialize(), inet::BehaviorAggregateClassifier::initialize(), and isEmpty().
| double inet::DiffservUtil::parseInformationRate | ( | const char * | attrValue, |
| const char * | attrName, | ||
| IInterfaceTable * | ift, | ||
| cSimpleModule & | owner, | ||
| int | defaultValue | ||
| ) |
Parses the information rate parameter (bits/sec).
Supported formats:
Referenced by inet::TokenBucketMeter::initialize(), inet::SingleRateThreeColorMeter::initialize(), inet::TwoRateThreeColorMeter::initialize(), and isEmpty().
| int inet::DiffservUtil::parseIntAttribute | ( | const char * | attrValue, |
| const char * | attrName, | ||
| bool | isOptional = true |
||
| ) |
Parses an integer attribute.
Supports decimal, octal ("0" prefix), hexadecimal ("0x" prefix), and binary ("0b" prefix) bases.
Referenced by inet::MultiFieldClassifier::configureFilters(), isEmpty(), parseDSCP(), and parseProtocol().
| int inet::DiffservUtil::parseProtocol | ( | const char * | attrValue, |
| const char * | attrName | ||
| ) |
Parses an IP protocol number.
Recognizes the names defined in IPProtocolId.msg (e.g. "UDP", "udp", "Tcp"), and accepts decimal/octal/hex/binary numbers.
Referenced by inet::MultiFieldClassifier::configureFilters(), and isEmpty().
| void inet::DiffservUtil::setColor | ( | cPacket * | packet, |
| int | color | ||
| ) |
Sets the color of the packet.
The color is stored in the parlist of the cPacket object.
Referenced by inet::RSVPPathMsg_Base::getERO(), isEmpty(), inet::TokenBucketMeter::meterPacket(), inet::SingleRateThreeColorMeter::meterPacket(), and inet::TwoRateThreeColorMeter::meterPacket().
| cEnum* inet::DiffservUtil::dscpEnum = nullptr |
| cEnum* inet::DiffservUtil::protocolEnum = nullptr |