Ethereal-dev: Re: [Ethereal-dev] Endianess question in packet-gryphon.c

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 6 Oct 2003 16:56:28 -0700

On Oct 5, 2003, at 7:49 PM, Ronnie Sahlberg wrote:

We would need new functions tvb_get_int64n() and tvb_get_int64le() that
stores the value in a char[8]
then we would need a few support routines to do simple arithmetics and
operations on such char[8]s like
   int64_div_by_guint32()
   int64_get_high()
   int64_get_low()

I think GCC has, in its support library, routines to do 64-bit arithmetic, although it doesn't, I think, have any for simple operations such as addition and subtraction as GCC 2.x and 3.x generate inline code for those.

Perhaps having the support routines just do the arithmetic in C if the platform supports g{u}int64, and use GCC routines when available otherwise would be the right answer here.