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();
}
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();
}
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();
}
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);
}
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());
}
Aggregations