Package org.flowforwarding.warp.protocol.ofmessages.OFMessageFlowMod

Examples of org.flowforwarding.warp.protocol.ofmessages.OFMessageFlowMod.OFMessageFlowModRef


   @Override
   protected void packetIn(SwitchRef swRef, OFMessagePacketInRef packetIn) {
      super.packetIn(swRef, packetIn);
      IOFMessageProvider provider = swRef.getProvider();
     
      OFMessageFlowModRef flowMod = provider.buildFlowModMsg();
     
      if (packetIn.existMatchInPort()) {
         flowMod.addMatchInPort(packetIn.getMatchInPort().getMatch());
      } else if (packetIn.existMatchEthDst()) {
         flowMod.addMatchEthDst(packetIn.getMatchEthDst().getMatch());
      } else if (packetIn.existMatchEthSrc()) {
         flowMod.addMatchEthSrc(packetIn.getMatchEthSrc().getMatch());
      }
     
      OFStructureInstructionRef instruction = provider.buildInstructionApplyActions();
      instruction.addActionOutput("2");
      flowMod.addInstruction("apply_actions", instruction);

      sendFlowModMessage(swRef, flowMod);
   }
View Full Code Here


      } else if (msg instanceof OFCommandSendSwConfigRequest) {
         tcpChannel.tell(TcpMessage.write(ByteString.fromArray(provider.encodeSwitchConfigRequest())), getSelf());
      } else if (msg instanceof TellToSendFlowMod) {
         System.out.println("[OF-INFO]: Send Flow Mod");
        
         OFMessageFlowModRef flowModRef = provider.buildFlowModMsg();
         flowModRef.addField("priority", "32000");
         flowModRef.addMatchInPort(swRef.getDpid().toString().substring(0, 3));

         OFStructureInstructionRef instruction = provider.buildInstructionApplyActions();
         instruction.addActionOutput("2");
         flowModRef.addInstruction("apply_actions", instruction);

         instruction = provider.buildInstructionGotoTable();
         flowModRef.addInstruction("goto_table", instruction);
        
         tcpChannel.tell(TcpMessage.write(ByteString.fromArray(provider.encodeFlowMod(flowModRef))), getSelf());
      }
   }
View Full Code Here

TOP

Related Classes of org.flowforwarding.warp.protocol.ofmessages.OFMessageFlowMod.OFMessageFlowModRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.