Ethereal-dev: [Ethereal-dev] Re: BACnet packet-bacapp corrections

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Steve Karg <skarg@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 16 Apr 2006 07:12:57 -0400
Hi Jaap,

How about lvt == 0? Is that an allowed value?

The BACnet standard states:
"The encoding of an unsigned integer value shall be primitive, with at least one contents octet." and "The encoding of a signed integer value shall be primitive, with at least one contents octet."

So zero is not allowed.  Attached is a patch replacing the first two.

Patch summary:

1) BACnet signed values were being decoded incorrectly for negative values since BACnet tries to be clever and minimizes the number of bytes sent on the wire and drops the leading FF on negative values. For example, -200 is passed as FF 38 on the wire, but would display as 65336.

2) Since the BACnet unsigned values were decoded using a 64-bit entity, I changed the decoding such that allows all 8 bytes to be decoded. The function can now decode 5, 6, and 7 byte values.

3) Corrected warning about signed/unsigned in a pointer parameter.

Thanks for being picky and reveiwing the code!

Best Regards,

Steve

Attachment: bacapp.patch.gz
Description: GNU Zip compressed data