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 DhcpServiceUtils method bindDhcpService.
public static void bindDhcpService(String interfaceName, short tableId, WriteTransaction tx) {
int instructionKey = 0;
List<Instruction> instructions = new ArrayList<>();
instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(tableId, ++instructionKey));
short serviceIndex = ServiceIndex.getIndex(NwConstants.DHCP_SERVICE_NAME, NwConstants.DHCP_SERVICE_INDEX);
BoundServices serviceInfo = getBoundServices(String.format("%s.%s", "dhcp", interfaceName), serviceIndex, DhcpMConstants.DEFAULT_FLOW_PRIORITY, DhcpMConstants.COOKIE_VM_INGRESS_TABLE, instructions);
tx.put(LogicalDatastoreType.CONFIGURATION, buildServiceId(interfaceName, serviceIndex), serviceInfo, WriteTransaction.CREATE_MISSING_PARENTS);
}
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 IngressCountersServiceImpl method bind.
@Override
public void bind(String interfaceId) {
int instructionKey = 0;
List<Instruction> instructions = new ArrayList<>();
instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.INGRESS_COUNTERS_TABLE, ++instructionKey));
BoundServices serviceInfo = CountersServiceUtils.getBoundServices(String.format("%s.%s", "counters-ingress", interfaceId), CountersServiceUtils.INGRESS_COUNTERS_SERVICE_INDEX, CountersServiceUtils.INGRESS_COUNTERS_DEFAULT_FLOW_PRIORITY, CountersServiceUtils.COOKIE_COUNTERS_BASE, instructions);
InstanceIdentifier<BoundServices> serviceId = CountersServiceUtils.buildServiceId(interfaceId, CountersServiceUtils.INGRESS_COUNTERS_SERVICE_INDEX, ServiceModeIngress.class);
MDSALUtil.syncWrite(db, LogicalDatastoreType.CONFIGURATION, serviceId, serviceInfo);
}
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 VPNServiceChainHandler method unbindScfOnVpnInterface.
public void unbindScfOnVpnInterface(String ifName) {
BoundServices boundService = InterfaceServiceUtil.getBoundServices(ifName, NwConstants.SCF_SERVICE_INDEX, CloudServiceChainConstants.DEFAULT_SCF_FLOW_PRIORITY, CloudServiceChainConstants.COOKIE_SCF_BASE, /*instructions*/
Collections.emptyList());
interfaceManager.unbindService(ifName, ServiceModeIngress.class, boundService);
}
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 Ipv6ServiceUtils method bindIpv6Service.
public void bindIpv6Service(String interfaceName, Long elanTag, short tableId) {
int instructionKey = 0;
List<Instruction> instructions = new ArrayList<>();
instructions.add(MDSALUtil.buildAndGetWriteMetadaInstruction(MetaDataUtil.getElanTagMetadata(elanTag), MetaDataUtil.METADATA_MASK_SERVICE, ++instructionKey));
instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(tableId, ++instructionKey));
short serviceIndex = ServiceIndex.getIndex(NwConstants.IPV6_SERVICE_NAME, NwConstants.IPV6_SERVICE_INDEX);
BoundServices serviceInfo = getBoundServices(String.format("%s.%s", "ipv6", interfaceName), serviceIndex, Ipv6Constants.DEFAULT_FLOW_PRIORITY, NwConstants.COOKIE_IPV6_TABLE, instructions);
MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, buildServiceId(interfaceName, serviceIndex), serviceInfo);
}
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 EgressAclServiceImpl method bindService.
/**
* Bind service.
*
* @param aclInterface the acl interface
*/
@Override
public void bindService(AclInterface aclInterface) {
String interfaceName = aclInterface.getInterfaceId();
jobCoordinator.enqueueJob(interfaceName, () -> {
int instructionKey = 0;
List<Instruction> instructions = new ArrayList<>();
instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(getAclAntiSpoofingTable(), ++instructionKey));
short serviceIndex = ServiceIndex.getIndex(AclConstants.INGRESS_ACL_SERVICE_NAME, AclConstants.INGRESS_ACL_SERVICE_INDEX);
int flowPriority = AclConstants.INGRESS_ACL_SERVICE_INDEX;
BoundServices serviceInfo = AclServiceUtils.getBoundServices(String.format("%s.%s.%s", "acl", "ingressacl", interfaceName), serviceIndex, flowPriority, AclConstants.COOKIE_ACL_BASE, instructions);
InstanceIdentifier<BoundServices> path = AclServiceUtils.buildServiceId(interfaceName, serviceIndex, serviceMode);
return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.CONFIGURATION, path, serviceInfo, WriteTransaction.CREATE_MISSING_PARENTS)));
});
}
Aggregations