Skip to content
Snippets Groups Projects
Commit adae0c98 authored by Ryan Izard's avatar Ryan Izard
Browse files

Merge pull request #491 from rizard/v1.0

Bug fix.
parents f5921217 eb2141f8
No related branches found
No related tags found
No related merge requests found
...@@ -365,19 +365,21 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, ...@@ -365,19 +365,21 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService,
if (row.get(key) == null) { if (row.get(key) == null) {
continue; continue;
} }
if (key.equals(COLUMN_SWITCH) || key.equals(COLUMN_NAME) || key.equals("id")) { if (key.equals(COLUMN_SWITCH) || key.equals(COLUMN_NAME) || key.equals("id")) {
continue; // already handled 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 (key.equals(COLUMN_ACTIVE)) {
if (!Boolean.valueOf((String) row.get(COLUMN_ACTIVE))) { if (!Boolean.valueOf((String) row.get(COLUMN_ACTIVE))) {
log.debug("skipping inactive entry {} for switch {}", entryName, switchName); log.debug("skipping inactive entry {} for switch {}", entryName, switchName);
entries.get(switchName).put(entryName, null); // mark this an inactive entries.get(switchName).put(entryName, null); // mark this an inactive
return; 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)) { } else if (key.equals(COLUMN_TABLE_ID)) {
if (fmb.getVersion().compareTo(OFVersion.OF_10) > 0) { 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+ 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, ...@@ -426,14 +428,11 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService,
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
log.debug("Ignoring flow entry {} on switch {} with illegal OFMatch() key: " + match, entryName, switchName); log.debug("Ignoring flow entry {} on switch {} with illegal OFMatch() key: " + match, entryName, switchName);
return; return;
} } catch (Exception e) {
//sanjivini
catch (Exception e) {
log.error("OF version incompatible for the match: " + match); log.error("OF version incompatible for the match: " + match);
e.printStackTrace(); e.printStackTrace();
return; return;
} }
//sanjivini
entries.get(switchName).put(entryName, fmb.build()); // add the FlowMod message to the table entries.get(switchName).put(entryName, fmb.build()); // add the FlowMod message to the table
} }
......
...@@ -367,13 +367,10 @@ public class MatchUtils { ...@@ -367,13 +367,10 @@ public class MatchUtils {
Match.Builder mb = OFFactories.getFactory(ofVersion).buildMatch(); Match.Builder mb = OFFactories.getFactory(ofVersion).buildMatch();
//sanjivini
//Determine if the OF version is 1.0 before adding a flow //Determine if the OF version is 1.0 before adding a flow
if (ofVersion.equals(OFVersion.OF_10)) { if (ofVersion.equals(OFVersion.OF_10)) {
ver10 = true; ver10 = true;
} }
//sanjivini
while (!llValues.isEmpty()) { while (!llValues.isEmpty()) {
IpProtocol ipProto = null; IpProtocol ipProto = null;
...@@ -428,8 +425,6 @@ public class MatchUtils { ...@@ -428,8 +425,6 @@ public class MatchUtils {
case STR_NW_SRC: case STR_NW_SRC:
mb.setMasked(MatchField.IPV4_SRC, IPv4AddressWithMask.of(key_value[1])); mb.setMasked(MatchField.IPV4_SRC, IPv4AddressWithMask.of(key_value[1]));
break; break;
//sanjivini
case STR_IPV6_DST: case STR_IPV6_DST:
if (ver10 == true) { if (ver10 == true) {
throw new IllegalArgumentException("OF Version incompatible"); throw new IllegalArgumentException("OF Version incompatible");
...@@ -452,8 +447,6 @@ public class MatchUtils { ...@@ -452,8 +447,6 @@ public class MatchUtils {
mb.setExact(MatchField.IPV6_FLABEL, IPv6FlowLabel.of(Integer.parseInt(key_value[1]))); mb.setExact(MatchField.IPV6_FLABEL, IPv6FlowLabel.of(Integer.parseInt(key_value[1])));
} }
break; break;
//sanjivini
case STR_NW_PROTO: case STR_NW_PROTO:
if (key_value[1].startsWith("0x")) { if (key_value[1].startsWith("0x")) {
mb.setExact(MatchField.IP_PROTO, IpProtocol.of(Short.valueOf(key_value[1].replaceFirst("0x", ""), 16))); mb.setExact(MatchField.IP_PROTO, IpProtocol.of(Short.valueOf(key_value[1].replaceFirst("0x", ""), 16)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment