Skip to content

Commit

Permalink
StreamRedundancyConfigurator: Changed assignedVlanIds handling to be …
Browse files Browse the repository at this point in the history
…more strict.

When new entries are inserted there should be none. Also, when an entry is looked
up, it should already be there.
  • Loading branch information
levy committed Mar 26, 2024
1 parent 76a6c3f commit 34aaeb3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ void StreamRedundancyConfigurator::computeStreamEncodings(cValueMap *streamConfi
for (size_t k = 0; k < receiverNetworkNodeNames.size(); k++) {
auto receiverNetworkNodeName = receiverNetworkNodeNames[k];
EV_DEBUG << "Assigning VLAN id" << EV_FIELD(streamName) << EV_FIELD(networkNodeName) << EV_FIELD(receiverNetworkNodeName) << EV_FIELD(destinationAddress) << EV_FIELD(vlanId) << EV_ENDL;
assignedVlanIds[{networkNodeName, receiverNetworkNodeName, destinationAddress, streamName}] = vlanId;
std::tuple<std::string, std::string, std::string, std::string> key = {networkNodeName, receiverNetworkNodeName, destinationAddress, streamName};
ASSERT(assignedVlanIds.find(key) == assignedVlanIds.end());
assignedVlanIds[key] = vlanId;
StreamEncoding streamEncoding;
streamEncoding.name = outputStreamName;
streamEncoding.networkInterface = streamNode.interfaces[j][k];
Expand Down Expand Up @@ -217,7 +219,7 @@ void StreamRedundancyConfigurator::computeStreamPolicyConfigurations(cValueMap *
for (auto senderNetworkNodeName : streamNode.senders) {
auto inputStreamName = streamNode.senders.size() == 1 ? streamName : streamName + "_" + senderNetworkNodeName;
auto linkIn = findLinkIn(node, senderNetworkNodeName.c_str());
auto vlanId = assignedVlanIds[{senderNetworkNodeName, networkNodeName, destinationAddress, streamName}];
auto vlanId = assignedVlanIds.at({senderNetworkNodeName, networkNodeName, destinationAddress, streamName});
StreamDecoding streamDecoding;
streamDecoding.name = inputStreamName;
streamDecoding.networkInterface = linkIn->destinationInterface->networkInterface;
Expand Down

0 comments on commit 34aaeb3

Please sign in to comment.