3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.arphandler;
12 import java.net.InetAddress;
13 import java.util.Arrays;
15 import org.opendaylight.controller.sal.core.NodeConnector;
17 * ARP Reply event wrapper
19 public class ARPReply extends ARPEvent {
21 private final NodeConnector port;
22 private final byte[] tMac;
23 private final byte[] sMac;
24 private final InetAddress sIP;
27 public int hashCode() {
29 int result = super.hashCode();
30 result = prime * result + ((sIP == null) ? 0 : sIP.hashCode());
31 result = prime * result + Arrays.hashCode(sMac);
32 result = prime * result + Arrays.hashCode(tMac);
37 public boolean equals(Object obj) {
44 if (!(obj instanceof ARPReply)) {
47 ARPReply other = (ARPReply) obj;
49 if (other.sIP != null) {
52 } else if (!sIP.equals(other.sIP)) {
55 if (!Arrays.equals(sMac, other.sMac)) {
58 if (!Arrays.equals(tMac, other.tMac)) {
64 public ARPReply(NodeConnector port, InetAddress sIP, byte[] sMAC, InetAddress tIP, byte[] tMAC) {
72 public ARPReply(InetAddress tIP, byte[] tMAC) {
80 public byte[] getTargetMac() {
84 public byte[] getSourceMac() {
88 public InetAddress getSourceIP() {
92 public NodeConnector getPort() {