diff --git a/src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntryPusher.java b/src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntryPusher.java index b345bf2119d3131e2237be326a0c71e026bcad10..ba8a2c5fff06087f1771249d532f5c1b6e8c91e7 100644 --- a/src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntryPusher.java +++ b/src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntryPusher.java @@ -365,19 +365,21 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, if (row.get(key) == null) { continue; } + if (key.equals(COLUMN_SWITCH) || key.equals(COLUMN_NAME) || key.equals("id")) { continue; // already handled } - // explicitly ignore timeouts and wildcards - if (key.equals(COLUMN_HARD_TIMEOUT) || key.equals(COLUMN_IDLE_TIMEOUT)) { - continue; - } + if (key.equals(COLUMN_ACTIVE)) { if (!Boolean.valueOf((String) row.get(COLUMN_ACTIVE))) { log.debug("skipping inactive entry {} for switch {}", entryName, switchName); entries.get(switchName).put(entryName, null); // mark this an inactive return; } + } else if (key.equals(COLUMN_HARD_TIMEOUT)) { + fmb.setHardTimeout(Integer.valueOf((String) row.get(COLUMN_HARD_TIMEOUT))); + } else if (key.equals(COLUMN_IDLE_TIMEOUT)) { + fmb.setIdleTimeout(Integer.valueOf((String) row.get(COLUMN_IDLE_TIMEOUT))); } else if (key.equals(COLUMN_TABLE_ID)) { if (fmb.getVersion().compareTo(OFVersion.OF_10) > 0) { fmb.setTableId(TableId.of(Integer.parseInt((String) row.get(key)))); // support multiple flow tables for OF1.1+ @@ -426,14 +428,11 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, } catch (IllegalArgumentException e) { log.debug("Ignoring flow entry {} on switch {} with illegal OFMatch() key: " + match, entryName, switchName); return; - } -//sanjivini - catch (Exception e) { + } catch (Exception e) { log.error("OF version incompatible for the match: " + match); e.printStackTrace(); return; } -//sanjivini entries.get(switchName).put(entryName, fmb.build()); // add the FlowMod message to the table } diff --git a/src/main/java/net/floodlightcontroller/util/MatchUtils.java b/src/main/java/net/floodlightcontroller/util/MatchUtils.java index 6957010624f3ef5b055bb140189c8298a729d76c..9b16fa7a8ebaa4f1deb8301049e47b605755f15f 100644 --- a/src/main/java/net/floodlightcontroller/util/MatchUtils.java +++ b/src/main/java/net/floodlightcontroller/util/MatchUtils.java @@ -367,13 +367,10 @@ public class MatchUtils { Match.Builder mb = OFFactories.getFactory(ofVersion).buildMatch(); - //sanjivini - //Determine if the OF version is 1.0 before adding a flow if (ofVersion.equals(OFVersion.OF_10)) { ver10 = true; } - //sanjivini while (!llValues.isEmpty()) { IpProtocol ipProto = null; @@ -428,8 +425,6 @@ public class MatchUtils { case STR_NW_SRC: mb.setMasked(MatchField.IPV4_SRC, IPv4AddressWithMask.of(key_value[1])); break; - - //sanjivini case STR_IPV6_DST: if (ver10 == true) { throw new IllegalArgumentException("OF Version incompatible"); @@ -452,8 +447,6 @@ public class MatchUtils { mb.setExact(MatchField.IPV6_FLABEL, IPv6FlowLabel.of(Integer.parseInt(key_value[1]))); } break; - //sanjivini - case STR_NW_PROTO: if (key_value[1].startsWith("0x")) { mb.setExact(MatchField.IP_PROTO, IpProtocol.of(Short.valueOf(key_value[1].replaceFirst("0x", ""), 16)));