Ethereal-dev: [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: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Mon, 6 Oct 2003 03:48:12 +0200
I'm wondering whether the following code in packet-gryphon.c is endianess
independent:

static int
resp_time(tvbuff_t *tvb, int offset, proto_tree *pt)
{
    int     hours, minutes, seconds, fraction;
    union {
        unsigned int            lng[2];
        guint64                 lnglng;
    } ts;
    unsigned int    timestamp;
    unsigned char   date[45];

    ts.lng[1] = tvb_get_ntohl(tvb, offset);
    ts.lng[0] = tvb_get_ntohl(tvb, offset + 4);
    timestamp = ts.lnglng / 100000L;
...

  Ciao
            Jörg
-- 
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.