fixed bug in coojas iphc packet analyzer
This commit is contained in:
parent
d518c84471
commit
21736fe78f
1 changed files with 6 additions and 5 deletions
|
@ -17,8 +17,8 @@ public class IPHCPacketAnalyzer extends PacketAnalyzer {
|
||||||
* Values of fields within the IPHC encoding first byte
|
* Values of fields within the IPHC encoding first byte
|
||||||
* (C stands for compressed and I for inline)
|
* (C stands for compressed and I for inline)
|
||||||
*/
|
*/
|
||||||
public final static int SICSLOWPAN_IPHC_TC_C = 0x10;
|
public final static int SICSLOWPAN_IPHC_FL_C = 0x10;
|
||||||
public final static int SICSLOWPAN_IPHC_FL_C = 0x08;
|
public final static int SICSLOWPAN_IPHC_TC_C = 0x08;
|
||||||
public final static int SICSLOWPAN_IPHC_NH_C = 0x04;
|
public final static int SICSLOWPAN_IPHC_NH_C = 0x04;
|
||||||
public final static int SICSLOWPAN_IPHC_TTL_1 = 0x01;
|
public final static int SICSLOWPAN_IPHC_TTL_1 = 0x01;
|
||||||
public final static int SICSLOWPAN_IPHC_TTL_64 = 0x02;
|
public final static int SICSLOWPAN_IPHC_TTL_64 = 0x02;
|
||||||
|
@ -126,7 +126,7 @@ public class IPHCPacketAnalyzer extends PacketAnalyzer {
|
||||||
} else {
|
} else {
|
||||||
/* highest flow label bits + ECN bits */
|
/* highest flow label bits + ECN bits */
|
||||||
int tmp = packet.get(hc06_ptr);
|
int tmp = packet.get(hc06_ptr);
|
||||||
trafficClass = (tmp >> 6) & 0x0f;
|
trafficClass = (tmp >> 6) & 0x0f;
|
||||||
flowLabel = packet.getInt(hc06_ptr + 1, 2);
|
flowLabel = packet.getInt(hc06_ptr + 1, 2);
|
||||||
hc06_ptr += 3;
|
hc06_ptr += 3;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ public class IPHCPacketAnalyzer extends PacketAnalyzer {
|
||||||
if((packet.get(0) & SICSLOWPAN_IPHC_TC_C) == 0) {
|
if((packet.get(0) & SICSLOWPAN_IPHC_TC_C) == 0) {
|
||||||
/* Traffic class is inline */
|
/* Traffic class is inline */
|
||||||
trafficClass =((packet.get(hc06_ptr) >> 6) & 0x03);
|
trafficClass =((packet.get(hc06_ptr) >> 6) & 0x03);
|
||||||
trafficClass = (packet.get(hc06_ptr) << 2);
|
trafficClass |= (packet.get(hc06_ptr) << 2);
|
||||||
hc06_ptr += 1;
|
hc06_ptr += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -402,7 +402,8 @@ public class IPHCPacketAnalyzer extends PacketAnalyzer {
|
||||||
} else if (proto == PROTO_UDP) protoStr = "UDP";
|
} else if (proto == PROTO_UDP) protoStr = "UDP";
|
||||||
else if (proto == PROTO_TCP) protoStr = "TCP";
|
else if (proto == PROTO_TCP) protoStr = "TCP";
|
||||||
|
|
||||||
verbose.append("<br><b>IPv6 ").append(protoStr).append("</b><br>");
|
verbose.append("<br><b>IPv6 ").append(protoStr).append("</b> TC = " + trafficClass +
|
||||||
|
" FL: " + flowLabel + "<br>");
|
||||||
verbose.append("From ");
|
verbose.append("From ");
|
||||||
printAddress(verbose, srcAddress);
|
printAddress(verbose, srcAddress);
|
||||||
verbose.append(" to ");
|
verbose.append(" to ");
|
||||||
|
|
Loading…
Reference in a new issue