use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction in project netvirt by opendaylight.
the class VPNServiceChainHandler method bindScfOnVpnInterface.
public void bindScfOnVpnInterface(String ifName, int scfTag) {
LOG.debug("bind SCF tag {} on iface {}", scfTag, ifName);
if (isServiceBoundOnInterface(NwConstants.SCF_SERVICE_INDEX, ifName)) {
LOG.info("SCF is already bound on Interface {} for Ingress. Binding aborted", ifName);
return;
}
Action loadReg2Action = new ActionRegLoad(1, NxmNxReg2.class, 0, 31, scfTag).buildAction();
List<Instruction> instructions = Arrays.asList(MDSALUtil.buildApplyActionsInstruction(Collections.singletonList(loadReg2Action)), MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.SCF_DOWN_SUB_FILTER_TCP_BASED_TABLE, 1));
BoundServices boundServices = InterfaceServiceUtil.getBoundServices(ifName, NwConstants.SCF_SERVICE_INDEX, CloudServiceChainConstants.DEFAULT_SCF_FLOW_PRIORITY, CloudServiceChainConstants.COOKIE_SCF_BASE, instructions);
interfaceManager.bindService(ifName, ServiceModeIngress.class, boundServices);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction in project netvirt by opendaylight.
the class QosNeutronUtils method bindservice.
public void bindservice(String ifName) {
int priority = QosConstants.QOS_DEFAULT_FLOW_PRIORITY;
int instructionKey = 0;
List<Instruction> instructions = new ArrayList<>();
instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.QOS_DSCP_TABLE, ++instructionKey));
short qosServiceIndex = ServiceIndex.getIndex(NwConstants.QOS_SERVICE_NAME, NwConstants.QOS_SERVICE_INDEX);
BoundServices serviceInfo = getBoundServices(String.format("%s.%s", "qos", ifName), qosServiceIndex, priority, NwConstants.COOKIE_QOS_TABLE, instructions);
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, buildServiceId(ifName, qosServiceIndex), serviceInfo);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction in project netvirt by opendaylight.
the class TunnelStateChangeListener method bindService.
private void bindService(String tunnelInterfaceName) {
coordinator.enqueueJob(tunnelInterfaceName, () -> {
LOG.info("Bind egress policy service on tunnel {}", tunnelInterfaceName);
List<Instruction> instructions = Collections.singletonList(MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.EGRESS_POLICY_CLASSIFIER_TABLE, 0));
BoundServices boundServices = getBoundServices(tunnelInterfaceName, instructions);
interfaceManager.bindService(tunnelInterfaceName, ServiceModeEgress.class, boundServices);
return null;
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createAppyActionInstruction16.
private static InstructionsBuilder createAppyActionInstruction16() {
ActionBuilder ab = new ActionBuilder();
GroupActionBuilder groupActionB = new GroupActionBuilder();
groupActionB.setGroupId(1L);
groupActionB.setGroup("0");
ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createDropInstructions.
private static InstructionsBuilder createDropInstructions() {
DropActionBuilder dab = new DropActionBuilder();
DropAction dropAction = dab.build();
ActionBuilder ab = new ActionBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
// Add our drop action to a list
List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
Aggregations