|
INET Framework for OMNeT++/OMNEST
|
TODO documentation.
More...
#include <RsvpClassifier.h>
◆ RsvpClassifier()
| inet::RsvpClassifier::RsvpClassifier |
( |
| ) |
|
|
inline |
◆ bind()
Implements inet::IRsvpClassifier.
89 if (elem.session != session)
92 if (elem.sender != sender)
95 elem.inLabel = inLabel;
◆ findFEC()
197 for (; it !=
bindings.end(); it++) {
◆ handleMessage()
| void inet::RsvpClassifier::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
◆ initialize()
| void inet::RsvpClassifier::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
25 cSimpleModule::initialize(stage);
33 IIpv4RoutingTable *rt = getModuleFromPar<IIpv4RoutingTable>(par(
"routingTableModule"),
this);
36 lt.reference(
this,
"libTableModule",
true);
37 rsvp.reference(
this,
"rsvpModule",
true);
◆ lookupLabel()
| bool inet::RsvpClassifier::lookupLabel |
( |
Packet * |
packet, |
|
|
LabelOpVector & |
outLabel, |
|
|
std::string & |
outInterface, |
|
|
int & |
color |
|
) |
| |
|
overrideprotectedvirtual |
The packet argument is an input parameter, the rest (outLabel, outInterface, color) are output parameters only.
In subclasses, this function should be implemented to determine the forwarding equivalence class for the Ipv4 datagram passed, and map it to an outLabel and outInterface.
The color parameter (which can be set to an arbitrary value) will only be used for the NAM trace if one will be recorded.
Implements inet::IIngressClassifier.
53 const auto& ipv4Header = packet->peekAtFront<Ipv4Header>();
55 switch (ipv4Header->getProtocolId()) {
67 if (!elem.dest.isUnspecified() && !elem.dest.equals(ipv4Header->getDestAddress()))
70 if (!elem.src.isUnspecified() && !elem.src.equals(ipv4Header->getSrcAddress()))
73 EV_DETAIL <<
"packet belongs to fecid=" << elem.id << endl;
78 return lt->resolveLabel(
"", elem.inLabel, outLabel, outInterface, color);
◆ numInitStages()
| virtual int inet::RsvpClassifier::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ processCommand()
| void inet::RsvpClassifier::processCommand |
( |
const cXMLElement & |
node | ) |
|
|
overrideprotectedvirtual |
Called by ScenarioManager whenever a script command needs to be carried out by the module.
The command is represented by the XML element or element tree. The command name can be obtained as:
const char *command = node->getTagName()
Parameters are XML attributes, e.g. a "neighbour" parameter can be retrieved as:
const char *attr = node->getAttribute("neighbour")
More complex input can be passed in child elements.
- See also
- cXMLElement
Implements inet::IScriptable.
103 if (!strcmp(node.getTagName(),
"bind-fec")) {
◆ readItemFromXML()
| void inet::RsvpClassifier::readItemFromXML |
( |
const cXMLElement * |
fec | ) |
|
|
protectedvirtual |
125 ASSERT(!strcmp(fec->getTagName(),
"fecentry") || !strcmp(fec->getTagName(),
"bind-fec"));
133 checkTags(fec,
"id label destination source");
135 EV_INFO <<
"binding to a given label" << endl;
156 checkTags(fec,
"id destination source tunnel_id extended_tunnel_id endpoint lspid");
158 EV_INFO <<
"binding to a given path" << endl;
171 newFec.sender.SrcAddress =
routerId;
173 newFec.inLabel =
rsvp->getInLabel(newFec.session, newFec.sender);
◆ readTableFromXML()
| void inet::RsvpClassifier::readTableFromXML |
( |
const cXMLElement * |
fectable | ) |
|
|
protectedvirtual |
115 ASSERT(!strcmp(fectable->getTagName(),
"fectable"));
117 cXMLElementList list = fectable->getChildrenByTagName(
"fecentry");
118 for (
auto& elem : list)
◆ bindings
| std::vector<FecEntry> inet::RsvpClassifier::bindings |
|
protected |
◆ lt
◆ maxLabel
| int inet::RsvpClassifier::maxLabel = 0 |
|
protected |
◆ routerId
◆ rsvp
The documentation for this class was generated from the following files:
int getParameterIntValue(const cXMLElement *ptr, const char *name, int def)
Definition: XMLUtils.cc:106
uint32_t getInt() const
Returns the address as an uint32_t in host byte order (e.g.
Definition: Ipv4Address.h:186
Ipv4Address routerId
Definition: RsvpClassifier.h:45
@ IP_PROT_RSVP
Definition: IpProtocolId_m.h:100
@ IP_PROT_OSPF
Definition: IpProtocolId_m.h:104
ModuleRefByPar< RsvpTe > rsvp
Definition: RsvpClassifier.h:50
virtual void readTableFromXML(const cXMLElement *fectable)
Definition: RsvpClassifier.cc:112
virtual void readItemFromXML(const cXMLElement *fec)
Definition: RsvpClassifier.cc:122
void checkTags(const cXMLElement *node, const char *allowed)
Definition: XMLUtils.cc:55
int maxLabel
Definition: RsvpClassifier.h:46
Ipv4Address getParameterIPAddressValue(const cXMLElement *ptr, const char *name, Ipv4Address def)
Definition: XMLUtils.cc:121
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
std::vector< FecEntry > bindings
Definition: RsvpClassifier.h:48
ModuleRefByPar< LibTable > lt
Definition: RsvpClassifier.h:49
const cXMLElement * getUniqueChildIfExists(const cXMLElement *node, const char *name)
Definition: XMLUtils.cc:18
std::vector< FecEntry >::iterator findFEC(int fecid)
Definition: RsvpClassifier.cc:194
INET_API InitStage INITSTAGE_ROUTING_PROTOCOLS
Initialization of routing protocols.