Examples of OFStructureInstructionRef


Examples of org.flowforwarding.warp.protocol.ofstructures.OFStructureInstruction.OFStructureInstructionRef

      GenericRecord instrRecord = null;
      for (Tuple<String, OFStructureInstructionRef> tuple : instrList) {
         boolean isActions = false;
         //Tuple<String, OFStructureInstruction> tuple = instrIter.next();
         String name = tuple.getName();
         OFStructureInstructionRef instruction = tuple.getValue();
        
         // TODO Improvs: Replace Switch with a structure... say, HashMap
         // TODO Improvs: How to control type compatibility between Schema types and incoming tlvs?
         switch (name) {
         case "apply_actions":
            instrHeaderSchema = protocol.getType("of12.instruction_apply_actions_header");
            instrSchema = protocol.getType("of12.ofp_instruction_apply_actions");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = true;
            break;
         case "write_actions":
            instrHeaderSchema = protocol.getType("of12.instruction_write_actions_header");
            instrSchema = protocol.getType("of12.ofp_instruction_write_actions");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = true;           
            break;
         case "clear_actions":
            instrHeaderSchema = protocol.getType("of12.instruction_clear_actions_header");
            instrSchema = protocol.getType("of12.ofp_instruction_clear_actions");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = true;           
            break;
         case "goto_table":
            instrHeaderSchema = protocol.getType("of12.instruction_goto_table_header");
            instrSchema = protocol.getType("of12.ofp_instruction_goto_table");
            instrRecord = new GenericData.Record(instrSchema);
            instrRecord.put("table_id", getUint8Fixed((byte)15));
            instrRecord.put("pad", getPad3(0));
            isActions = false;           
            break;
         case "write_metadata":
            instrHeaderSchema = protocol.getType("of12.instruction_write_metadata_header")
            instrSchema = protocol.getType("of12.ofp_instruction_write_metadata");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = false;           
            break;
         case "meter":
            instrHeaderSchema = protocol.getType("of12.instruction_meter_header");
            instrSchema = protocol.getType("of12.ofp_instruction_meter");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = false;           
            break;
         }
        
         GenericRecordBuilder instrHeaderBuilder = new GenericRecordBuilder(instrHeaderSchema);
         instrHeaderRecord = instrHeaderBuilder.build();
         instrRecord.put("header", instrHeaderRecord);
        

         if (isActions) {
            List<Tuple<String, String>> actionList = instruction.getActions().getActions();
//            Iterator<Tuple<String, String>> actionIter = instruction.getActions().getIterator();
            Schema ofpActionSchema = protocol.getType("of12.ofp_action");
            List<GenericRecord> actions = new LinkedList<GenericRecord>();
            GenericRecord actionSetRecord = null;
View Full Code Here

Examples of org.flowforwarding.warp.protocol.ofstructures.OFStructureInstruction.OFStructureInstructionRef

         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

Examples of org.flowforwarding.warp.protocol.ofstructures.OFStructureInstruction.OFStructureInstructionRef

      GenericRecord instrRecord = null;
      for (Tuple<String, OFStructureInstructionRef> tuple : instrList) {
         boolean isActions = false;
         //Tuple<String, OFStructureInstruction> tuple = instrIter.next();
         String name = tuple.getName();
         OFStructureInstructionRef instruction = tuple.getValue();
        
         // TODO Improvs: Replace Switch with a structure... say, HashMap
         // TODO Improvs: How to control type compatibility between Schema types and incoming tlvs?
         switch (name) {
         case "apply_actions":
            instrHeaderSchema = protocol.getType("of13.instruction_apply_actions_header");
            instrSchema = protocol.getType("of13.ofp_instruction_apply_actions");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = true;
            break;
         case "write_actions":
            instrHeaderSchema = protocol.getType("of13.instruction_write_actions_header");
            instrSchema = protocol.getType("of13.ofp_instruction_write_actions");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = true;           
            break;
         case "clear_actions":
            instrHeaderSchema = protocol.getType("of13.instruction_clear_actions_header");
            instrSchema = protocol.getType("of13.ofp_instruction_clear_actions");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = true;           
            break;
         case "goto_table":
            instrHeaderSchema = protocol.getType("of13.instruction_goto_table_header");
            instrSchema = protocol.getType("of13.ofp_instruction_goto_table");
            instrRecord = new GenericData.Record(instrSchema);
            instrRecord.put("table_id", getUint8Fixed((byte)15));
            instrRecord.put("pad", getPad3(0));
            isActions = false;           
            break;
         case "write_metadata":
            instrHeaderSchema = protocol.getType("of13.instruction_write_metadata_header")
            instrSchema = protocol.getType("of13.ofp_instruction_write_metadata");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = false;           
            break;
         case "meter":
            instrHeaderSchema = protocol.getType("of13.instruction_meter_header");
            instrSchema = protocol.getType("of13.ofp_instruction_meter");
            instrRecord = new GenericData.Record(instrSchema);
            isActions = false;           
            break;
         }
        
         GenericRecordBuilder instrHeaderBuilder = new GenericRecordBuilder(instrHeaderSchema);
         instrHeaderRecord = instrHeaderBuilder.build();
         instrRecord.put("header", instrHeaderRecord);
        

         if (isActions) {
            List<Tuple<String, String>> actionList = instruction.getActions().getActions();
//            Iterator<Tuple<String, String>> actionIter = instruction.getActions().getIterator();
            Schema ofpActionSchema = protocol.getType("of13.ofp_action");
            List<GenericRecord> actions = new LinkedList<GenericRecord>();
            GenericRecord actionSetRecord = null;
View Full Code Here

Examples of org.flowforwarding.warp.protocol.ofstructures.OFStructureInstruction.OFStructureInstructionRef

        
         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);
        
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.