X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fpacket%2FUDP.java;h=069a277f89d9ee44df2e4ca22d9783fb9b9a6404;hb=edf5bfcee83c750853253ccfd991ba7000f5f65b;hp=52827d55c6bf7430c96f0ce38e9f65ad42f0da7f;hpb=42210c03b0a4c54706320ba9f55794c0abd4d201;p=controller.git diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/UDP.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/UDP.java index 52827d55c6..069a277f89 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/UDP.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/UDP.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2013-2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -13,15 +13,13 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; +import org.opendaylight.controller.sal.match.Match; +import org.opendaylight.controller.sal.match.MatchType; /** * Class that represents the UDP datagram objects - * - * */ public class UDP extends Packet { @@ -67,7 +65,7 @@ public class UDP extends Packet { setChecksum((short) 0); } - private Map fieldValues; + private final Map fieldValues; /* public static Map> decodeMap; @@ -113,9 +111,6 @@ public class UDP extends Packet { * Store the value read from data stream in hdrFieldMap */ public void setHeaderField(String headerField, byte[] readValue) { - /*if (headerField.equals("Protocol")) { - payloadClass = decodeMap.get(readValue); - }*/ hdrFieldsMap.put(headerField, readValue); } @@ -165,12 +160,8 @@ public class UDP extends Packet { } @Override - public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); - } - - @Override - public boolean equals(Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); + public void populateMatch(Match match) { + match.setField(MatchType.TP_SRC, this.getSourcePort()); + match.setField(MatchType.TP_DST, this.getDestinationPort()); } }