Commit af98298ef2c9c439b2e8fb9e82807e940011b6f8
1 parent
722c3383
debug deletion wildcards
Showing
2 changed files
with
22 additions
and
33 deletions
src/main/java/net/floodlightcontroller/pelstats/PELStats.java
| ... | ... | @@ -249,13 +249,17 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 249 | 249 | } |
| 250 | 250 | public static void sendOFFlowMod(IOFSwitch sw,int port){ |
| 251 | 251 | |
| 252 | + OFFlowMod OFmessage= new OFFlowMod(); | |
| 253 | + OFMatch OFmatch= new OFMatch(); | |
| 254 | + OFActionEnqueue enqueue= new OFActionEnqueue(); | |
| 255 | + | |
| 252 | 256 | |
| 253 | 257 | //System.out.println("@PELStats,sendOFFlowMod: trying to craft message"); |
| 254 | 258 | //OpenFlow message for flow tables modifications |
| 255 | 259 | // |
| 256 | - OFFlowMod OFmessage= new OFFlowMod(); | |
| 257 | - OFMatch OFmatch= new OFMatch(); | |
| 258 | - OFActionEnqueue enqueue= new OFActionEnqueue(); | |
| 260 | + OFmessage= new OFFlowMod(); | |
| 261 | + OFmatch= new OFMatch(); | |
| 262 | + enqueue= new OFActionEnqueue(); | |
| 259 | 263 | |
| 260 | 264 | OFmessage.setCommand((short)queueInfos.get(sw).get(2).intValue()); |
| 261 | 265 | OFmessage.setCookie(0); |
| ... | ... | @@ -295,6 +299,9 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 295 | 299 | } catch (IOException e) { |
| 296 | 300 | e.printStackTrace(); |
| 297 | 301 | } |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 298 | 305 | //OpenFlow message for flow tables modifications |
| 299 | 306 | //The same as before, only the input and output ports are inverted |
| 300 | 307 | OFmessage= new OFFlowMod(); |
| ... | ... | @@ -359,11 +366,8 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 359 | 366 | OFmessage.setOutPort((short)0xffff); |
| 360 | 367 | OFmessage.setFlags((short) 0); |
| 361 | 368 | |
| 362 | - //OFmatch.setTransportDestination((short)port); | |
| 363 | 369 | OFmatch.setTransportSource((short)(port+1)); |
| 364 | - | |
| 365 | - | |
| 366 | - | |
| 370 | + | |
| 367 | 371 | OFmatch.setWildcards(OFMatch.OFPFW_ALL - OFMatch.OFPFW_IN_PORT |
| 368 | 372 | - OFMatch.OFPFW_TP_SRC - OFMatch.OFPFW_NW_PROTO |
| 369 | 373 | - OFMatch.OFPFW_DL_VLAN_PCP -OFMatch.OFPFW_DL_TYPE);//*/ |
| ... | ... | @@ -405,19 +409,16 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 405 | 409 | OFmessage.setOutPort((short)0xffff); |
| 406 | 410 | OFmessage.setFlags((short) 0); |
| 407 | 411 | |
| 408 | - //OFmatch.setTransportDestination((short)port); | |
| 409 | 412 | OFmatch.setTransportSource((short)(port+1)); |
| 410 | 413 | |
| 411 | - | |
| 412 | - | |
| 413 | 414 | OFmatch.setWildcards(OFMatch.OFPFW_ALL - OFMatch.OFPFW_IN_PORT |
| 414 | 415 | - OFMatch.OFPFW_TP_SRC - OFMatch.OFPFW_NW_PROTO |
| 415 | 416 | - OFMatch.OFPFW_DL_VLAN_PCP -OFMatch.OFPFW_DL_TYPE);//*/ |
| 416 | 417 | OFmatch.setNetworkProtocol((byte)0x11); |
| 417 | 418 | OFmatch.setDataLayerType((short)0x0800); |
| 418 | 419 | OFmatch.setDataLayerVirtualLanPriorityCodePoint((byte)0x0); |
| 419 | - | |
| 420 | 420 | OFmatch.setInputPort((short)2); |
| 421 | + | |
| 421 | 422 | OFmessage.setMatch(OFmatch); |
| 422 | 423 | |
| 423 | 424 | actions= new ArrayList<OFAction>(1); |
| ... | ... | @@ -426,11 +427,10 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 426 | 427 | |
| 427 | 428 | OFmessage.setActions(actions); |
| 428 | 429 | OFmessage.setLength((short)(OFFlowMod.MINIMUM_LENGTH +OFActionEnqueue.MINIMUM_LENGTH)); |
| 429 | - //System.out.println("@PELStats,sendOFFlowMod: trying to send message"); | |
| 430 | + | |
| 430 | 431 | try { |
| 431 | 432 | sw.write(OFmessage, null); |
| 432 | 433 | sw.flush(); |
| 433 | - //System.out.println("@PELStats,sendOFFlowMod: message sent: "+OFmessage); | |
| 434 | 434 | } catch (IOException e) { |
| 435 | 435 | e.printStackTrace(); |
| 436 | 436 | } |
| ... | ... | @@ -441,7 +441,6 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 441 | 441 | //Delete all the flows created by the switch for the voip |
| 442 | 442 | OFmessage= new OFFlowMod(); |
| 443 | 443 | OFmatch= new OFMatch(); |
| 444 | - enqueue= new OFActionEnqueue(); | |
| 445 | 444 | |
| 446 | 445 | OFmessage.setCommand((short)3); |
| 447 | 446 | OFmessage.setCookie(0); |
| ... | ... | @@ -453,35 +452,30 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 453 | 452 | OFmessage.setFlags((short) 0); |
| 454 | 453 | |
| 455 | 454 | OFmatch.setTransportSource((short)port); |
| 456 | - | |
| 457 | 455 | OFmatch.setWildcards(OFMatch.OFPFW_ALL //- OFMatch.OFPFW_IN_PORT |
| 458 | 456 | - OFMatch.OFPFW_TP_SRC - OFMatch.OFPFW_NW_PROTO |
| 459 | 457 | - OFMatch.OFPFW_DL_VLAN_PCP -OFMatch.OFPFW_DL_TYPE |
| 460 | 458 | - OFMatch.OFPFW_NW_TOS);//*/ |
| 461 | - OFmatch.setNetworkTypeOfService((byte) 0); | |
| 459 | + OFmatch.setNetworkTypeOfService((byte)0x2e); | |
| 462 | 460 | OFmatch.setNetworkProtocol((byte)0x11); |
| 463 | 461 | OFmatch.setDataLayerType((short)0x0800); |
| 464 | 462 | OFmatch.setDataLayerVirtualLanPriorityCodePoint((byte)0x0); |
| 465 | - | |
| 466 | - //OFmatch.setInputPort((short)1); | |
| 467 | - OFmessage.setMatch(OFmatch); | |
| 468 | - | |
| 469 | 463 | |
| 464 | + OFmessage.setMatch(OFmatch); | |
| 470 | 465 | OFmessage.setLength((short)(OFFlowMod.MINIMUM_LENGTH)); |
| 471 | - //System.out.println("@PELStats,sendOFFlowMod: trying to send message"); | |
| 466 | + | |
| 472 | 467 | try { |
| 473 | 468 | sw.write(OFmessage, null); |
| 474 | 469 | sw.flush(); |
| 475 | - //System.out.println("@PELStats,sendOFFlowMod: message sent: "+OFmessage); | |
| 476 | 470 | } catch (IOException e) { |
| 477 | 471 | e.printStackTrace(); |
| 478 | 472 | } |
| 479 | 473 | |
| 474 | + | |
| 480 | 475 | //OpenFlow message for flow tables modifications |
| 481 | 476 | //Delete all the flows created by the switch for the RTCP |
| 482 | 477 | OFmessage= new OFFlowMod(); |
| 483 | 478 | OFmatch= new OFMatch(); |
| 484 | - enqueue= new OFActionEnqueue(); | |
| 485 | 479 | |
| 486 | 480 | OFmessage.setCommand((short)3); |
| 487 | 481 | OFmessage.setCookie(0); |
| ... | ... | @@ -493,29 +487,24 @@ public class PELStats implements IFloodlightModule, IOFMessageListener, RestAPIP |
| 493 | 487 | OFmessage.setFlags((short) 0); |
| 494 | 488 | |
| 495 | 489 | OFmatch.setTransportSource((short)(port+1)); |
| 496 | - | |
| 497 | 490 | OFmatch.setWildcards(OFMatch.OFPFW_ALL //- OFMatch.OFPFW_IN_PORT |
| 498 | 491 | - OFMatch.OFPFW_TP_SRC - OFMatch.OFPFW_NW_PROTO |
| 499 | 492 | - OFMatch.OFPFW_DL_VLAN_PCP -OFMatch.OFPFW_DL_TYPE |
| 500 | - - OFMatch.OFPFW_NW_TOS);//*/ | |
| 501 | - OFmatch.setNetworkTypeOfService((byte) 0); | |
| 493 | + - OFMatch.OFPFW_NW_TOS); | |
| 494 | + OFmatch.setNetworkTypeOfService((byte) 0x2e); | |
| 502 | 495 | OFmatch.setNetworkProtocol((byte)0x11); |
| 503 | 496 | OFmatch.setDataLayerType((short)0x0800); |
| 504 | 497 | OFmatch.setDataLayerVirtualLanPriorityCodePoint((byte)0x0); |
| 505 | 498 | |
| 506 | - //OFmatch.setInputPort((short)1); | |
| 507 | 499 | OFmessage.setMatch(OFmatch); |
| 508 | - | |
| 509 | - | |
| 510 | 500 | OFmessage.setLength((short)(OFFlowMod.MINIMUM_LENGTH)); |
| 511 | - //System.out.println("@PELStats,sendOFFlowMod: trying to send message"); | |
| 501 | + | |
| 512 | 502 | try { |
| 513 | 503 | sw.write(OFmessage, null); |
| 514 | 504 | sw.flush(); |
| 515 | - //System.out.println("@PELStats,sendOFFlowMod: message sent: "+OFmessage); | |
| 516 | 505 | } catch (IOException e) { |
| 517 | 506 | e.printStackTrace(); |
| 518 | - } | |
| 507 | + }//*/ | |
| 519 | 508 | |
| 520 | 509 | |
| 521 | 510 | ... | ... |
src/main/resources/web/js/main.js