ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 5433] Add FT_EUI64 Field Type

Date: Tue, 14 Dec 2010 14:30:37 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5433

Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeff.morriss.ws@xxxxxxxxx

--- Comment #3 from Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> 2010-12-14 14:30:35 PST ---
(In reply to comment #2)
> I based my code on FT_ETHER type, no problem for add FT_EUI64 in
> proto_tree_add_item
> 
> But there is a proto_tree_add_eui64 function in
> dissectors/packet-ieee802145.[ch] file.
> 
> The problem is the type of value attribute, the type is not the same between my
> code (guint8* value) and ieee802145 dissector (guint64 value).
> 
> I easily convert some proto_tree_add_eui64 to proto_tree_add_item with FT_EUI64
> Field Type. (See /* HELP ME ... */ in packet-ieee802145.c and
> packet-zbee-nwk.c)
> I have not found how to convert a guint64 to a pointer (guint8* )
> 
> my answer is what it is better ? a value attribut in guint64 or pointer ?

Personally I think that a guint64 argument is better:
- then you don't have to worry about the caller giving you not enough bytes
(too many isn't much of a problem I guess)
- if you do need to cast the data into a guint64 later (don't think you need to
here), you don't need to worry about whether the bytes are aligned correctly
(some architectures require int or longer accesses to be aligned on a 32-bit
boundary)

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