use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices in project netvirt by opendaylight.
the class GeniusProvider method getBindServiceId.
public InstanceIdentifier<BoundServices> getBindServiceId(short serviceId, String interfaceName, boolean isIngress) {
ServicesInfoKey servicesInfoKey = isIngress ? new ServicesInfoKey(interfaceName, ServiceModeIngress.class) : new ServicesInfoKey(interfaceName, ServiceModeEgress.class);
InstanceIdentifier<BoundServices> id = InstanceIdentifier.builder(ServiceBindings.class).child(ServicesInfo.class, servicesInfoKey).child(BoundServices.class, new BoundServicesKey(serviceId)).build();
return id;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices in project netvirt by opendaylight.
the class TunnelStateChangeListener method unbindService.
private void unbindService(String tunnelInterfaceName) {
coordinator.enqueueJob(tunnelInterfaceName, () -> {
LOG.info("Unbind egress policy service on tunnel {}", tunnelInterfaceName);
BoundServices boundServices = getBoundServices(tunnelInterfaceName, Collections.emptyList());
interfaceManager.unbindService(tunnelInterfaceName, ServiceModeEgress.class, boundServices);
return null;
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices 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.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices in project genius by opendaylight.
the class FlowBasedEgressServicesStateBindHelper method bindServicesOnInterface.
@Override
public void bindServicesOnInterface(WriteTransaction tx, List<BoundServices> allServices, Interface ifState) {
LOG.info("bind all egress services for interface: {}", ifState.getName());
NodeConnectorId nodeConnectorId = FlowBasedServicesUtils.getNodeConnectorIdFromInterface(ifState);
BigInteger dpId = IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId);
allServices.sort(Comparator.comparing(BoundServices::getServicePriority));
BoundServices highestPriority = allServices.remove(0);
short nextServiceIndex = (short) (allServices.size() > 0 ? allServices.get(0).getServicePriority() : highestPriority.getServicePriority() + 1);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface = interfaceManagerCommonUtils.getInterfaceFromConfigDS(ifState.getName());
FlowBasedServicesUtils.installEgressDispatcherFlows(dpId, highestPriority, ifState.getName(), tx, ifState.getIfIndex(), NwConstants.DEFAULT_SERVICE_INDEX, nextServiceIndex, iface);
BoundServices prev = null;
for (BoundServices boundService : allServices) {
if (prev != null) {
FlowBasedServicesUtils.installEgressDispatcherFlows(dpId, prev, ifState.getName(), tx, ifState.getIfIndex(), prev.getServicePriority(), boundService.getServicePriority(), iface);
}
prev = boundService;
}
if (prev != null) {
FlowBasedServicesUtils.installEgressDispatcherFlows(dpId, prev, ifState.getName(), tx, ifState.getIfIndex(), prev.getServicePriority(), (short) (prev.getServicePriority() + 1), iface);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices in project genius by opendaylight.
the class FlowBasedServicesUtils method bindDefaultEgressDispatcherService.
public static ListenableFuture<Void> bindDefaultEgressDispatcherService(ManagedNewTransactionRunner txRunner, String interfaceName, List<Instruction> instructions) {
return txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
int priority = ServiceIndex.getIndex(NwConstants.DEFAULT_EGRESS_SERVICE_NAME, NwConstants.DEFAULT_EGRESS_SERVICE_INDEX);
BoundServices serviceInfo = getBoundServices(String.format("%s.%s", "default", interfaceName), ServiceIndex.getIndex(NwConstants.DEFAULT_EGRESS_SERVICE_NAME, NwConstants.DEFAULT_EGRESS_SERVICE_INDEX), priority, NwConstants.EGRESS_DISPATCHER_TABLE_COOKIE, instructions);
IfmUtil.bindService(tx, interfaceName, serviceInfo, ServiceModeEgress.class);
});
}
Aggregations