Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 21556: /trunk/epan//trunk/epan/: pro
-----Ursprungligt meddelande-----
Från: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] För Joerg Mayer
Skickat: den 24 april 2007 21:43
Till: wireshark-dev@xxxxxxxxxxxxx
Ämne: Re: [Wireshark-dev] [Wireshark-commits] rev 21556:
/trunk/epan//trunk/epan/: proto.c proto.h
>On Tue, Apr 24, 2007 at 07:24:15PM +0000, etxrab@xxxxxxxxxxxxx wrote:
>> Add a new proto function proto_tree_add_bits() which adds bits to the
tree
>> starting at the bit offset given for the number of bits indicated which
wll also return
>> the value of the bits.
>> Experimental and for review, documentation to be updated.
>OK, I didn't really understand the log message, but when I looked at
>proto.c patch, things got clearer.
>And here's the feedback:
>- what's your motivation behind that patch? (just curious)
In bit oriented protocols, like h263 and probably in packet-per.c
A string of bits may not occur at the same (bit)offset depending on optional
Strings of bits making it cumbersome to dissect the protocol as fixed masks
can't be used.
>- In your patch you mixed to things: tvb_get_bits and a
> proto_tree_add_bits. Pease don't do that. It makes this function
> behave differently from all other proto_tree_add_ functions. Also, the
> tvb_get_ function is missing. If you *really* think that mixing these
> two functions makes sense, then all existing functions (and their
> uses) should be modified to behave similarly, just to stay consistent.
>
> ciao
> Joerg
This is a point of discussion I didn't think of making a tvb_get_bits()
Function but its not uncommon to have to do something like
proto_tree_add..
value = tvb_get..
switch(value)
and since the proto_tree function need to get the value any way it's a bit
of a waist to fetch the value again.
Best regards
Anders
--
Joerg Mayer <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.
_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev