X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetworkconfiguration%2Fneutron%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetworkconfig%2Fneutron%2FNeutronSubnet.java;h=f31b045e93da60a50b305b1a51b18db4b7776b61;hp=11a1be21180db9f454cc1817ed55f762429d904d;hb=14f3e1124c15c173bb1d2e7e16043ad4438be81c;hpb=633fd9012d8ff920283da437131b19d8cd3c2330 diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java index 11a1be2118..f31b045e93 100644 --- a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java +++ b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java @@ -1,5 +1,5 @@ /* - * Copyright IBM Corporation, 2013. All rights reserved. + * Copyright IBM Corporation and others, 2013. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -64,6 +64,12 @@ public class NeutronSubnet extends ConfigurationObject implements Serializable { @XmlElement (name="tenant_id") String tenantID; + @XmlElement (name="ipv6_address_mode", nillable=true) + String ipV6AddressMode; + + @XmlElement (name="ipv6_ra_mode", nillable=true) + String ipV6RaMode; + /* stores the OpenStackPorts associated with an instance * used to determine if that instance can be deleted. */ @@ -170,6 +176,14 @@ public class NeutronSubnet extends ConfigurationObject implements Serializable { this.tenantID = tenantID; } + public String getIpV6AddressMode() { return ipV6AddressMode; } + + public void setIpV6AddressMode(String ipV6AddressMode) { this.ipV6AddressMode = ipV6AddressMode; } + + public String getIpV6RaMode() { return ipV6RaMode; } + + public void setIpV6RaMode(String ipV6RaMode) { this.ipV6RaMode = ipV6RaMode; } + /** * This method copies selected fields from the object and returns them * as a new object, suitable for marshaling. @@ -224,6 +238,12 @@ public class NeutronSubnet extends ConfigurationObject implements Serializable { if (s.equals("tenant_id")) { ans.setTenantID(this.getTenantID()); } + if (s.equals("ipv6_address_mode")) { + ans.setIpV6AddressMode(this.getIpV6AddressMode()); + } + if (s.equals("ipv6_ra_mode")) { + ans.setIpV6RaMode(this.getIpV6RaMode()); + } } return ans; } @@ -269,22 +289,26 @@ public class NeutronSubnet extends ConfigurationObject implements Serializable { } gatewayIPAssigned = false; dnsNameservers = new ArrayList(); - allocationPools = new ArrayList(); - hostRoutes = new ArrayList(); - try { - SubnetUtils util = new SubnetUtils(cidr); - SubnetInfo info = util.getInfo(); - if (gatewayIP == null) { - gatewayIP = info.getLowAddress(); - } - if (allocationPools.size() < 1) { - NeutronSubnet_IPAllocationPool source = - new NeutronSubnet_IPAllocationPool(info.getLowAddress(), - info.getHighAddress()); - allocationPools = source.splitPool(gatewayIP); + if (hostRoutes == null) { + hostRoutes = new ArrayList(); + } + if (allocationPools == null) { + allocationPools = new ArrayList(); + try { + SubnetUtils util = new SubnetUtils(cidr); + SubnetInfo info = util.getInfo(); + if (gatewayIP == null || ("").equals(gatewayIP)) { + gatewayIP = info.getLowAddress(); + } + if (allocationPools.size() < 1) { + NeutronSubnet_IPAllocationPool source = + new NeutronSubnet_IPAllocationPool(info.getLowAddress(), + info.getHighAddress()); + allocationPools = source.splitPool(gatewayIP); + } + } catch (Exception e) { + return false; } - } catch (Exception e) { - return false; } return true; } @@ -440,6 +464,7 @@ public class NeutronSubnet extends ConfigurationObject implements Serializable { + ", ipVersion=" + ipVersion + ", cidr=" + cidr + ", gatewayIP=" + gatewayIP + ", dnsNameservers=" + dnsNameservers + ", allocationPools=" + allocationPools + ", hostRoutes=" + hostRoutes + ", enableDHCP=" + enableDHCP + ", tenantID=" + tenantID + ", myPorts=" + myPorts - + ", gatewayIPAssigned=" + gatewayIPAssigned + "]"; + + ", gatewayIPAssigned=" + gatewayIPAssigned + ", ipv6AddressMode=" + ipV6AddressMode + + ", ipv6RaMode=" + ipV6RaMode + "]"; } }