INET Framework for OMNeT++/OMNEST
inet::StreamRedundancyConfigurator Class Reference

#include <StreamRedundancyConfigurator.h>

Inheritance diagram for inet::StreamRedundancyConfigurator:
inet::NetworkConfiguratorBase

Classes

class  Node
 Represents a node in the network. More...
 
class  Stream
 
class  StreamDecoding
 
class  StreamEncoding
 
class  StreamIdentification
 
class  StreamMerging
 
class  StreamNode
 
class  StreamNodeTreeData
 
class  StreamSplitting
 
class  Topology
 

Public Member Functions

virtual std::vector< std::string > getStreamNames ()
 
virtual std::vector< std::vector< std::string > > getPathFragments (const char *stream)
 

Protected Member Functions

virtual void initialize (int stage) override
 
virtual void handleParameterChange (const char *name) override
 
virtual void computeConfiguration ()
 Computes the network configuration for all nodes in the network. More...
 
virtual void clearConfiguration ()
 
virtual void computeStreams ()
 
virtual void computeStreamSendersAndReceivers (cValueMap *streamConfiguration)
 
virtual void computeStreamEncodings (cValueMap *streamConfiguration)
 
virtual void computeStreamPolicyConfigurations (cValueMap *streamConfiguration)
 
virtual void configureStreams ()
 
virtual void configureStreams (Node *node)
 
- Protected Member Functions inherited from inet::NetworkConfiguratorBase
virtual ~NetworkConfiguratorBase ()
 
virtual int numInitStages () const override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void extractTopology (Topology &topology)
 Extracts network topology by walking through the module hierarchy. More...
 
virtual std::vector< Node * > computeShortestNodePath (Node *source, Node *destination) const
 
virtual std::vector< Link * > computeShortestLinkPath (Node *source, Node *destination) const
 
virtual bool isBridgeNode (Node *node) const
 
virtual LinkfindLinkIn (const Node *node, const char *neighbor) const
 
virtual LinkfindLinkOut (const Node *node, const char *neighbor) const
 
virtual LinkfindLinkOut (const Node *node, const Node *neighbor) const
 
virtual LinkfindLinkOut (const Interface *interface) const
 
virtual Topology::LinkfindLinkOut (const Node *node, int gateId) const
 
virtual InterfacefindInterface (const Node *node, NetworkInterface *networkInterface) const
 

Protected Attributes

int minVlanId = -1
 
int maxVlanId = -1
 
cValueArray * configuration
 
std::map< std::string, Streamstreams
 
std::map< std::pair< std::string, std::string >, int > nextVlanIds
 
std::map< std::tuple< std::string, std::string, std::string, std::string >, int > assignedVlanIds
 
- Protected Attributes inherited from inet::NetworkConfiguratorBase
Topologytopology = nullptr
 

Member Function Documentation

◆ clearConfiguration()

void inet::StreamRedundancyConfigurator::clearConfiguration ( )
protectedvirtual
41 {
42  streams.clear();
43  nextVlanIds.clear();
44  assignedVlanIds.clear();
45  if (topology != nullptr)
46  topology->clear();
47 }

Referenced by handleParameterChange().

◆ computeConfiguration()

void inet::StreamRedundancyConfigurator::computeConfiguration ( )
protectedvirtual

Computes the network configuration for all nodes in the network.

The result of the computation is only stored in the configurator.

50 {
51  long initializeStartTime = clock();
52  delete topology;
53  topology = new Topology();
56  printElapsedTime("initialize", initializeStartTime);
57 }

Referenced by handleParameterChange(), and initialize().

◆ computeStreamEncodings()

void inet::StreamRedundancyConfigurator::computeStreamEncodings ( cValueMap *  streamConfiguration)
protectedvirtual
157 {
158  int pcp = streamConfiguration->containsKey("pcp") ? streamConfiguration->get("pcp").intValue() : -1;
159  for (int i = 0; i < topology->getNumNodes(); i++) {
160  auto node = (Node *)topology->getNode(i);
161  auto networkNode = node->module;
162  auto networkNodeName = networkNode->getFullName();
163  std::string destinationAddress = streamConfiguration->containsKey("destinationAddress") ? streamConfiguration->get("destinationAddress") : streamConfiguration->get("destination");
164  std::string streamName = streamConfiguration->get("name").stringValue();
165  // encoding configuration
166  auto& stream = streams[streamName];
167  auto& streamNode = stream.streamNodes[networkNodeName];
168  for (int j = 0; j < streamNode.receivers.size(); j++) {
169  auto& receiverNetworkNodeNames = streamNode.receivers[j];
170  if (!receiverNetworkNodeNames.empty()) {
171  std::string streamNameSuffix;
172  for (auto receiverNetworkNodeName : receiverNetworkNodeNames)
173  streamNameSuffix += "_" + receiverNetworkNodeName;
174  auto outputStreamName = streamNode.distinctReceivers.size() == 1 ? streamName : streamName + streamNameSuffix;
175  auto it = std::find_if(node->streamEncodings.begin(), node->streamEncodings.end(), [&] (const StreamEncoding& streamEncoding) {
176  return streamEncoding.name == outputStreamName;
177  });
178  if (it != node->streamEncodings.end())
179  continue;
180  auto jt = nextVlanIds.emplace(std::pair<std::string, std::string>{networkNodeName, destinationAddress}, 0);
181  int vlanId = jt.first->second++;
182  if (vlanId > maxVlanId)
183  throw cRuntimeError("Cannot assign VLAN ID in the available range");
184  for (int k = 0; k < receiverNetworkNodeNames.size(); k++) {
185  auto receiverNetworkNodeName = receiverNetworkNodeNames[k];
186  EV_DEBUG << "Assigning VLAN id" << EV_FIELD(streamName) << EV_FIELD(networkNodeName) << EV_FIELD(receiverNetworkNodeName) << EV_FIELD(destinationAddress) << EV_FIELD(vlanId) << EV_ENDL;
187  assignedVlanIds[{networkNodeName, receiverNetworkNodeName, destinationAddress, streamName}] = vlanId;
188  StreamEncoding streamEncoding;
189  streamEncoding.name = outputStreamName;
190  streamEncoding.networkInterface = streamNode.interfaces[j][k];
191  streamEncoding.vlanId = vlanId;
192  streamEncoding.pcp = pcp;
193  streamEncoding.destination = destinationAddress;
194  node->streamEncodings.push_back(streamEncoding);
195  }
196  }
197  }
198  }
199 }

Referenced by computeStreams().

◆ computeStreamPolicyConfigurations()

void inet::StreamRedundancyConfigurator::computeStreamPolicyConfigurations ( cValueMap *  streamConfiguration)
protectedvirtual
202 {
203  std::string sourceNetworkNodeName = streamConfiguration->get("source");
204  std::string destinationAddress = streamConfiguration->containsKey("destinationAddress") ? streamConfiguration->get("destinationAddress") : streamConfiguration->get("destination");
205  std::string streamName = streamConfiguration->get("name").stringValue();
206  auto& stream = streams[streamName];
207  for (int i = 0; i < topology->getNumNodes(); i++) {
208  auto node = (Node *)topology->getNode(i);
209  auto networkNodeName = node->module->getFullName();
210  auto& streamNode = stream.streamNodes[networkNodeName];
211  // identification configuration
212  if (networkNodeName == sourceNetworkNodeName) {
213  StreamIdentification streamIdentification;
214  streamIdentification.stream = streamConfiguration->get("name").stringValue();
215  streamIdentification.packetFilter = streamConfiguration->containsKey("packetFilter") ? streamConfiguration->get("packetFilter") : cValue("*");
216  node->streamIdentifications.push_back(streamIdentification);
217  }
218  // decoding configuration
219  for (auto senderNetworkNodeName : streamNode.senders) {
220  auto inputStreamName = streamNode.senders.size() == 1 ? streamName : streamName + "_" + senderNetworkNodeName;
221  auto linkIn = findLinkIn(node, senderNetworkNodeName.c_str());
222  auto vlanId = assignedVlanIds[{senderNetworkNodeName, networkNodeName, destinationAddress, streamName}];
223  StreamDecoding streamDecoding;
224  streamDecoding.name = inputStreamName;
225  streamDecoding.networkInterface = linkIn->destinationInterface->networkInterface;
226  streamDecoding.vlanId = vlanId;
227  if (streamDecoding.vlanId > maxVlanId)
228  throw cRuntimeError("Cannot assign VLAN ID in the available range");
229  node->streamDecodings.push_back(streamDecoding);
230  }
231  // merging configuration
232  if (streamNode.senders.size() > 1) {
233  StreamMerging streamMerging;
234  streamMerging.outputStream = streamName;
235  for (auto senderNetworkNodeName : streamNode.senders) {
236  auto inputStreamName = streamName + "_" + senderNetworkNodeName;
237  streamMerging.inputStreams.push_back(inputStreamName);
238  }
239  node->streamMergings.push_back(streamMerging);
240  }
241  // splitting configuration
242  if (streamNode.distinctReceivers.size() != 1) {
243  StreamSplitting streamSplitting;
244  streamSplitting.inputStream = streamName;
245  for (auto& receiverNetworkNodeNames : streamNode.distinctReceivers) {
246  std::string streamNameSuffix;
247  for (auto receiverNetworkNodeName : receiverNetworkNodeNames)
248  streamNameSuffix += "_" + receiverNetworkNodeName;
249  auto outputStreamName = streamName + streamNameSuffix;
250  streamSplitting.outputStreams.push_back(outputStreamName);
251  }
252  node->streamSplittings.push_back(streamSplitting);
253  }
254  }
255 }

Referenced by computeStreams().

◆ computeStreams()

void inet::StreamRedundancyConfigurator::computeStreams ( )
protectedvirtual
60 {
61  for (int i = 0; i < configuration->size(); i++) {
62  cValueMap *streamConfiguration = check_and_cast<cValueMap *>(configuration->get(i).objectValue());
63  computeStreamSendersAndReceivers(streamConfiguration);
64  computeStreamEncodings(streamConfiguration);
65  computeStreamPolicyConfigurations(streamConfiguration);
66  }
67 }

Referenced by computeConfiguration().

◆ computeStreamSendersAndReceivers()

void inet::StreamRedundancyConfigurator::computeStreamSendersAndReceivers ( cValueMap *  streamConfiguration)
protectedvirtual
75 {
76  std::string streamName = streamConfiguration->get("name").stringValue();
77  auto& stream = streams[streamName];
78  for (int i = 0; i < topology->getNumNodes(); i++) {
79  auto node = (Node *)topology->getNode(i);
80  auto networkNode = node->module;
81  auto networkNodeName = networkNode->getFullName();
82  std::string sourceNetworkNodeName = streamConfiguration->get("source");
83  cValueArray *trees = check_and_cast<cValueArray *>(streamConfiguration->get("trees").objectValue());
84  stream.streamNodes[networkNodeName].senders.resize(trees->size());
85  stream.streamNodes[networkNodeName].receivers.resize(trees->size());
86  stream.streamNodes[networkNodeName].interfaces.resize(trees->size());
87  std::vector<std::string> senderNetworkNodeNames;
88  for (int j = 0; j < trees->size(); j++) {
89  std::vector<std::string> receiverNetworkNodeNames;
90  std::vector<NetworkInterface *> interfaces;
91  cValueArray *tree = check_and_cast<cValueArray*>(trees->get(j).objectValue());
92  for (int k = 0; k < tree->size(); k++) {
93  cValueArray *path = check_and_cast<cValueArray*>(tree->get(k).objectValue());
94  for (int l = 0; l < path->size(); l++) {
95  std::string name = path->get(l).stringValue();
96  auto pos = name.find('.');
97  auto nodeName = pos == std::string::npos ? name : name.substr(0, pos);
98  auto interfaceName = pos == std::string::npos ? "" : name.substr(pos + 1);
99  if (nodeName == networkNode->getFullName()) {
100  auto senderName = l != 0 ? path->get(l - 1).stringValue() : nullptr;
101  auto receiverName = l != path->size() - 1 ? path->get(l + 1).stringValue() : nullptr;
102  auto senderNetworkNodeName = senderName != nullptr ? getNodeName(senderName) : "";
103  auto receiverNetworkNodeName = receiverName != nullptr ? getNodeName(receiverName) : "";
104  if (senderName != nullptr && std::find(senderNetworkNodeNames.begin(), senderNetworkNodeNames.end(), senderNetworkNodeName) == senderNetworkNodeNames.end())
105  senderNetworkNodeNames.push_back(senderNetworkNodeName);
106  if (receiverName != nullptr && std::find(receiverNetworkNodeNames.begin(), receiverNetworkNodeNames.end(), receiverNetworkNodeName) == receiverNetworkNodeNames.end()) {
107  Interface *interface = nullptr;
108  if (interfaceName.empty())
109  interface = findLinkOut(node, receiverNetworkNodeName.c_str())->sourceInterface;
110  else
111  interface = *std::find_if(node->interfaces.begin(), node->interfaces.end(), [&] (auto interface) {
112  return interface->networkInterface->getInterfaceName() == interfaceName;
113  });
114  receiverNetworkNodeNames.push_back(receiverNetworkNodeName);
115  interfaces.push_back(interface->networkInterface);
116  }
117  }
118  }
119  }
120  stream.streamNodes[networkNodeName].receivers[j] = receiverNetworkNodeNames;
121  stream.streamNodes[networkNodeName].interfaces[j] = interfaces;
122  }
123  stream.streamNodes[networkNodeName].senders = senderNetworkNodeNames;
124  }
125  for (auto& it : stream.streamNodes) {
126  auto& streamNode = it.second;
127  for (auto& r : streamNode.receivers) {
128  if (!r.empty()) {
129  if (std::find(streamNode.distinctReceivers.begin(), streamNode.distinctReceivers.end(), r) == streamNode.distinctReceivers.end())
130  streamNode.distinctReceivers.push_back(r);
131  }
132  }
133  }
134  EV_DEBUG << "Stream " << streamName << std::endl;
135  for (auto& it : stream.streamNodes) {
136  EV_DEBUG << " Node " << it.first << std::endl;
137  auto& streamNode = it.second;
138  for (int i = 0; i < streamNode.senders.size(); i++) {
139  auto& e = streamNode.senders[i];
140  EV_DEBUG << " Sender for tree " << i << " = " << e << std::endl;
141  }
142  for (int i = 0; i < streamNode.receivers.size(); i++) {
143  auto& receiverNodes = streamNode.receivers[i];
144  EV_DEBUG << " Receivers for tree " << i << " = [";
145  for (int j = 0; j < receiverNodes.size(); j++) {
146  auto& e = receiverNodes[j];
147  if (j != 0)
148  EV_DEBUG << ", ";
149  EV_DEBUG << e;
150  }
151  EV_DEBUG << "]" << std::endl;
152  }
153  }
154 }

Referenced by computeStreams().

◆ configureStreams() [1/2]

void inet::StreamRedundancyConfigurator::configureStreams ( )
protectedvirtual
258 {
259  for (int i = 0; i < topology->getNumNodes(); i++) {
260  auto node = (Node *)topology->getNode(i);
261  configureStreams(node);
262  }
263 }

Referenced by handleParameterChange(), and initialize().

◆ configureStreams() [2/2]

void inet::StreamRedundancyConfigurator::configureStreams ( Node node)
protectedvirtual
266 {
267  auto networkNode = node->module;
268  auto macForwardingTable = networkNode->findModuleByPath(".macTable");
269  auto ieee8021qTagHeaderChecker = networkNode->findModuleByPath(".ieee8021q.qTagHeaderChecker");
270  auto streamRelay = networkNode->findModuleByPath(".bridging.streamRelay");
271  if (streamRelay == nullptr)
272  streamRelay = networkNode->findModuleByPath(".ieee8021r.policy.streamRelay");
273  auto streamIdentifierLayer = networkNode->findModuleByPath(".bridging.streamIdentifier");
274  if (streamIdentifierLayer == nullptr)
275  streamIdentifierLayer = networkNode->findModuleByPath(".ieee8021r.policy.streamIdentifier");
276  auto streamIdentifier = streamIdentifierLayer != nullptr ? streamIdentifierLayer->getSubmodule("identifier") : streamIdentifierLayer;
277  auto streamMerger = streamRelay != nullptr ? streamRelay->getSubmodule("merger") : nullptr;
278  auto streamSplitter = streamRelay != nullptr ? streamRelay->getSubmodule("splitter") : streamRelay;
279  auto streamCoder = networkNode->findModuleByPath(".bridging.streamCoder");
280  if (streamCoder == nullptr)
281  streamCoder = networkNode->findModuleByPath(".ieee8021r.policy.streamCoder");
282  auto streamDecoder = streamCoder != nullptr ? streamCoder->getSubmodule("decoder") : nullptr;
283  auto streamEncoder = streamCoder != nullptr ? streamCoder->getSubmodule("encoder") : nullptr;
284  if (streamIdentifier != nullptr && !node->streamIdentifications.empty()) {
285  cValueArray *parameterValue = new cValueArray();
286  for (auto& streamIdentification : node->streamIdentifications) {
287  cValueMap *value = new cValueMap();
288  value->set("packetFilter", streamIdentification.packetFilter);
289  value->set("stream", streamIdentification.stream);
290  value->set("sequenceNumbering", cValue(true));
291  parameterValue->add(value);
292  }
293  EV_INFO << "Configuring stream merging" << EV_FIELD(networkNode) << EV_FIELD(streamIdentifier) << EV_FIELD(parameterValue) << EV_ENDL;
294  streamIdentifier->par("mapping") = parameterValue;
295  }
296  if (streamDecoder != nullptr && !node->streamDecodings.empty()) {
297  cValueArray *parameterValue = new cValueArray();
298  for (auto& streamDecoding : node->streamDecodings) {
299  cValueMap *value = new cValueMap();
300  value->set("interface", streamDecoding.networkInterface->getInterfaceName());
301  value->set("vlan", streamDecoding.vlanId);
302  value->set("stream", streamDecoding.name.c_str());
303  parameterValue->add(value);
304  }
305  EV_INFO << "Configuring stream decoding" << EV_FIELD(networkNode) << EV_FIELD(streamDecoder) << EV_FIELD(parameterValue) << EV_ENDL;
306  streamDecoder->par("mapping") = parameterValue;
307  }
308  if (streamMerger != nullptr && !node->streamMergings.empty()) {
309  cValueMap *parameterValue = new cValueMap();
310  for (auto& streamMerging : node->streamMergings) {
311  for (auto inputStream : streamMerging.inputStreams)
312  parameterValue->set(inputStream.c_str(), streamMerging.outputStream.c_str());
313  }
314  EV_INFO << "Configuring stream merging" << EV_FIELD(networkNode) << EV_FIELD(streamMerger) << EV_FIELD(parameterValue) << EV_ENDL;
315  streamMerger->par("mapping") = parameterValue;
316  }
317  if (streamSplitter != nullptr && !node->streamSplittings.empty()) {
318  cValueMap *parameterValue = new cValueMap();
319  for (auto& streamSplitting : node->streamSplittings) {
320  cValueArray *value = new cValueArray();
321  for (auto outputStream : streamSplitting.outputStreams)
322  value->add(outputStream.c_str());
323  parameterValue->set(streamSplitting.inputStream.c_str(), value);
324  }
325  EV_INFO << "Configuring stream splitting" << EV_FIELD(networkNode) << EV_FIELD(streamSplitter) << EV_FIELD(parameterValue) << EV_ENDL;
326  streamSplitter->par("mapping") = parameterValue;
327  }
328  if (streamEncoder != nullptr && !node->streamEncodings.empty()) {
329  cValueArray *parameterValue = new cValueArray();
330  std::map<std::string, std::pair<int, int>> mapping;
331  for (auto& streamEncoding : node->streamEncodings) {
332  auto it = mapping.find(streamEncoding.name);
333  if (it != mapping.end()) {
334  if (it->second.first != streamEncoding.vlanId)
335  throw cRuntimeError("Invalid state");
336  }
337  else
338  mapping[streamEncoding.name] = {streamEncoding.vlanId, streamEncoding.pcp};
339  }
340  for (auto& it : mapping) {
341  cValueMap *value = new cValueMap();
342  value->set("stream", it.first);
343  value->set("vlan", it.second.first);
344  value->set("pcp", it.second.second);
345  parameterValue->add(value);
346  }
347  EV_INFO << "Configuring stream encoding" << EV_FIELD(networkNode) << EV_FIELD(streamEncoder) << EV_FIELD(parameterValue) << EV_ENDL;
348  streamEncoder->par("mapping") = parameterValue;
349  }
350  if (macForwardingTable != nullptr && !node->streamEncodings.empty()) {
351  cValueArray *parameterValue = new cValueArray();
352  for (auto& streamEncoding : node->streamEncodings) {
353  cValueMap *value = new cValueMap();
354  value->set("address", streamEncoding.destination.c_str());
355  value->set("vlan", streamEncoding.vlanId);
356  value->set("interface", streamEncoding.networkInterface->getInterfaceName());
357  parameterValue->add(value);
358  }
359  EV_INFO << "Configuring MAC address table" << EV_FIELD(networkNode) << EV_FIELD(macForwardingTable) << EV_FIELD(parameterValue) << EV_ENDL;
360  macForwardingTable->par("forwardingTable") = parameterValue;
361  }
362  if (ieee8021qTagHeaderChecker != nullptr) {
363  std::set<int> vlanIds;
364  for (auto& streamDecoding : node->streamDecodings)
365  vlanIds.insert(streamDecoding.vlanId);
366  cValueArray *parameterValue = new cValueArray();
367  for (int vlanId : vlanIds)
368  parameterValue->add(vlanId);
369  EV_INFO << "Configuring VLAN filter" << EV_FIELD(networkNode) << EV_FIELD(ieee8021qTagHeaderChecker) << EV_FIELD(parameterValue) << EV_ENDL;
370  ieee8021qTagHeaderChecker->par("vlanIdFilter") = parameterValue;
371  }
372 }

◆ getPathFragments()

std::vector< std::vector< std::string > > inet::StreamRedundancyConfigurator::getPathFragments ( const char *  stream)
virtual
383 {
384  for (int i = 0; i < configuration->size(); i++) {
385  cValueMap *streamConfiguration = check_and_cast<cValueMap *>(configuration->get(i).objectValue());
386  if (!strcmp(streamConfiguration->get("name").stringValue(), stream)) {
387  std::vector<std::vector<std::string>> memberStreams;
388  std::string streamName = streamConfiguration->get("name").stringValue();
389  cValueArray *trees = check_and_cast<cValueArray *>(streamConfiguration->get("trees").objectValue());
390  for (int j = 0; j < trees->size(); j++) {
391  cValueArray *tree = check_and_cast<cValueArray*>(trees->get(j).objectValue());
392  for (int k = 0; k < tree->size(); k++) {
393  cValueArray *path = check_and_cast<cValueArray*>(tree->get(k).objectValue());
394  std::vector<std::string> memberStream;
395  for (int l = 0; l < path->size(); l++) {
396  std::string name = path->get(l).stringValue();
397  auto pos = name.find('.');
398  auto nodeName = pos == std::string::npos ? name : name.substr(0, pos);
399  auto module = findModuleByPath(nodeName.c_str());
400  Node *node = (Node *)topology->getNodeFor(module);
401  bool isMerging = false;
402  for (auto streamMerging : node->streamMergings)
403  if (streamMerging.outputStream == streamName)
404  isMerging = true;
405  bool isSplitting = false;
406  for (auto streamSplitting : node->streamSplittings)
407  if (streamSplitting.inputStream == streamName)
408  isSplitting = true;
409  memberStream.push_back(name);
410  if (isMerging || isSplitting) {
411  if (memberStream.size() > 1 && std::find(memberStreams.begin(), memberStreams.end(), memberStream) == memberStreams.end())
412  memberStreams.push_back(memberStream);
413  memberStream.clear();
414  memberStream.push_back(name);
415  }
416  }
417  if (memberStream.size() > 1 && std::find(memberStreams.begin(), memberStreams.end(), memberStream) == memberStreams.end())
418  memberStreams.push_back(memberStream);
419  }
420  }
421  return memberStreams;
422  }
423  }
424  throw cRuntimeError("Stream not found");
425 }

◆ getStreamNames()

std::vector< std::string > inet::StreamRedundancyConfigurator::getStreamNames ( )
virtual
375 {
376  std::vector<std::string> result;
377  for (auto& it : streams)
378  result.push_back(it.first);
379  return result;
380 }

◆ handleParameterChange()

void inet::StreamRedundancyConfigurator::handleParameterChange ( const char *  name)
overrideprotectedvirtual
29 {
30  if (name != nullptr) {
31  if (!strcmp(name, "configuration")) {
32  configuration = check_and_cast<cValueArray *>(par("configuration").objectValue());
36  }
37  }
38 }

◆ initialize()

void inet::StreamRedundancyConfigurator::initialize ( int  stage)
overrideprotectedvirtual
15 {
16  NetworkConfiguratorBase::initialize(stage);
17  if (stage == INITSTAGE_LOCAL) {
18  minVlanId = par("minVlanId");
19  maxVlanId = par("maxVlanId");
20  configuration = check_and_cast<cValueArray *>(par("configuration").objectValue());
21  }
22  else if (stage == INITSTAGE_NETWORK_CONFIGURATION) {
25  }
26 }

Member Data Documentation

◆ assignedVlanIds

std::map<std::tuple<std::string, std::string, std::string, std::string>, int> inet::StreamRedundancyConfigurator::assignedVlanIds
protected

◆ configuration

cValueArray* inet::StreamRedundancyConfigurator::configuration
protected

◆ maxVlanId

int inet::StreamRedundancyConfigurator::maxVlanId = -1
protected

◆ minVlanId

int inet::StreamRedundancyConfigurator::minVlanId = -1
protected

Referenced by initialize().

◆ nextVlanIds

std::map<std::pair<std::string, std::string>, int> inet::StreamRedundancyConfigurator::nextVlanIds
protected

◆ streams

std::map<std::string, Stream> inet::StreamRedundancyConfigurator::streams
protected

The documentation for this class was generated from the following files:
inet::INITSTAGE_NETWORK_CONFIGURATION
INET_API InitStage INITSTAGE_NETWORK_CONFIGURATION
Initialization of network configuration (e.g.
inet::StreamRedundancyConfigurator::assignedVlanIds
std::map< std::tuple< std::string, std::string, std::string, std::string >, int > assignedVlanIds
Definition: StreamRedundancyConfigurator.h:111
inet::StreamRedundancyConfigurator::configureStreams
virtual void configureStreams()
Definition: StreamRedundancyConfigurator.cc:257
inet::NetworkConfiguratorBase::findLinkOut
virtual Link * findLinkOut(const Node *node, const char *neighbor) const
Definition: NetworkConfiguratorBase.cc:116
inet::NetworkConfiguratorBase::Node::module
cModule * module
Definition: NetworkConfiguratorBase.h:28
inet::StreamRedundancyConfigurator::nextVlanIds
std::map< std::pair< std::string, std::string >, int > nextVlanIds
Definition: StreamRedundancyConfigurator.h:110
inet::StreamRedundancyConfigurator::computeConfiguration
virtual void computeConfiguration()
Computes the network configuration for all nodes in the network.
Definition: StreamRedundancyConfigurator.cc:49
inet::Topology::getNodeFor
Node * getNodeFor(cModule *mod) const
Returns the graph node which corresponds to the given module in the network.
Definition: Topology.cc:355
inet::units::constants::e
const value< double, units::C > e(1.602176487e-19)
inet::StreamRedundancyConfigurator::computeStreamEncodings
virtual void computeStreamEncodings(cValueMap *streamConfiguration)
Definition: StreamRedundancyConfigurator.cc:156
inet::find
std::vector< T >::iterator find(std::vector< T > &v, const Tk &a)
Definition: stlutils.h:44
inet::Topology::getNode
Node * getNode(int i) const
Returns pointer to the ith node in the graph.
Definition: Topology.cc:348
inet::Topology::clear
void clear()
Deletes the topology stored in the object.
Definition: Topology.cc:78
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::NetworkConfiguratorBase::extractTopology
virtual void extractTopology(Topology &topology)
Extracts network topology by walking through the module hierarchy.
Definition: NetworkConfiguratorBase.cc:19
inet::StreamRedundancyConfigurator::clearConfiguration
virtual void clearConfiguration()
Definition: StreamRedundancyConfigurator.cc:40
inet::StreamRedundancyConfigurator::minVlanId
int minVlanId
Definition: StreamRedundancyConfigurator.h:105
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::StreamRedundancyConfigurator::computeStreams
virtual void computeStreams()
Definition: StreamRedundancyConfigurator.cc:59
inet::StreamRedundancyConfigurator::configuration
cValueArray * configuration
Definition: StreamRedundancyConfigurator.h:107
inet::StreamRedundancyConfigurator::streams
std::map< std::string, Stream > streams
Definition: StreamRedundancyConfigurator.h:109
inet::Topology::getNumNodes
int getNumNodes() const
Returns the number of nodes in the graph.
Definition: Topology.h:516
inet::physicallayer::k
const double k
Definition: Qam1024Modulation.cc:14
inet::StreamRedundancyConfigurator::computeStreamPolicyConfigurations
virtual void computeStreamPolicyConfigurations(cValueMap *streamConfiguration)
Definition: StreamRedundancyConfigurator.cc:201
inet::StreamRedundancyConfigurator::computeStreamSendersAndReceivers
virtual void computeStreamSendersAndReceivers(cValueMap *streamConfiguration)
Definition: StreamRedundancyConfigurator.cc:74
TIME
#define TIME(CODE)
Definition: INETDefs.h:96
inet::NetworkConfiguratorBase::topology
Topology * topology
Definition: NetworkConfiguratorBase.h:67
inet::StreamRedundancyConfigurator::maxVlanId
int maxVlanId
Definition: StreamRedundancyConfigurator.h:106
inet::NetworkConfiguratorBase::findLinkIn
virtual Link * findLinkIn(const Node *node, const char *neighbor) const
Definition: NetworkConfiguratorBase.cc:108
EV_ENDL
#define EV_ENDL
Definition: INETDefs.h:114
inet::printElapsedTime
void printElapsedTime(const char *name, long startTime)
Definition: INETDefs.h:91