/*
- * 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,
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 {
setChecksum((short) 0);
}
- private Map<String, byte[]> fieldValues;
+ private final Map<String, byte[]> fieldValues;
/* public static Map<Short, Class<? extends Packet>> decodeMap;
* 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);
}
}
@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());
}
}