Ethereal-dev: Re: [Ethereal-dev] Searching for packets with incorrect checksums

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 18 Dec 2001 13:39:21 -0800 (PST)
>     proto_tree_add_item(sctp_tree, hf_sctp_checksum_correct, tvb, 
> CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum_correct);

That call says that there's a field, at an offset of CHECKSUM_OFFSET in
the tvbuff "tvb", with a length of CHECKSUM_LENGTH. amd that it's
big-endian if "checksum_correct" is false and little-endian if
"checksum_correct" is true.

If, in fact, you want to have the value come from a variable, rather
than from the tvbuff, you want to do

	proto_tree_add_boolean(sctp_tree, hf_sctp_checksum_correct, tvb, 
	    CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum_correct);