// Analyze all the flows with outPorts equaling the downed
// port and extract OFMatch's to trace back to neighbors
for (OFFlowStatisticsReply flow : flows) {
// Create a reference to the match for ease
OFMatch match = flow.getMatch();
// Here we utilize an index of input ports which point
// to multiple invalid matches
if (invalidBaseIngressAndMatches.containsKey(match.getInputPort()))
// If the input port is already in the index, add
// the match to it's list
invalidBaseIngressAndMatches.get(match.getInputPort())
.add(match);
else {
// Otherwise create a new list and add it to the
// index
List<OFMatch> matches = new ArrayList<OFMatch>();
matches.add(match);
invalidBaseIngressAndMatches.put(match.getInputPort(),
matches);
}
}
// Remove invalid flows from the base switch, if they exist