Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
BUG-2218: Keep existing link augmentations during discovery process
[controller.git]
/
opendaylight
/
sal
/
api
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
packet
/
LLDPTLV.java
diff --git
a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java
b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java
index 27660221ceb56da61d3c6c68cdfd46a13622ef96..35244ea697d871617b09db6e232da95af0d51ebf 100644
(file)
--- a/
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java
+++ b/
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java
@@
-151,18
+151,23
@@
public class LLDPTLV extends Packet {
@Override
public boolean equals(Object obj) {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj)
{
return true;
return true;
- if (!super.equals(obj))
+ }
+ if (!super.equals(obj)) {
return false;
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
return false;
+ }
LLDPTLV other = (LLDPTLV) obj;
if (fieldValues == null) {
LLDPTLV other = (LLDPTLV) obj;
if (fieldValues == null) {
- if (other.fieldValues != null)
+ if (other.fieldValues != null)
{
return false;
return false;
- } else if (!fieldValues.equals(other.fieldValues))
+ }
+ } else if (!fieldValues.equals(other.fieldValues)) {
return false;
return false;
+ }
return true;
}
return true;
}
@@
-291,10
+296,17
@@
public class LLDPTLV extends Packet {
* @return the string
*/
static public String getStringValue(byte[] tlvValue, int tlvLen) {
* @return the string
*/
static public String getStringValue(byte[] tlvValue, int tlvLen) {
+ byte[] pidSubType = new byte[portIDSubType.length];
byte[] pidBytes = new byte[tlvLen - portIDSubType.length];
byte[] pidBytes = new byte[tlvLen - portIDSubType.length];
+ System.arraycopy(tlvValue, 0, pidSubType, 0,
+ pidSubType.length);
System.arraycopy(tlvValue, portIDSubType.length, pidBytes, 0,
pidBytes.length);
System.arraycopy(tlvValue, portIDSubType.length, pidBytes, 0,
pidBytes.length);
- return (new String(pidBytes, Charset.defaultCharset()));
+ if (pidSubType[0] == (byte) 0x3) {
+ return HexEncode.bytesToHexStringFormat(pidBytes);
+ } else {
+ return (new String(pidBytes, Charset.defaultCharset()));
+ }
}
/**
}
/**