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