TODO documentation.
More...
#include <SimpleClassifier.h>
inet::SimpleClassifier::SimpleClassifier |
( |
| ) |
|
|
inline |
Implements inet::IRSVPClassifier.
94 if (elem.session != session)
97 if (elem.sender != sender)
100 elem.inLabel = inLabel;
std::vector< FECEntry > bindings
Definition: SimpleClassifier.h:58
202 for ( ; it !=
bindings.end(); it++) {
std::vector< FECEntry > bindings
Definition: SimpleClassifier.h:58
void inet::SimpleClassifier::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
void inet::SimpleClassifier::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
31 cSimpleModule::initialize(stage);
38 IIPv4RoutingTable *rt = getModuleFromPar<IIPv4RoutingTable>(par(
"routingTableModule"),
this);
41 lt = getModuleFromPar<LIBTable>(par(
"libTableModule"),
this);
43 rsvp = getModuleFromPar<RSVP>(par(
"rsvpModule"),
this);
std::vector< FECEntry > bindings
Definition: SimpleClassifier.h:58
IPv4Address routerId
Definition: SimpleClassifier.h:55
virtual void readTableFromXML(const cXMLElement *fectable)
Definition: SimpleClassifier.cc:117
int maxLabel
Definition: SimpleClassifier.h:56
LIBTable * lt
Definition: SimpleClassifier.h:59
Initialization of routing protocols.
Definition: InitStages.h:101
RSVP * rsvp
Definition: SimpleClassifier.h:60
Local initializations.
Definition: InitStages.h:35
bool inet::SimpleClassifier::lookupLabel |
( |
IPv4Datagram * |
ipdatagram, |
|
|
LabelOpVector & |
outLabel, |
|
|
std::string & |
outInterface, |
|
|
int & |
color |
|
) |
| |
|
overrideprotectedvirtual |
The ipdatagram 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::IClassifier.
60 switch (ipdatagram->getTransportProtocol()) {
72 if (!elem.dest.isUnspecified() && !elem.dest.equals(ipdatagram->getDestAddress()))
75 if (!elem.src.isUnspecified() && !elem.src.equals(ipdatagram->getSrcAddress()))
78 EV_DETAIL <<
"packet belongs to fecid=" << elem.id << endl;
83 return lt->
resolveLabel(
"", elem.inLabel, outLabel, outInterface, color);
std::vector< FECEntry > bindings
Definition: SimpleClassifier.h:58
LIBTable * lt
Definition: SimpleClassifier.h:59
Definition: IPProtocolId_m.h:89
Definition: IPProtocolId_m.h:86
virtual bool resolveLabel(std::string inInterface, int inLabel, LabelOpVector &outLabel, std::string &outInterface, int &color)
Definition: LIBTable.cc:43
virtual int inet::SimpleClassifier::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
The number of initialization stages.
Definition: InitStages.h:116
void inet::SimpleClassifier::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.
108 if (!strcmp(node.getTagName(),
"bind-fec")) {
virtual void readItemFromXML(const cXMLElement *fec)
Definition: SimpleClassifier.cc:127
void inet::SimpleClassifier::readItemFromXML |
( |
const cXMLElement * |
fec | ) |
|
|
protectedvirtual |
130 ASSERT(!strcmp(fec->getTagName(),
"fecentry") || !strcmp(fec->getTagName(),
"bind-fec"));
138 checkTags(fec,
"id label destination source");
140 EV_INFO <<
"binding to a given label" << endl;
161 checkTags(fec,
"id destination source tunnel_id extended_tunnel_id endpoint lspid");
163 EV_INFO <<
"binding to a given path" << endl;
176 newFec.sender.SrcAddress =
routerId;
std::vector< FECEntry > bindings
Definition: SimpleClassifier.h:58
IPv4Address routerId
Definition: SimpleClassifier.h:55
IPv4Address getParameterIPAddressValue(const cXMLElement *ptr, const char *name, IPv4Address def)
Definition: XMLUtils.cc:120
virtual int getInLabel(const SessionObj_t &session, const SenderTemplateObj_t &sender)
Definition: RSVP.cc:100
RSVP * rsvp
Definition: SimpleClassifier.h:60
void checkTags(const cXMLElement *node, const char *allowed)
Definition: XMLUtils.cc:54
uint32 getInt() const
Returns the address as an int.
Definition: IPv4Address.h:197
int getParameterIntValue(const cXMLElement *ptr, const char *name, int def)
Definition: XMLUtils.cc:105
std::vector< FECEntry >::iterator findFEC(int fecid)
Definition: SimpleClassifier.cc:199
const cXMLElement * getUniqueChildIfExists(const cXMLElement *node, const char *name)
Definition: XMLUtils.cc:17
void inet::SimpleClassifier::readTableFromXML |
( |
const cXMLElement * |
fectable | ) |
|
|
protectedvirtual |
120 ASSERT(!strcmp(fectable->getTagName(),
"fectable"));
122 cXMLElementList list = fectable->getChildrenByTagName(
"fecentry");
123 for (
auto & elem : list)
virtual void readItemFromXML(const cXMLElement *fec)
Definition: SimpleClassifier.cc:127
void checkTags(const cXMLElement *node, const char *allowed)
Definition: XMLUtils.cc:54
std::vector<FECEntry> inet::SimpleClassifier::bindings |
|
protected |
LIBTable* inet::SimpleClassifier::lt = nullptr |
|
protected |
int inet::SimpleClassifier::maxLabel = 0 |
|
protected |
RSVP* inet::SimpleClassifier::rsvp = nullptr |
|
protected |
The documentation for this class was generated from the following files: