Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 5270] diff for a new dissector for COAP (draft-ietf-core-c

Date: Wed, 20 Oct 2010 17:45:55 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5270

--- Comment #24 from Shoichi Sakane <wireshark-shoichi@xxxxxxxx> 2010-10-20 17:45:53 PDT ---
(In reply to comment #23)
> (In reply to comment #19)
> > Created an attachment (id=5337)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=5337) [details]
[details]
> > new patch to dissect the more COAP options for svn 34581
> 
> BTW patches (even with review_for_checkin set) generally don't get looked at on
> resolved bugs.  Better to open new bugs or at least reopen this one.

O.K.  I will do it next time.  Thanks for your suggestion.

> > I made a patch to support more COAP options.
> > some options includes variable length field.
> > so I couldn't find the way not to use proto_tree_add_text().
> > any suggestion ?
> 
> I'd suggest using proto_tree_add_uint() or proto_tree_add_uint_format().  Then
> you could do something like:
> 
> dissect_coap_opt_time(tvb, subtree, offset, opt_length, hf_coap_max_age);
> 
> and in dissect_coap_opt_time( ... int hf_time):
> [...]
> proto_tree_add_uint(subtree, hf_time, tvb, offset, opt_length, time);

The problem is that the value is encoded into variable bit length.
The time is encoded into four types of bit-length:
    8-bit, 16-bit, 24-bit, 32-bit
The block size is encoded into three types:
    4-bit, 12-bit, 20-bit

Anyway, I consider it according to your suggestion.

> Anyway, the latest patch was checked in.

Thanks.

> BTW, checkhf.pl indicates that there are 2 unused hf entries:
> 
> hf_coap_opt_type
> hf_coap_opt_opaque_bytes
> 
> Not sure if they will soon be used or if it's an oversight.

hf_coap_opt_opaque_bytes is reserved, but hf_coap_opt_type will not be used.
I will send a patch for it with including some minor change like fixing indent
and my credit.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.