renamed VLAN, IP, and MACAddress classes
Change-Id: Ib4df413db1f3d9ee96213fc487519536d7993c5b
diff --git a/core/api/src/main/java/org/onlab/onos/net/DefaultHost.java b/core/api/src/main/java/org/onlab/onos/net/DefaultHost.java
index f1ec27e..ed26e14 100644
--- a/core/api/src/main/java/org/onlab/onos/net/DefaultHost.java
+++ b/core/api/src/main/java/org/onlab/onos/net/DefaultHost.java
@@ -8,27 +8,27 @@
import java.util.Set;
import org.onlab.onos.net.provider.ProviderId;
-import org.onlab.packet.IPAddress;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
/**
* A basic implementation of a Host.
*/
public class DefaultHost extends AbstractElement implements Host {
- private final MACAddress mac;
- private final VLANID vlan;
+ private final MacAddress mac;
+ private final VlanId vlan;
private final HostLocation location;
- private final Set<IPAddress> ips;
+ private final Set<IpAddress> ips;
- public DefaultHost(ProviderId providerId, HostId id, MACAddress mac,
- VLANID vlan, HostLocation loc, Set<IPAddress> ips) {
+ public DefaultHost(ProviderId providerId, HostId id, MacAddress mac,
+ VlanId vlan, HostLocation loc, Set<IpAddress> ips) {
super(providerId, id);
this.mac = mac;
this.vlan = vlan;
this.location = loc;
- this.ips = new HashSet<IPAddress>(ips);
+ this.ips = new HashSet<IpAddress>(ips);
}
@Override
@@ -37,12 +37,12 @@
}
@Override
- public MACAddress mac() {
+ public MacAddress mac() {
return mac;
}
@Override
- public Set<IPAddress> ipAddresses() {
+ public Set<IpAddress> ipAddresses() {
return Collections.unmodifiableSet(ips);
}
@@ -52,7 +52,7 @@
}
@Override
- public VLANID vlan() {
+ public VlanId vlan() {
return vlan;
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/Host.java b/core/api/src/main/java/org/onlab/onos/net/Host.java
index b56c2f9..9d08591 100644
--- a/core/api/src/main/java/org/onlab/onos/net/Host.java
+++ b/core/api/src/main/java/org/onlab/onos/net/Host.java
@@ -1,8 +1,8 @@
package org.onlab.onos.net;
-import org.onlab.packet.IPAddress;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
import java.util.Set;
@@ -24,21 +24,21 @@
*
* @return mac address
*/
- MACAddress mac();
+ MacAddress mac();
/**
* Returns the VLAN ID tied to this host.
*
* @return VLAN ID value
*/
- VLANID vlan();
+ VlanId vlan();
/**
* Returns set of IP addresses currently bound to the host MAC address.
*
* @return set of IP addresses; empty if no IP address is bound
*/
- Set<IPAddress> ipAddresses();
+ Set<IpAddress> ipAddresses();
/**
* Returns the most recent host location where the host attaches to the
diff --git a/core/api/src/main/java/org/onlab/onos/net/HostId.java b/core/api/src/main/java/org/onlab/onos/net/HostId.java
index c6ba53f..1768f24 100644
--- a/core/api/src/main/java/org/onlab/onos/net/HostId.java
+++ b/core/api/src/main/java/org/onlab/onos/net/HostId.java
@@ -1,7 +1,7 @@
package org.onlab.onos.net;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
import java.net.URI;
@@ -42,7 +42,7 @@
* @param vlanId vlan identifier
* @return host identifier
*/
- public static HostId hostId(MACAddress mac, VLANID vlanId) {
+ public static HostId hostId(MacAddress mac, VlanId vlanId) {
// FIXME: use more efficient means of encoding
return hostId("nic" + ":" + mac + "-" + vlanId);
}
@@ -53,8 +53,8 @@
* @param mac mac address
* @return host identifier
*/
- public static HostId hostId(MACAddress mac) {
- return hostId(mac, VLANID.vlanId(VLANID.UNTAGGED));
+ public static HostId hostId(MacAddress mac) {
+ return hostId(mac, VlanId.vlanId(VlanId.UNTAGGED));
}
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java b/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
index 24c49bb..c7c2fc8 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
@@ -2,9 +2,9 @@
import org.onlab.onos.net.PortNumber;
import org.onlab.onos.net.flow.criteria.Criterion.Type;
-import org.onlab.packet.IPAddress;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
/**
* Factory class to create various traffic selection criteria.
@@ -34,7 +34,7 @@
* @param macValue MAC address value or wildcard mask
* @return match criterion
*/
- public static Criterion matchEthSrc(MACAddress mac) {
+ public static Criterion matchEthSrc(MacAddress mac) {
return new EthCriterion(mac, Type.ETH_SRC);
}
@@ -45,7 +45,7 @@
* @param macValue MAC address value or wildcard mask
* @return match criterion
*/
- public static Criterion matchEthDst(MACAddress mac) {
+ public static Criterion matchEthDst(MacAddress mac) {
return new EthCriterion(mac, Type.ETH_DST);
}
@@ -65,7 +65,7 @@
* @param vlanId vlan id value
* @return match criterion
*/
- public static Criterion matchVlanId(VLANID vlanId) {
+ public static Criterion matchVlanId(VlanId vlanId) {
return new VlanIdCriterion(vlanId);
}
@@ -95,7 +95,7 @@
* @param ip ip src value
* @return match criterion
*/
- public static Criterion matchIPSrc(IPAddress ip) {
+ public static Criterion matchIPSrc(IpAddress ip) {
return new IPCriterion(ip, Type.IPV4_SRC);
}
@@ -105,7 +105,7 @@
* @param ip ip src value
* @return match criterion
*/
- public static Criterion matchIPDst(IPAddress ip) {
+ public static Criterion matchIPDst(IpAddress ip) {
return new IPCriterion(ip, Type.IPV4_DST);
}
@@ -133,10 +133,10 @@
public static final class EthCriterion implements Criterion {
- private final MACAddress mac;
+ private final MacAddress mac;
private final Type type;
- public EthCriterion(MACAddress mac, Type type) {
+ public EthCriterion(MacAddress mac, Type type) {
this.mac = mac;
this.type = type;
}
@@ -146,7 +146,7 @@
return this.type;
}
- public MACAddress mac() {
+ public MacAddress mac() {
return this.mac;
}
}
@@ -173,10 +173,10 @@
public static final class IPCriterion implements Criterion {
- private final IPAddress ip;
+ private final IpAddress ip;
private final Type type;
- public IPCriterion(IPAddress ip, Type type) {
+ public IPCriterion(IpAddress ip, Type type) {
this.ip = ip;
this.type = type;
}
@@ -186,7 +186,7 @@
return this.type;
}
- public IPAddress ip() {
+ public IpAddress ip() {
return this.ip;
}
@@ -237,9 +237,9 @@
public static final class VlanIdCriterion implements Criterion {
- private final VLANID vlanId;
+ private final VlanId vlanId;
- public VlanIdCriterion(VLANID vlanId) {
+ public VlanIdCriterion(VlanId vlanId) {
this.vlanId = vlanId;
}
@@ -248,7 +248,7 @@
return Type.VLAN_VID;
}
- public VLANID vlanId() {
+ public VlanId vlanId() {
return vlanId;
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java
index 270704e..06903e5 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java
@@ -8,9 +8,9 @@
import org.onlab.onos.net.flow.instructions.L3ModificationInstruction.L3SubType;
import org.onlab.onos.net.flow.instructions.L3ModificationInstruction.ModIPInstruction;
import org.onlab.onos.net.flow.instructions.L3ModificationInstruction.ModIPProtoInstruction;
-import org.onlab.packet.IPAddress;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
/**
* Factory class for creating various traffic treatment instructions.
*/
@@ -45,7 +45,7 @@
* @param addr the mac address to modify to.
* @return a l2 modification
*/
- public static L2ModificationInstruction modL2Src(MACAddress addr) {
+ public static L2ModificationInstruction modL2Src(MacAddress addr) {
checkNotNull(addr, "Src l2 address cannot be null");
return new ModEtherInstruction(L2SubType.L2_SRC, addr);
}
@@ -55,7 +55,7 @@
* @param addr the mac address to modify to.
* @return a L2 modification
*/
- public static L2ModificationInstruction modL2Dst(MACAddress addr) {
+ public static L2ModificationInstruction modL2Dst(MacAddress addr) {
checkNotNull(addr, "Dst l2 address cannot be null");
return new L2ModificationInstruction.ModEtherInstruction(L2SubType.L2_DST, addr);
}
@@ -75,7 +75,7 @@
* @param vlanId the vlan id to modify to.
* @return a L2 modification
*/
- public static L2ModificationInstruction modVlanId(VLANID vlanId) {
+ public static L2ModificationInstruction modVlanId(VlanId vlanId) {
checkNotNull(vlanId, "VLAN id cannot be null");
return new L2ModificationInstruction.ModVlanIdInstruction(vlanId);
}
@@ -95,7 +95,7 @@
* @param addr the ip address to modify to.
* @return a L3 modification
*/
- public static L3ModificationInstruction modL3Src(IPAddress addr) {
+ public static L3ModificationInstruction modL3Src(IpAddress addr) {
checkNotNull(addr, "Src l3 address cannot be null");
return new ModIPInstruction(L3SubType.L3_SRC, addr);
}
@@ -105,7 +105,7 @@
* @param addr the ip address to modify to.
* @return a L3 modification
*/
- public static L3ModificationInstruction modL3Dst(IPAddress addr) {
+ public static L3ModificationInstruction modL3Dst(IpAddress addr) {
checkNotNull(addr, "Dst l3 address cannot be null");
return new ModIPInstruction(L3SubType.L3_DST, addr);
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java
index da86e13..5490de2 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java
@@ -1,7 +1,7 @@
package org.onlab.onos.net.flow.instructions;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
/**
* Abstraction of a single traffic treatment step.
@@ -56,9 +56,9 @@
public static final class ModEtherInstruction extends L2ModificationInstruction {
private final SubType subtype;
- private final MACAddress mac;
+ private final MacAddress mac;
- public ModEtherInstruction(SubType subType, MACAddress addr) {
+ public ModEtherInstruction(SubType subType, MacAddress addr) {
this.subtype = subType;
this.mac = addr;
}
@@ -68,7 +68,7 @@
return this.subtype;
}
- public MACAddress mac() {
+ public MacAddress mac() {
return this.mac;
}
@@ -101,9 +101,9 @@
*/
public static final class ModVlanIdInstruction extends L2ModificationInstruction {
- public final VLANID vlanId;
+ public final VlanId vlanId;
- public ModVlanIdInstruction(VLANID vlanId) {
+ public ModVlanIdInstruction(VlanId vlanId) {
this.vlanId = vlanId;
}
@@ -112,7 +112,7 @@
return L2SubType.VLAN_ID;
}
- public VLANID vlanId() {
+ public VlanId vlanId() {
return this.vlanId;
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java
index eb4d3b6..126c1f9 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java
@@ -1,6 +1,6 @@
package org.onlab.onos.net.flow.instructions;
-import org.onlab.packet.IPAddress;
+import org.onlab.packet.IpAddress;
/**
* Abstraction of a single traffic treatment step.
@@ -47,9 +47,9 @@
public static final class ModIPInstruction extends L3ModificationInstruction {
private final SubType subtype;
- private final IPAddress ip;
+ private final IpAddress ip;
- public ModIPInstruction(SubType subType, IPAddress addr) {
+ public ModIPInstruction(SubType subType, IpAddress addr) {
this.subtype = subType;
this.ip = addr;
}
@@ -59,7 +59,7 @@
return this.subtype;
}
- public IPAddress ip() {
+ public IpAddress ip() {
return this.ip;
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/host/DefaultHostDescription.java b/core/api/src/main/java/org/onlab/onos/net/host/DefaultHostDescription.java
index a06a92e..68795bd 100644
--- a/core/api/src/main/java/org/onlab/onos/net/host/DefaultHostDescription.java
+++ b/core/api/src/main/java/org/onlab/onos/net/host/DefaultHostDescription.java
@@ -6,42 +6,42 @@
import java.util.Set;
import org.onlab.onos.net.HostLocation;
-import org.onlab.packet.IPAddress;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
import com.google.common.collect.ImmutableSet;
public class DefaultHostDescription implements HostDescription {
- private final MACAddress mac;
- private final VLANID vlan;
+ private final MacAddress mac;
+ private final VlanId vlan;
private final HostLocation location;
- private final Set<IPAddress> ips;
+ private final Set<IpAddress> ips;
- public DefaultHostDescription(MACAddress mac, VLANID vlan,
+ public DefaultHostDescription(MacAddress mac, VlanId vlan,
HostLocation loc) {
this.mac = mac;
this.vlan = vlan;
this.location = loc;
- this.ips = new HashSet<IPAddress>();
+ this.ips = new HashSet<IpAddress>();
}
- public DefaultHostDescription(MACAddress mac, VLANID vlan,
- HostLocation loc, Set<IPAddress> ips) {
+ public DefaultHostDescription(MacAddress mac, VlanId vlan,
+ HostLocation loc, Set<IpAddress> ips) {
this.mac = mac;
this.vlan = vlan;
this.location = loc;
- this.ips = new HashSet<IPAddress>(ips);
+ this.ips = new HashSet<IpAddress>(ips);
}
@Override
- public MACAddress hwAddress() {
+ public MacAddress hwAddress() {
return mac;
}
@Override
- public VLANID vlan() {
+ public VlanId vlan() {
return vlan;
}
@@ -51,7 +51,7 @@
}
@Override
- public Set<IPAddress> ipAddresses() {
+ public Set<IpAddress> ipAddresses() {
return ImmutableSet.copyOf(ips);
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/host/HostDescription.java b/core/api/src/main/java/org/onlab/onos/net/host/HostDescription.java
index 313a403..5917bef 100644
--- a/core/api/src/main/java/org/onlab/onos/net/host/HostDescription.java
+++ b/core/api/src/main/java/org/onlab/onos/net/host/HostDescription.java
@@ -4,9 +4,9 @@
import org.onlab.onos.net.Description;
import org.onlab.onos.net.HostLocation;
-import org.onlab.packet.IPAddress;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
/**
* Information describing host and its location.
@@ -18,14 +18,14 @@
*
* @return the MAC address of this host
*/
- MACAddress hwAddress();
+ MacAddress hwAddress();
/**
* Returns the VLAN associated with this host.
*
* @return the VLAN ID value
*/
- VLANID vlan();
+ VlanId vlan();
/**
* Returns the location of the host on the network edge.
@@ -39,6 +39,6 @@
*
* @return a set of IP addresses.
*/
- Set<IPAddress> ipAddresses();
+ Set<IpAddress> ipAddresses();
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/host/HostService.java b/core/api/src/main/java/org/onlab/onos/net/host/HostService.java
index 1a94471..357fb61 100644
--- a/core/api/src/main/java/org/onlab/onos/net/host/HostService.java
+++ b/core/api/src/main/java/org/onlab/onos/net/host/HostService.java
@@ -4,9 +4,9 @@
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.Host;
import org.onlab.onos.net.HostId;
-import org.onlab.packet.IPAddress;
-import org.onlab.packet.MACAddress;
-import org.onlab.packet.VLANID;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
import java.util.Set;
@@ -44,7 +44,7 @@
* @return set of hosts in the given vlan id
*/
// FIXME: change long to VLanId
- Set<Host> getHostsByVlan(VLANID vlanId);
+ Set<Host> getHostsByVlan(VlanId vlanId);
/**
* Returns the set of hosts that have the specified MAC address.
@@ -52,7 +52,7 @@
* @param mac mac address
* @return set of hosts with the given mac
*/
- Set<Host> getHostsByMac(MACAddress mac);
+ Set<Host> getHostsByMac(MacAddress mac);
/**
* Returns the set of hosts that have the specified IP address.
@@ -60,7 +60,7 @@
* @param ip ip address
* @return set of hosts with the given IP
*/
- Set<Host> getHostsByIp(IPAddress ip);
+ Set<Host> getHostsByIp(IpAddress ip);
/**
* Returns the set of hosts whose most recent location is the specified