Search in sources :

Example 21 with Networks

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.Networks in project netvirt by opendaylight.

the class VxlanGreConntrackBasedSnatService method removeCentralizedRouter.

public boolean removeCentralizedRouter(TypedReadWriteTransaction<Configuration> confTx, Routers routers, Uint64 primarySwitchId, Uint64 dpnId) throws ExecutionException, InterruptedException {
    ProviderTypes extNwProviderType = NatUtil.getProviderTypefromNetworkId(dataBroker, routers.getNetworkId());
    LOG.debug("VxlanGreConntrackBasedSnatService: handleCentralizedRouter ProviderTypes {}", extNwProviderType);
    if (extNwProviderType == ProviderTypes.FLAT || extNwProviderType == ProviderTypes.VLAN) {
        LOG.debug("handleCentralizedRouter : Skip FLAT/VLAN provider networks.");
        return true;
    }
    return super.removeCentralizedRouter(confTx, routers, primarySwitchId, dpnId);
}
Also used : ProviderTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ProviderTypes)

Example 22 with Networks

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.Networks in project netvirt by opendaylight.

the class BgpConfigurationManager method delPrefix.

public void delPrefix(String rd, String pfx) {
    InstanceIdentifier.InstanceIdentifierBuilder<Networks> iib = InstanceIdentifier.builder(Bgp.class).child(NetworksContainer.class).child(Networks.class, new NetworksKey(pfx, rd));
    InstanceIdentifier<Networks> iid = iib.build();
    delete(iid);
}
Also used : Networks(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.Networks) NetworksKey(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.NetworksKey) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) NetworksContainer(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.NetworksContainer)

Example 23 with Networks

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.Networks in project netvirt by opendaylight.

the class QosNeutronUtils method displayQosNetworksMap.

private void displayQosNetworksMap(CommandSession session, Gson gson) {
    session.getConsole().println("\nQos Networks Map");
    String policyId;
    String policyName;
    String networkId;
    String networkName;
    String networkDetails;
    Uuid policyUuid;
    Uuid networkUuid;
    JsonObject jsonObject;
    JsonArray jsonArrayOuter = new JsonArray();
    JsonArray jsonArray;
    for (ConcurrentMap.Entry<Uuid, ConcurrentMap<Uuid, Network>> policyEntry : qosNetworksMap.entrySet()) {
        policyUuid = policyEntry.getKey();
        policyId = policyUuid.getValue();
        policyName = qosPolicyMap.get(policyUuid).getName();
        jsonObject = new JsonObject();
        jsonArray = new JsonArray();
        jsonObject.addProperty("Policy Uuid", policyId);
        jsonObject.addProperty("Policy Name", policyName);
        ConcurrentMap<Uuid, Network> networkInnerMap = qosNetworksMap.get(policyUuid);
        for (ConcurrentMap.Entry<Uuid, Network> networkEntry : networkInnerMap.entrySet()) {
            networkUuid = networkEntry.getKey();
            if (networkUuid != null) {
                networkId = networkInnerMap.get(networkUuid).getUuid().getValue();
                networkName = networkInnerMap.get(networkUuid).getName();
                if (networkName == null) {
                    networkName = "null";
                }
                networkDetails = networkId + " : " + networkName;
                jsonArray.add(networkDetails);
            }
        }
        jsonObject.add("Network Details", jsonArray);
        jsonArrayOuter.add(jsonObject);
    }
    session.getConsole().println(gson.toJson(jsonArrayOuter));
}
Also used : JsonArray(com.google.gson.JsonArray) Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) Network(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network) ConcurrentMap(java.util.concurrent.ConcurrentMap) JsonObject(com.google.gson.JsonObject)

Example 24 with Networks

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.Networks in project netvirt by opendaylight.

the class Ipv6ConfigChangeListener method convertSwitchToControllerMode.

private void convertSwitchToControllerMode(Ipv6serviceConfig updated) {
    List<IVirtualNetwork> networks = ifMgr.getNetworkCache();
    for (IVirtualNetwork network : networks) {
        VirtualNetwork vnet = ifMgr.getNetwork(network.getNetworkUuid());
        VirtualPort routerPort = ifMgr.getRouterV6InterfaceForNetwork(network.getNetworkUuid());
        Collection<VirtualNetwork.DpnInterfaceInfo> dpnIfaceList = vnet.getDpnIfaceList();
        LOG.info("convertSwitchToControllerMode::Network : {} routerPort: {}", network, routerPort);
        final long networkElanTag = ifMgr.getNetworkElanTag(network.getNetworkUuid());
        // check if any VM is booted already before subnet is added to the router
        if (routerPort == null) {
            LOG.warn("convertSwitchToControllerMode:: RouterPort not available for network:{}", vnet.getNetworkUuid());
            continue;
        }
        for (VirtualNetwork.DpnInterfaceInfo dpnIfaceInfo : dpnIfaceList) {
            ifMgr.getNDExecutorService().execute(() -> {
                LOG.info("convertSwitchToControllerMode : Deleting Old flows on Switch Mode");
                ifMgr.checkVmBootBeforeSubnetAddRouter(dpnIfaceInfo, routerPort, networkElanTag, Ipv6ServiceConstants.DEL_FLOW);
                LOG.info("convertSwitchToControllerMode : Installing new flows on Controller Mode");
                MacAddress ifaceMac = MacAddress.getDefaultInstance(routerPort.getMacAddress());
                Ipv6Address llAddr = Ipv6Util.getIpv6LinkLocalAddressFromMac(ifaceMac);
                for (Ipv6Address ndTarget : routerPort.getIpv6Addresses()) {
                    LOG.info("convertSwitchToControllerMode:: Deleting NS punt Flow for : {}", ndTarget.getValue());
                    // TODO del can be removed as key is same for add flows too
                    ifMgr.programIcmpv6NsDefaultPuntFlows(routerPort, ndTarget, Ipv6ServiceConstants.DEL_FLOW);
                    dpnIfaceInfo.clearNdTargetFlowInfo();
                    ifMgr.programIcmpv6NSPuntFlowForAddress(routerPort.getNetworkID(), ndTarget, Ipv6ServiceConstants.ADD_FLOW);
                }
                ifMgr.programIcmpv6NSPuntFlowForAddress(routerPort.getNetworkID(), llAddr, Ipv6ServiceConstants.ADD_FLOW);
            });
        }
    }
}
Also used : IVirtualNetwork(org.opendaylight.netvirt.ipv6service.api.IVirtualNetwork) IVirtualNetwork(org.opendaylight.netvirt.ipv6service.api.IVirtualNetwork) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) Ipv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)

Example 25 with Networks

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.Networks in project netvirt by opendaylight.

the class Ipv6ConfigChangeListener method convertControllerToSwitchMode.

private void convertControllerToSwitchMode(Ipv6serviceConfig updated) {
    List<IVirtualNetwork> networks = ifMgr.getNetworkCache();
    int lportTag;
    for (IVirtualNetwork network : networks) {
        VirtualNetwork vnet = ifMgr.getNetwork(network.getNetworkUuid());
        VirtualPort routerPort = ifMgr.getRouterV6InterfaceForNetwork(network.getNetworkUuid());
        Collection<VirtualNetwork.DpnInterfaceInfo> dpnIfaceList = vnet.getDpnIfaceList();
        LOG.info("convertControllerToSwitchMode:: Network : {} routerPort: {}", network, routerPort);
        final long networkElanTag = ifMgr.getNetworkElanTag(network.getNetworkUuid());
        // check if any VM is booted already before subnet is added to the router
        for (VirtualNetwork.DpnInterfaceInfo dpnIfaceInfo : dpnIfaceList) {
            ifMgr.getNDExecutorService().execute(() -> {
                LOG.info("convertControllerToSwitchMode : Deleting Old flows on Switch Mode");
                for (Ipv6Address ipv6Address : routerPort.getIpv6Addresses()) {
                    LOG.info("convertControllerToSwitchMode:: Deleting NS punt flow for : {}", ipv6Address.getValue());
                    ifMgr.programIcmpv6NSPuntFlowForAddress(network.getNetworkUuid(), ipv6Address, Ipv6ServiceConstants.DEL_FLOW);
                }
                ifMgr.checkVmBootBeforeSubnetAddRouter(dpnIfaceInfo, routerPort, networkElanTag, Ipv6ServiceConstants.ADD_FLOW);
                for (Ipv6Address ndTarget : routerPort.getIpv6Addresses()) {
                    LOG.info("convertControllerToSwitchM0ode:: Installing NS punt Flow for : {}", ndTarget.getValue());
                    ifMgr.programIcmpv6NsDefaultPuntFlows(routerPort, ndTarget, Ipv6ServiceConstants.ADD_FLOW);
                }
            });
        }
    }
}
Also used : IVirtualNetwork(org.opendaylight.netvirt.ipv6service.api.IVirtualNetwork) IVirtualNetwork(org.opendaylight.netvirt.ipv6service.api.IVirtualNetwork) Ipv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)

Aggregations

Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)43 ExecutionException (java.util.concurrent.ExecutionException)19 ArrayList (java.util.ArrayList)16 ProviderTypes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ProviderTypes)14 TransactionCommitFailedException (org.opendaylight.mdsal.common.api.TransactionCommitFailedException)13 ExternalNetworks (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ExternalNetworks)13 Networks (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.external.networks.Networks)13 NetworksKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.external.networks.NetworksKey)11 Uint32 (org.opendaylight.yangtools.yang.common.Uint32)9 BigInteger (java.math.BigInteger)6 Networks (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.Networks)6 NetworksKey (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.networkscontainer.NetworksKey)6 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)5 HashSet (java.util.HashSet)4 NonNull (org.eclipse.jdt.annotation.NonNull)4 AcquireResult (org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.AcquireResult)4 NetworksBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.external.networks.NetworksBuilder)4 InternalToExternalPortMap (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.info.router.ports.ports.InternalToExternalPortMap)4 VpnMap (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.vpnmaps.VpnMap)4 Network (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network)4