Commit cf6073dc66eea86ac955e916da6767d2974cacd4
1 parent
81a0fe23
debug flow deletion
Showing
2 changed files
with
15 additions
and
6 deletions
src/main/java/net/floodlightcontroller/pelstats/PELStats.java
| ... | ... | @@ -247,7 +247,7 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 247 | 247 | } |
| 248 | 248 | return Command.CONTINUE; |
| 249 | 249 | } |
| 250 | - private void sendOFFlowMod(IOFSwitch sw,int port){ | |
| 250 | + public static void sendOFFlowMod(IOFSwitch sw,int port){ | |
| 251 | 251 | //System.out.println("@PELStats,sendOFFlowMod: trying to craft message"); |
| 252 | 252 | //OpenFlow message for flow tables modifications |
| 253 | 253 | // |
| ... | ... | @@ -255,7 +255,7 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 255 | 255 | OFMatch OFmatch= new OFMatch(); |
| 256 | 256 | OFActionEnqueue enqueue= new OFActionEnqueue(); |
| 257 | 257 | |
| 258 | - OFmessage.setCommand((short)0); | |
| 258 | + OFmessage.setCommand((short)queueInfos.get(sw).get(2).intValue()); | |
| 259 | 259 | OFmessage.setCookie(0); |
| 260 | 260 | OFmessage.setIdleTimeout((short) 0); |
| 261 | 261 | OFmessage.setHardTimeout((short)0); |
| ... | ... | @@ -299,7 +299,7 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 299 | 299 | OFmatch= new OFMatch(); |
| 300 | 300 | enqueue= new OFActionEnqueue(); |
| 301 | 301 | |
| 302 | - OFmessage.setCommand((short)0); | |
| 302 | + OFmessage.setCommand((short)queueInfos.get(sw).get(2).intValue()); | |
| 303 | 303 | OFmessage.setCookie(0); |
| 304 | 304 | OFmessage.setIdleTimeout((short) 0); |
| 305 | 305 | OFmessage.setHardTimeout((short)0); |
| ... | ... | @@ -348,7 +348,7 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 348 | 348 | OFmatch= new OFMatch(); |
| 349 | 349 | enqueue= new OFActionEnqueue(); |
| 350 | 350 | |
| 351 | - OFmessage.setCommand((short)0); | |
| 351 | + OFmessage.setCommand((short)queueInfos.get(sw).get(2).intValue()); | |
| 352 | 352 | OFmessage.setCookie(0); |
| 353 | 353 | OFmessage.setIdleTimeout((short) 0); |
| 354 | 354 | OFmessage.setHardTimeout((short)0); |
| ... | ... | @@ -392,7 +392,7 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 392 | 392 | OFmatch= new OFMatch(); |
| 393 | 393 | enqueue= new OFActionEnqueue(); |
| 394 | 394 | |
| 395 | - OFmessage.setCommand((short)0); | |
| 395 | + OFmessage.setCommand((short)queueInfos.get(sw).get(2).intValue()); | |
| 396 | 396 | OFmessage.setCookie(0); |
| 397 | 397 | OFmessage.setIdleTimeout((short) 0); |
| 398 | 398 | OFmessage.setHardTimeout((short)0); | ... | ... |
src/main/java/net/floodlightcontroller/pelstats/rest/RESTQueue.java
| ... | ... | @@ -221,7 +221,16 @@ public class RESTQueue extends ServerResource{ |
| 221 | 221 | queueInfos.add(new Integer(action)); |
| 222 | 222 | |
| 223 | 223 | PELStats.queueInfos.put(mySwitch, queueInfos); |
| 224 | - | |
| 224 | + | |
| 225 | + if (action==3 && protocol==1){ | |
| 226 | + for (int port : PELStats.portsCallsMap.get(mySwitch)) | |
| 227 | + { | |
| 228 | + System.out.println("@RESTQueue: port deletion: "+port); | |
| 229 | + PELStats.sendOFFlowMod(mySwitch,port); | |
| 230 | + } | |
| 231 | + PELStats.portsCallsMap.put(mySwitch, new ArrayList<Integer>()); | |
| 232 | + | |
| 233 | + } | |
| 225 | 234 | if (protocol!=1){ |
| 226 | 235 | //OpenFlow message for flow tables modifications |
| 227 | 236 | // | ... | ... |