Skip to content

Commit

Permalink
Added getFlowsSwitchesData function in ODL_utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPapad committed Aug 19, 2019
1 parent 123ea1a commit 184c780
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions net-man-app/src/utilities/ODL_utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,26 @@ export const extractLinksFromNodesPath = (nodesPath) => {
return extractedLinksIDs;
}

export const getFlowsSwitchesData = (nodesPath, linksInfo, nodesInfo, tableId) => {

let flowsSwitchesData = [];
for (let i=1; i < nodesPath.length-1; i++)
{
const linkId = nodesPath[i] + "/" + nodesPath[i+1];
const switchPortId = linksInfo[linkId].sourceInfo.portId;
const switchPortNum = nodesInfo[nodesPath[i]].connectors[switchPortId]["flow-node-inventory:port-number"];

const flowSwitchData = {
switchId: nodesPath[i],
portNumber: switchPortNum,
tableId: tableId
};
flowsSwitchesData.push(flowSwitchData);
}

return flowsSwitchesData;
}


export const getGraphLinks = (linksInfo, selectedLinksIDs) => {

Expand Down

0 comments on commit 184c780

Please sign in to comment.