diff --git a/src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntryPusher.java b/src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntryPusher.java index 489a8f949e8f7f5eb51a0fa92bd2445b684056ed..5acc371abc8945eca82da26c0229a09babe8d86d 100644 --- a/src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntryPusher.java +++ b/src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntryPusher.java @@ -90,7 +90,7 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, public static final String TABLE_NAME = "controller_staticflowtableentry"; public static final String COLUMN_NAME = "name"; public static final String COLUMN_SWITCH = "switch"; - public static final String COLUMN_TABLE_ID = "table"; + public static final String COLUMN_TABLE_ID = "table_id"; public static final String COLUMN_ACTIVE = "active"; public static final String COLUMN_IDLE_TIMEOUT = "idle_timeout"; public static final String COLUMN_HARD_TIMEOUT = "hard_timeout"; @@ -131,7 +131,19 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, public static final String COLUMN_ARP_DHA = MatchUtils.STR_ARP_DHA; public static final String COLUMN_ARP_SPA = MatchUtils.STR_ARP_SPA; public static final String COLUMN_ARP_DPA = MatchUtils.STR_ARP_DPA; - + +//san + //IPv6 related columns + public static final String COLUMN_NW6_SRC = MatchUtils.STR_IPV6_SRC; + public static final String COLUMN_NW6_DST = MatchUtils.STR_IPV6_DST; + public static final String COLUMN_IPV6_FLOW_LABEL = MatchUtils.STR_IPV6_FLOW_LABEL; + public static final String COLUMN_ICMP6_TYPE = MatchUtils.STR_ICMPV6_TYPE; + public static final String COLUMN_ICMP6_CODE = MatchUtils.STR_ICMPV6_CODE; + public static final String COLUMN_ND_SLL = MatchUtils.STR_IPV6_ND_SLL; + public static final String COLUMN_ND_TLL = MatchUtils.STR_IPV6_ND_TLL; + public static final String COLUMN_ND_TARGET = MatchUtils.STR_IPV6_ND_TARGET; +//san + public static final String COLUMN_MPLS_LABEL = MatchUtils.STR_MPLS_LABEL; public static final String COLUMN_MPLS_TC = MatchUtils.STR_MPLS_TC; public static final String COLUMN_MPLS_BOS = MatchUtils.STR_MPLS_BOS; @@ -164,6 +176,11 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, COLUMN_ICMP_TYPE, COLUMN_ICMP_CODE, COLUMN_ARP_OPCODE, COLUMN_ARP_SHA, COLUMN_ARP_DHA, COLUMN_ARP_SPA, COLUMN_ARP_DPA, +//san + //IPv6 related matches + COLUMN_NW6_SRC, COLUMN_NW6_DST, COLUMN_ICMP6_TYPE, COLUMN_ICMP6_CODE, + COLUMN_IPV6_FLOW_LABEL, COLUMN_ND_SLL, COLUMN_ND_TLL, COLUMN_ND_TARGET, +//san COLUMN_MPLS_LABEL, COLUMN_MPLS_TC, COLUMN_MPLS_BOS, COLUMN_METADATA, COLUMN_TUNNEL_ID, COLUMN_PBB_ISID, /* end newly added matches */ @@ -343,6 +360,9 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, // get the correct builder for the OF version supported by the switch fmb = OFFactories.getFactory(switchService.getSwitch(DatapathId.of(switchName)).getOFFactory().getVersion()).buildFlowModify(); + //HashSet<OFFlowModFlags> flags = new HashSet<OFFlowModFlags>(); + //flags.add(OFFlowModFlags.CHECK_OVERLAP); + //fmb.setFlags(flags); StaticFlowEntries.initDefaultFlowMod(fmb, entryName); @@ -408,7 +428,13 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, log.debug("ignoring flow entry {} on switch {} with illegal OFMatch() key: " + match, entryName, switchName); return; } - +//san + catch (HeaderFieldsException e) { + log.error("OF version incompatible for the match: " + match); + e.printStackTrace(); + return; + } +//san entries.get(switchName).put(entryName, fmb.build()); // add the FlowMod message to the table } @@ -505,7 +531,6 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, } else if (newFlowMod != null && oldFlowMod == null) { OFFlowAdd addTmp = FlowModUtils.toFlowAdd(newFlowMod); entriesFromStorage.get(dpid).put(entry, addTmp); - entry2dpid.put(entry, dpid); outQueue.add(addTmp); /* Something strange happened, so remove the flow */ } else if (newFlowMod == null) { @@ -753,9 +778,15 @@ implements IOFSwitchListener, IFloodlightModule, IStaticFlowEntryPusherService, // IStaticFlowEntryPusherService methods @Override - public void addFlow(String name, OFFlowMod fm, DatapathId swDpid) { - Map<String, Object> fmMap = StaticFlowEntries.flowModToStorageEntry(fm, swDpid.toString(), name); - storageSourceService.insertRowAsync(TABLE_NAME, fmMap); + public void addFlow(String name, OFFlowMod fm, DatapathId swDpid) { + try { + Map<String, Object> fmMap = StaticFlowEntries.flowModToStorageEntry(fm, swDpid.toString(), name); + storageSourceService.insertRowAsync(TABLE_NAME, fmMap); + } catch (HeaderFieldsException e) { + log.error("Error! Check the fields specified for the flow.Make sure IPv4 fields are not mixed with IPv6 fields or all " + + "mandatory fields are specified. "); + } + } @Override