1. Added SegmentRoutingManager so that it can spawn any required objects such as ArpHandler or IcmpHandler
2. Added ArpHandler.java so that it handles any ICMP request for any known host
Change-Id: Ifd93318dc4c67fde2fce2fde04fa9df33d231e41
diff --git a/src/main/java/net/onrc/onos/core/hostmanager/Host.java b/src/main/java/net/onrc/onos/core/hostmanager/Host.java
index 45452e0..0f20fac 100644
--- a/src/main/java/net/onrc/onos/core/hostmanager/Host.java
+++ b/src/main/java/net/onrc/onos/core/hostmanager/Host.java
@@ -48,6 +48,12 @@
private MACAddress macAddress;
/**
+ * The IP address associated with this entity.
+ */
+ private int ipAddress;
+
+
+ /**
* The VLAN tag on this entity, or null if untagged.
*/
private Short vlan;
@@ -81,14 +87,16 @@
* Create a new host and its information.
*
* @param macAddress mac address of this host
+ * @param ipAddress ip address of this host (if any)
* @param vlan vlan ID of this host
* @param switchDPID switch DPID where the host is attached
* @param switchPort port number where the host is attached
* @param lastSeenTimestamp last packet-in time of this host
*/
- public Host(MACAddress macAddress, Short vlan, Long switchDPID,
+ public Host(MACAddress macAddress, int ipAddress, Short vlan, Long switchDPID,
Long switchPort, Date lastSeenTimestamp) {
this.macAddress = macAddress;
+ this.ipAddress = ipAddress;
this.vlan = vlan;
this.switchDPID = switchDPID;
this.switchPort = switchPort;
@@ -107,6 +115,10 @@
return macAddress;
}
+ public int getIpAddress() {
+ return ipAddress;
+ }
+
public Short getVlan() {
return vlan;
}
@@ -135,6 +147,7 @@
final int prime = 31;
hashCode = 1;
hashCode = prime * hashCode + (int) (macAddress.toLong() ^ (macAddress.toLong() >>> 32));
+ hashCode = prime * hashCode + ipAddress;
hashCode = prime * hashCode + ((switchDPID == null) ? 0 : switchDPID.hashCode());
hashCode = prime * hashCode + ((switchPort == null) ? 0 : switchPort.hashCode());
hashCode = prime * hashCode + ((vlan == null) ? 0 : vlan.hashCode());
@@ -159,6 +172,9 @@
if (!Objects.equals(macAddress, other.macAddress)) {
return false;
}
+ if (!Objects.equals(ipAddress, other.ipAddress)) {
+ return false;
+ }
if (!Objects.equals(switchDPID, other.switchDPID)) {
return false;
}
@@ -176,6 +192,8 @@
StringBuilder builder = new StringBuilder();
builder.append("Host [macAddress=");
builder.append(macAddress.toString());
+ builder.append(", ipAddressn=");
+ builder.append(ipAddress);
builder.append(", vlan=");
builder.append(vlan);
builder.append(", switchDPID=");