TODO documentation.
More...
#include <LIBTable.h>
void inet::LIBTable::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
void inet::LIBTable::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
26 cSimpleModule::initialize(stage);
std::vector< LIBEntry > lib
Definition: LIBTable.h:66
Initialization of network-layer protocols, stage 1.
Definition: InitStages.h:72
Local initializations.
Definition: InitStages.h:35
int maxLabel
Definition: LIBTable.h:65
virtual void readTableFromXML(const cXMLElement *libtable)
Definition: LIBTable.cc:105
int inet::LIBTable::installLibEntry |
( |
int |
inLabel, |
|
|
std::string |
inInterface, |
|
|
const LabelOpVector & |
outLabel, |
|
|
std::string |
outInterface, |
|
|
int |
color |
|
) |
| |
|
virtual |
Referenced by inet::LDP::processLABEL_MAPPING(), inet::LDP::processLABEL_REQUEST(), and inet::LDP::updateFecListEntry().
70 newItem.inInterface = inInterface;
71 newItem.outLabel = outLabel;
72 newItem.outInterface = outInterface;
73 newItem.color = color;
74 lib.push_back(newItem);
75 return newItem.inLabel;
78 for (
auto & elem :
lib) {
79 if (elem.inLabel != inLabel)
82 elem.inInterface = inInterface;
83 elem.outLabel = outLabel;
84 elem.outInterface = outInterface;
std::vector< LIBEntry > lib
Definition: LIBTable.h:66
int maxLabel
Definition: LIBTable.h:65
virtual int inet::LIBTable::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
The number of initialization stages.
Definition: InitStages.h:116
Referenced by inet::LDP::lookupLabel().
std::vector< LabelOp > LabelOpVector
Definition: LIBTable.h:44
#define PUSH_OPER
Definition: LIBTable.h:31
void inet::LIBTable::readTableFromXML |
( |
const cXMLElement * |
libtable | ) |
|
|
protectedvirtual |
Referenced by initialize().
107 using namespace xmlutils;
110 ASSERT(!strcmp(libtable->getTagName(),
"libtable"));
112 cXMLElementList list = libtable->getChildrenByTagName(
"libentry");
113 for (
auto & elem : list) {
114 const cXMLElement& entry = *elem;
116 checkTags(&entry,
"inLabel inInterface outLabel outInterface color");
124 cXMLElementList ops =
getUniqueChild(&entry,
"outLabel")->getChildrenByTagName(
"op");
125 for (
auto & ops_oit : ops) {
126 const cXMLElement& op = *ops_oit;
127 const char *val = op.getAttribute(
"value");
128 const char *code = op.getAttribute(
"code");
132 if (!strcmp(code,
"push")) {
138 else if (!strcmp(code,
"pop")) {
142 else if (!strcmp(code,
"swap")) {
151 newItem.outLabel.push_back(l);
154 lib.push_back(newItem);
156 ASSERT(newItem.inLabel > 0);
std::vector< LIBEntry > lib
Definition: LIBTable.h:66
#define POP_OPER
Definition: LIBTable.h:33
const cXMLElement * getUniqueChild(const cXMLElement *node, const char *name)
Definition: XMLUtils.cc:8
const char * getParameterStrValue(const cXMLElement *ptr, const char *name, const char *def)
Definition: XMLUtils.cc:75
void checkTags(const cXMLElement *node, const char *allowed)
Definition: XMLUtils.cc:54
int maxLabel
Definition: LIBTable.h:65
int getParameterIntValue(const cXMLElement *ptr, const char *name, int def)
Definition: XMLUtils.cc:105
#define SWAP_OPER
Definition: LIBTable.h:32
#define PUSH_OPER
Definition: LIBTable.h:31
void inet::LIBTable::removeLibEntry |
( |
int |
inLabel | ) |
|
|
virtual |
bool inet::LIBTable::resolveLabel |
( |
std::string |
inInterface, |
|
|
int |
inLabel, |
|
|
LabelOpVector & |
outLabel, |
|
|
std::string & |
outInterface, |
|
|
int & |
color |
|
) |
| |
|
virtual |
Referenced by inet::MPLS::processMPLSPacketFromL2().
46 bool any = (inInterface.length() == 0);
48 for (
auto & elem :
lib) {
49 if (!any && elem.inInterface != inInterface)
52 if (elem.inLabel != inLabel)
55 outLabel = elem.outLabel;
56 outInterface = elem.outInterface;
std::vector< LIBEntry > lib
Definition: LIBTable.h:66
std::vector<LIBEntry> inet::LIBTable::lib |
|
protected |
int inet::LIBTable::maxLabel |
|
protected |
The documentation for this class was generated from the following files: