diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-04-22 03:07:37 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-04-22 03:07:37 +0000 |
commit | d7309178edc5a7d207aeba33f8a74e3a54e542da (patch) | |
tree | df299ef604107c294e223b6c40431136cdb90cd4 /wiretap/eyesdn.c | |
parent | 21a93663afaad80b1bf016e8761e8d5432952b68 (diff) |
Clean up some 64-bit issues.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28117 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/eyesdn.c')
-rw-r--r-- | wiretap/eyesdn.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/wiretap/eyesdn.c b/wiretap/eyesdn.c index 3909ec5723..c8bd71be0b 100644 --- a/wiretap/eyesdn.c +++ b/wiretap/eyesdn.c @@ -41,7 +41,7 @@ * 7-n Byte: Frames * * Each Frame starts with the 0xff Flag byte - * - Bytes 0-2: timestamp (long usec in network byte order) + * - Bytes 0-2: timestamp (usec in network byte order) * - Bytes 3-7: timestamp (40bits sec since 1970 in network byte order) * - Byte 8: channel (0 for D channel, 1-30 for B1-B30) * - Byte 9: Sender Bit 0(0 NT, 1 TE), Protocol in Bits 7:1, see enum @@ -235,7 +235,8 @@ parse_eyesdn_rec_hdr(wtap *wth, FILE_T fh, union wtap_pseudo_header *pseudo_header, int *err, gchar **err_info) { guint8 hdr[EYESDN_HDR_LENGTH]; - unsigned long secs, usecs; + time_t secs; + int usecs; int pkt_len; guint8 channel, direction; @@ -251,23 +252,20 @@ parse_eyesdn_rec_hdr(wtap *wth, FILE_T fh, } /* extract information from header */ - usecs = ((unsigned long) hdr[0]); - usecs = (usecs << 8) | ((unsigned long) hdr[1]); - usecs = (usecs << 8) | ((unsigned long) hdr[2]); + usecs = pntoh24(&hdr[0]); #ifdef TV64BITS - secs = ((unsigned long) hdr[3]); + secs = hdr[3]; #else secs = 0; #endif - secs = (secs << 8) | ((unsigned long) hdr[4]); - secs = (secs << 8) | ((unsigned long) hdr[5]); - secs = (secs << 8) | ((unsigned long) hdr[6]); - secs = (secs << 8) | ((unsigned long) hdr[7]); + secs = (secs << 8) | hdr[4]; + secs = (secs << 8) | hdr[5]; + secs = (secs << 8) | hdr[6]; + secs = (secs << 8) | hdr[7]; channel = hdr[8]; direction = hdr[9]; - pkt_len = ((unsigned long) hdr[10]); - pkt_len = (pkt_len << 8) | ((unsigned long) hdr[11]); + pkt_len = pntohs(&hdr[10]); switch(direction >> 1) { default: |