X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Farphandler%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Farphandler%2FARPReply.java;h=1a446b83db92fe1a690e8ac94f181b6bf75705ac;hp=e4388c598fb0eec94a0bb6cdb8f070b4f328af2c;hb=44a86821d69cd804b6b23b437e0b27136eaac2b5;hpb=e7df3a0260ee5c2d805d1638af5e51f08022b891 diff --git a/opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/ARPReply.java b/opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/ARPReply.java index e4388c598f..1a446b83db 100644 --- a/opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/ARPReply.java +++ b/opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/ARPReply.java @@ -18,19 +18,22 @@ import org.opendaylight.controller.sal.utils.HexEncode; * ARP Reply event wrapper */ public class ARPReply extends ARPEvent { - + private static final long serialVersionUID = 1L; private final NodeConnector port; private final byte[] tMac; private final byte[] sMac; private final InetAddress sIP; + private final short vlan; @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); + result = prime * result + ((port == null) ? 0 : port.hashCode()); result = prime * result + ((sIP == null) ? 0 : sIP.hashCode()); result = prime * result + Arrays.hashCode(sMac); result = prime * result + Arrays.hashCode(tMac); + result = prime * result + vlan; return result; } @@ -39,13 +42,20 @@ public class ARPReply extends ARPEvent { if (this == obj) { return true; } - if (obj == null) { + if (!super.equals(obj)) { return false; } if (!(obj instanceof ARPReply)) { return false; } ARPReply other = (ARPReply) obj; + if (port == null) { + if (other.port != null) { + return false; + } + } else if (!port.equals(other.port)) { + return false; + } if (sIP == null) { if (other.sIP != null) { return false; @@ -59,23 +69,28 @@ public class ARPReply extends ARPEvent { if (!Arrays.equals(tMac, other.tMac)) { return false; } + if (vlan != other.vlan) { + return false; + } return true; } - public ARPReply(NodeConnector port, InetAddress sIP, byte[] sMAC, InetAddress tIP, byte[] tMAC) { + public ARPReply(NodeConnector port, InetAddress sIP, byte[] sMAC, InetAddress tIP, byte[] tMAC, short vlan) { super(tIP); this.tMac = tMAC; this.sIP = sIP; this.sMac = sMAC; this.port = port; + this.vlan = vlan; } - public ARPReply(InetAddress tIP, byte[] tMAC) { + public ARPReply(InetAddress tIP, byte[] tMAC, short vlan) { super(tIP); this.tMac = tMAC; this.sIP = null; this.sMac = null; this.port = null; + this.vlan = vlan; } public byte[] getTargetMac() { @@ -94,6 +109,10 @@ public class ARPReply extends ARPEvent { return port; } + public short getVlan() { + return vlan; + } + /* * (non-Javadoc) * @@ -122,6 +141,10 @@ public class ARPReply extends ARPEvent { builder.append("sIP=") .append(sIP); } + if (vlan != 0) { + builder.append(", vlan=") + .append(vlan); + } builder.append("]"); return builder.toString(); }