import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
import neutron-attrs { prefix "attrs"; }
import neutron-constants { prefix "constants"; }
+ import neutron-types { prefix "types"; }
organization "OpenDaylight Neutron Group";
is already allowed to pass through the port";
key "mac-address ip-address";
leaf mac-address {
- type string;
+ type yang:mac-address;
}
leaf ip-address {
- type string;
+ type types:ip-prefix-or-address;
}
}
type string;
}
leaf mac-address {
- type string;
+ type yang:mac-address;
}
- leaf binding-profile {
- type string;
- }
-
list fixed-ips {
- key subnet-id;
+ key "subnet-id ip-address";
leaf subnet-id {
type yang:uuid;
}
*/
boolean updatePort(String uuid, NeutronPort delta);
-
- /**
- * Applications call this interface method to see if a MAC address is in use
- *
- * @param macAddress
- * mac Address to be tested
- * @return boolean on whether the macAddress is already associated with a
- * port or not
- *
- * @deprecated - will be removed in Boron
- */
-
- boolean macInUse(String macAddress);
-
- /**
- * Applications call this interface method to retrieve the port associated with
- * the gateway address of a subnet
- *
- * @param subnetUUID
- * identifier of the subnet
- * @return OpenStackPorts object if the port exists and null if it does not
- *
- * @deprecated - will be removed in Boron
- */
-
- NeutronPort getGatewayPort(String subnetUUID);
}
public NeutronPort() {
}
- @Deprecated
- public String getPortUUID() {
- return getID();
- }
-
- @Deprecated
- public void setPortUUID(String uuid) {
- setID(uuid);
- }
-
public String getNetworkUUID() {
return networkUUID;
}
if ("id".equals(field)) {
ans.setID(this.getID());
}
+ if ("tenant_id".equals(field)) {
+ ans.setTenantID(this.getTenantID());
+ }
if ("network_id".equals(field)) {
ans.setNetworkUUID(this.getNetworkUUID());
}
if ("device_owner".equals(field)) {
ans.setDeviceOwner(this.getDeviceOwner());
}
- if ("tenant_id".equals(field)) {
- ans.setTenantID(this.getTenantID());
- }
if ("security_groups".equals(field)) {
ans.setSecurityGroups(new ArrayList<NeutronSecurityGroup>(this.getSecurityGroups()));
}
+ if ("allowed_address_pairs".equals(field)) {
+ ans.setAllowedAddressPairs(new ArrayList<NeutronPort_AllowedAddressPairs>(this.getAllowedAddressPairs()));
+ }
+ if ("binding:host_id".equals(field)) {
+ ans.setBindinghostID(this.getBindinghostID());
+ }
+ if ("binding:vnic_type".equals(field)) {
+ ans.setBindingvnicType(this.getBindingvnicType());
+ }
+ if ("binding:vif_type".equals(field)) {
+ ans.setBindingvifType(this.getBindingvifType());
+ }
+ if ("binding:vif_details".equals(field)) {
+ ans.setVIFDetail(new ArrayList<NeutronPort_VIFDetail>(this.getVIFDetail()));
+ }
+ if ("extra_dhcp_opts".equals(field)) {
+ ans.setExtraDHCPOptions(new ArrayList<NeutronPort_ExtraDHCPOption>(this.getExtraDHCPOptions()));
+ }
if ("port_security_enabled".equals(field)) {
ans.setPortSecurityEnabled(this.getPortSecurityEnabled());
}
+ ", adminStateUp=" + adminStateUp + ", status=" + status + ", macAddress=" + macAddress
+ ", fixedIPs=" + fixedIPs + ", deviceID=" + deviceID + ", deviceOwner=" + deviceOwner + ", tenantID="
+ tenantID + ", securityGroups=" + securityGroups
+ + ", allowedAddressPairs" + allowedAddressPairs
+ ", bindinghostID=" + bindinghostID + ", bindingvnicType=" + bindingvnicType
- + ", bindingvnicType=" + bindingvnicType + ", portSecurityEnabled=" + portSecurityEnabled +"]";
+ + ", bindingvifType=" + bindingvifType
+ + ", vifDetails=" + vifDetails
+ + ", extraDHCPOptions=" + extraDHCPOptions
+ + ", portSecurityEnabled=" + portSecurityEnabled +"]";
}
}
import org.opendaylight.neutron.spi.NeutronSecurityGroup;
import org.opendaylight.neutron.spi.Neutron_IPs;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.binding.rev150712.binding.attributes.VifDetails;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.binding.rev150712.binding.attributes.VifDetailsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150712.PortSecurityExtension;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150712.PortSecurityExtensionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.types.rev160517.IpPrefixOrAddress;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
return update(uuid, delta);
}
- // @deprecated, will be removed in Boron
- @Override
- public boolean macInUse(String macAddress) {
- return false;
- }
-
- // @deprecated, will be removed in Boron
- @Override
- public NeutronPort getGatewayPort(String subnetUUID) {
- return null;
- }
-
@Override
protected InstanceIdentifier<Port> createInstanceIdentifier(Port port) {
return InstanceIdentifier.create(Neutron.class)
final List<NeutronPort_AllowedAddressPairs> pairs = new ArrayList<NeutronPort_AllowedAddressPairs>();
for (final AllowedAddressPairs mdPair : port.getAllowedAddressPairs()) {
final NeutronPort_AllowedAddressPairs pair = new NeutronPort_AllowedAddressPairs();
- pair.setIpAddress(mdPair.getIpAddress());
- pair.setMacAddress(mdPair.getMacAddress());
+ pair.setIpAddress(mdPair.getIpAddress().getValue().toString());
+ pair.setMacAddress(mdPair.getMacAddress().getValue());
pairs.add(pair);
}
result.setAllowedAddressPairs(pairs);
}
result.setFixedIPs(ips);
}
- result.setMacAddress(port.getMacAddress());
+ result.setMacAddress(port.getMacAddress().getValue());
result.setName(port.getName());
result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue()));
if (port.getSecurityGroups() != null) {
final List<AllowedAddressPairs> listAllowedAddressPairs = new ArrayList<AllowedAddressPairs>();
for (final NeutronPort_AllowedAddressPairs allowedAddressPairs : neutronPort.getAllowedAddressPairs()) {
final AllowedAddressPairsBuilder allowedAddressPairsBuilder = new AllowedAddressPairsBuilder();
- allowedAddressPairsBuilder.setIpAddress(allowedAddressPairs.getIpAddress());
- allowedAddressPairsBuilder.setMacAddress(allowedAddressPairs.getMacAddress());
+ allowedAddressPairsBuilder.setIpAddress(new IpPrefixOrAddress(allowedAddressPairs.getIpAddress().toCharArray()));
+ allowedAddressPairsBuilder.setMacAddress(new MacAddress(allowedAddressPairs.getMacAddress()));
listAllowedAddressPairs.add(allowedAddressPairsBuilder.build());
}
portBuilder.setAllowedAddressPairs(listAllowedAddressPairs);
portBuilder.setFixedIps(listNeutronIPs);
}
if (neutronPort.getMacAddress() != null) {
- portBuilder.setMacAddress(neutronPort.getMacAddress());
+ portBuilder.setMacAddress(new MacAddress(neutronPort.getMacAddress()));
}
if (neutronPort.getName() != null) {
portBuilder.setName(neutronPort.getName());