ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] tvb_get_* for guint64?

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Wed, 18 Aug 2004 11:29:07 -0700
Kelly Byrd wrote:
It seems there isn't a tvb_get_* routine for a g[u]int64,
but there's code to handle the a 64bit type in proto_add_item.
Is there a reason for this that I'm missing?

It's because, right now, FT_{U}INT64 isn't implemented as a 64-bit integer data type, because we wanted to support platforms that didn't have compilers with 64-bit integer support (people *were* building Ethereal on those platforms).

However, code that required 64-bit integer support "snuck in" (e.g., in the RSVP dissector), and we haven't heard much in the way of complaints (presumably people used GCC if the native compiler had no 64-bit integer support), so I figure at this point we might as well just require 64-bit integer support.

We already have configure-script stuff to figure out the format that can be used to print 64-bit integers ("%ll{d,o,u,x}" is *NOT* guaranteed to do the job!). We should probably convert FT_{U}INT64 to use g{u}int64, and...

Would it be useful to do this in tvbuff?

...add "tvb_get_ntoh64()" and "tvb_get_letoh64()" routines.