Search in sources :

Example 61 with InstructionsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder in project netvirt by opendaylight.

the class OpenFlow13Provider method createEgressClassifierTransportEgressLocalFlow.

/*
     * Egress Classifier TransportEgress Local Flow
     *     Final egress processing and egress packets. Resubmit to Ingress
     *     Dispatcher to be processed by SFC SFF on match
     */
public Flow createEgressClassifierTransportEgressLocalFlow(NodeId nodeId, long nsp) {
    MatchBuilder match = OpenFlow13Utils.getNspMatch(nsp);
    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.SFC_TRANSPORT_INGRESS_TABLE, actionList.size()));
    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    String flowIdStr = EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;
    return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE, EGRESS_CLASSIFIER_EGRESS_LOCAL_PRIORITY, EGRESS_CLASSIFIER_TPORTEGRESS_COOKIE, EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME, flowIdStr, match, isb).build();
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) ArrayList(java.util.ArrayList) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder)

Example 62 with InstructionsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder in project netvirt by opendaylight.

the class OpenFlow13Provider method createIngressClassifierAclNoMatchFlow.

/*
     * Ingress Classifier ACL NoMatch flow:
     *     If there are no ACL classification matches, then resubmit back to
     *     the Ingress Dispatcher to let other services handle the packet.
     */
public Flow createIngressClassifierAclNoMatchFlow(NodeId nodeId) {
    // This is a MatchAny flow
    MatchBuilder match = new MatchBuilder();
    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE, actionList.size()));
    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    String flowIdStr = INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue();
    return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE, INGRESS_CLASSIFIER_ACL_NOMATCH_PRIORITY, INGRESS_CLASSIFIER_ACL_COOKIE, INGRESS_CLASSIFIER_ACL_FLOW_NAME, flowIdStr, match, isb).build();
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) ArrayList(java.util.ArrayList) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder)

Example 63 with InstructionsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder in project netvirt by opendaylight.

the class ElanServiceTestBase method getSortedActions.

Flow getSortedActions(Flow flow) {
    FlowBuilder flowBuilder = new FlowBuilder(flow);
    Instructions instructions = flowBuilder.getInstructions();
    InstructionsBuilder builder = new InstructionsBuilder();
    InstructionBuilder instructionBuilder = new InstructionBuilder(instructions.getInstruction().get(0));
    instructionBuilder.setInstruction(sortActions(instructionBuilder.getInstruction()));
    builder.setInstruction(Lists.newArrayList(instructionBuilder.build()));
    return flowBuilder.setInstructions(builder.build()).build();
}
Also used : InstructionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder) FlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder) Instructions(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder)

Example 64 with InstructionsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder in project netvirt by opendaylight.

the class GeniusProvider method bindService.

private void bindService(InstanceIdentifier<BoundServices> id, short serviceId, String serviceName, int servicePriority, short serviceDestTable, BigInteger serviceTableCookie, List<Action> extraActions) {
    InstructionsBuilder isb = extraActions.isEmpty() ? new InstructionsBuilder() : OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(extraActions);
    isb = OpenFlow13Utils.appendGotoTableInstruction(isb, serviceDestTable);
    StypeOpenflow stypeOpenflow = new StypeOpenflowBuilder().setFlowCookie(serviceTableCookie).setFlowPriority(servicePriority).setInstruction(isb.build().getInstruction()).build();
    BoundServices boundServices = new BoundServicesBuilder().setServiceName(serviceName).setServicePriority(serviceId).setServiceType(ServiceTypeFlowBased.class).addAugmentation(StypeOpenflow.class, stypeOpenflow).build();
    LOG.info("Binding Service ID [{}] name [{}] priority [{}] table [{}] cookie [{}] extraActions [{}]", serviceId, serviceName, servicePriority, serviceDestTable, serviceTableCookie, extraActions);
    MDSALUtil.syncWrite(this.dataBroker, LogicalDatastoreType.CONFIGURATION, id, boundServices);
}
Also used : BoundServices(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices) StypeOpenflowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflowBuilder) StypeOpenflow(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflow) BoundServicesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesBuilder) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder)

Example 65 with InstructionsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder in project openflowplugin by opendaylight.

the class TableFeaturesConvertorTest method setupTest.

@Before
public void setupTest() {
    setupInstructionsList();
    setupActions();
    setupFieldTableFeatures();
    InstructionsBuilder instructionsBuilder = new InstructionsBuilder();
    List<Instruction> instructions = new ArrayList<>();
    for (int i = 0; i < INSTRUCTIONS_LIST.size(); i++) {
        InstructionBuilder instructionBuilder = new InstructionBuilder();
        instructionBuilder.setInstruction(INSTRUCTIONS_LIST.get(i));
        instructions.add(instructionBuilder.build());
    }
    org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.InstructionsBuilder instructionsBuilder1 = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.InstructionsBuilder();
    instructionsBuilder1.setInstruction(instructions);
    instructionsBuilder.setInstructions(instructionsBuilder1.build());
    AUGMENTATIONS_MAP.put(Instructions.class, instructionsBuilder.build());
    InstructionsMissBuilder instructionsMissBuilder = new InstructionsMissBuilder();
    org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMissBuilder instructionsMissBuilder1 = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMissBuilder();
    instructionsMissBuilder1.setInstruction(instructions);
    instructionsMissBuilder.setInstructionsMiss(instructionsMissBuilder1.build());
    AUGMENTATIONS_MAP.put(InstructionsMiss.class, instructionsMissBuilder.build());
    NextTableBuilder nextTableBuilder = new NextTableBuilder();
    AUGMENTATIONS_MAP.put(NextTable.class, nextTableBuilder.build());
    NextTableMissBuilder nextTableMissBuilder = new NextTableMissBuilder();
    AUGMENTATIONS_MAP.put(NextTableMiss.class, nextTableMissBuilder.build());
    WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
    AUGMENTATIONS_MAP.put(WriteActions.class, writeActionsBuilder.build());
    WriteActionsMissBuilder writeActionsMissBuilder = new WriteActionsMissBuilder();
    AUGMENTATIONS_MAP.put(WriteActionsMiss.class, writeActionsMissBuilder.build());
    ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
    AUGMENTATIONS_MAP.put(ApplyActions.class, applyActionsBuilder.build());
    ApplyActionsMissBuilder applyActionsMissBuilder = new ApplyActionsMissBuilder();
    org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.miss.ApplyActionsMissBuilder applyActionsMissBuilder1 = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.miss.ApplyActionsMissBuilder();
    applyActionsMissBuilder1.setAction(ACTIONS);
    applyActionsMissBuilder.setApplyActionsMiss(applyActionsMissBuilder1.build());
    AUGMENTATIONS_MAP.put(ApplyActionsMiss.class, applyActionsMissBuilder.build());
    MatchBuilder matchBuilder = new MatchBuilder();
    AUGMENTATIONS_MAP.put(Match.class, matchBuilder.build());
    WildcardsBuilder wildcardsBuilder = new WildcardsBuilder();
    AUGMENTATIONS_MAP.put(Wildcards.class, wildcardsBuilder.build());
    WriteSetfieldBuilder writeSetfieldBuilder = new WriteSetfieldBuilder();
    AUGMENTATIONS_MAP.put(WriteSetfield.class, writeSetfieldBuilder.build());
    WriteSetfieldMissBuilder writeSetfieldMissBuilder = new WriteSetfieldMissBuilder();
    AUGMENTATIONS_MAP.put(WriteSetfieldMiss.class, writeSetfieldMissBuilder.build());
    ApplySetfieldBuilder applySetfieldBuilder = new ApplySetfieldBuilder();
    org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder1 = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder();
    applySetfieldBuilder1.setSetFieldMatch(FIELD_TABLE_FEATURES);
    applySetfieldBuilder.setApplySetfield(applySetfieldBuilder1.build());
    AUGMENTATIONS_MAP.put(ApplySetfield.class, applySetfieldBuilder.build());
    ApplySetfieldMissBuilder applySetfieldMissBuilder = new ApplySetfieldMissBuilder();
    AUGMENTATIONS_MAP.put(ApplySetfieldMiss.class, applySetfieldMissBuilder.build());
}
Also used : InstructionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder) ApplyActionsMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder) ApplySetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder) ArrayList(java.util.ArrayList) Instruction(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder) WildcardsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WildcardsBuilder) ApplyActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder) WriteActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder) ApplySetfieldMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder) WriteSetfieldMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder) InstructionsMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder) NextTableMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMissBuilder) WriteActionsMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder) WriteSetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder) NextTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder) SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) Before(org.junit.Before)

Aggregations

InstructionsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder)121 ArrayList (java.util.ArrayList)114 InstructionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder)106 Instruction (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction)102 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)101 ApplyActionsCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder)95 ApplyActionsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder)94 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder)89 DropActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder)82 GroupActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder)82 ControllerActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.controller.action._case.ControllerActionBuilder)81 DropAction (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropAction)81 PushMplsActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.mpls.action._case.PushMplsActionBuilder)81 PushPbbActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.pbb.action._case.PushPbbActionBuilder)81 SetVlanIdActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder)81 OutputActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder)77 FloodAllActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.all.action._case.FloodAllActionBuilder)74 SetDlSrcActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder)74 SetNwDstActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder)74 SetNwSrcActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder)74