Skip to content
Snippets Groups Projects
Commit 728df004 authored by Banse, Christian's avatar Banse, Christian
Browse files

added option to add SEND_FLOW_REM flag into new flowmod messages

parent 7415727a
No related branches found
No related tags found
No related merge requests found
......@@ -470,6 +470,13 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule {
} else {
log.info("Default priority not configured. Using {}.", FLOWMOD_DEFAULT_PRIORITY);
}
tmp = configParameters.get("set-send-flow-rem-flag");
if (tmp != null) {
FLOWMOD_SET_SEND_FLOW_REM_FLAG = Boolean.parseBoolean(tmp);
log.info("Default flags will include SEND_FLOW_REM");
} else {
log.info("Default flags will be empty");
}
tmp = configParameters.get("match");
if (tmp != null) {
tmp = tmp.toLowerCase();
......
......@@ -21,6 +21,7 @@ import java.io.IOException;
import java.util.EnumSet;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
......@@ -51,6 +52,7 @@ import org.projectfloodlight.openflow.protocol.OFFlowMod;
import org.projectfloodlight.openflow.protocol.match.Match;
import org.projectfloodlight.openflow.protocol.match.MatchField;
import org.projectfloodlight.openflow.protocol.OFFlowModCommand;
import org.projectfloodlight.openflow.protocol.OFFlowModFlags;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPacketIn;
import org.projectfloodlight.openflow.protocol.OFPacketOut;
......@@ -84,6 +86,8 @@ public abstract class ForwardingBase implements IOFMessageListener {
public static int FLOWMOD_DEFAULT_HARD_TIMEOUT = 0; // infinite
public static int FLOWMOD_DEFAULT_PRIORITY = 1; // 0 is the default table-miss flow in OF1.3+, so we need to use 1
public static boolean FLOWMOD_SET_SEND_FLOW_REM_FLAG = false;
public static boolean FLOWMOD_DEFAULT_MATCH_VLAN = true;
public static boolean FLOWMOD_DEFAULT_MATCH_MAC = true;
public static boolean FLOWMOD_DEFAULT_MATCH_IP_ADDR = true;
......@@ -265,6 +269,12 @@ public abstract class ForwardingBase implements IOFMessageListener {
aob.setMaxLen(Integer.MAX_VALUE);
actions.add(aob.build());
if(FLOWMOD_SET_SEND_FLOW_REM_FLAG) {
Set<OFFlowModFlags> flags = new HashSet<>();
flags.add(OFFlowModFlags.SEND_FLOW_REM);
fmb.setFlags(flags);
}
// compile
fmb.setMatch(mb.build()) // was match w/o modifying input port
.setActions(actions)
......
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