Don't assume ints are 32 bits. Fixes a recent Buildbot error.

svn path=/trunk/; revision=15200
This commit is contained in:
Gerald Combs 2005-08-03 17:32:00 +00:00
parent 49284d02cb
commit d0811b3d35
2 changed files with 16 additions and 15 deletions

View File

@ -40,19 +40,20 @@
* structure of the header at the beginning of every trace mbuf
*---------------------------------------------------------------------------*/
typedef struct {
unsigned int length; /* length of the following mbuf */
int unit; /* controller unit number */
int type; /* type of channel */
guint32 length; /* length of the following mbuf */
gint32 unit; /* controller unit number */
gint32 type; /* type of channel */
#define TRC_CH_I 0 /* Layer 1 INFO's */
#define TRC_CH_D 1 /* D channel */
#define TRC_CH_B1 2 /* B1 channel */
#define TRC_CH_B2 3 /* B2 channel */
int dir; /* direction */
gint32 dir; /* direction */
#define FROM_TE 0 /* user -> network */
#define FROM_NT 1 /* network -> user */
int trunc; /* # of truncated bytes (frame > MCLBYTES) */
unsigned int count; /* frame count for this unit/type */
struct timeval time; /* timestamp for this frame */
gint32 trunc; /* # of truncated bytes (frame > MCLBYTES) */
guint32 count; /* frame count for this unit/type */
guint32 ts_sec; /* timestamp seconds */
guint32 ts_usec; /* timestamp microseconds */
} i4b_trace_hdr_t;
#define INFO0 0 /* layer 1 */
@ -79,10 +80,10 @@ typedef struct {
#define TRACE_B_RX 0x10 /* trace B channel on */
typedef struct {
int rxunit; /* unit # for rx frames */
int rxflags; /* d and/or b channel */
int txunit; /* unit # for tx frames */
int txflags; /* d and/or b channel */
gint32 rxunit; /* unit # for rx frames */
gint32 rxflags; /* d and/or b channel */
gint32 txunit; /* unit # for tx frames */
gint32 txflags; /* d and/or b channel */
} i4b_trace_setupa_t;
#define I4B_TRC_SETA _IOW('T', 2, i4b_trace_setupa_t) /* set analyze mode */

View File

@ -142,8 +142,8 @@ static gboolean i4btrace_read(wtap *wth, int *err, gchar **err_info,
wth->phdr.len = length;
wth->phdr.caplen = length;
wth->phdr.ts.tv_sec = hdr.time.tv_sec;
wth->phdr.ts.tv_usec = hdr.time.tv_usec;
wth->phdr.ts.tv_sec = hdr.ts_sec;
wth->phdr.ts.tv_usec = hdr.ts_usec;
/*
* Read the packet data.
@ -244,8 +244,8 @@ i4b_byte_swap_header(wtap *wth, i4b_trace_hdr_t *hdr)
hdr->dir = BSWAP32(hdr->dir);
hdr->trunc = BSWAP32(hdr->trunc);
hdr->count = BSWAP32(hdr->count);
hdr->time.tv_sec = BSWAP32(hdr->time.tv_sec);
hdr->time.tv_usec = BSWAP32(hdr->time.tv_usec);
hdr->ts_sec = BSWAP32(hdr->ts_sec);
hdr->ts_usec = BSWAP32(hdr->ts_usec);
}
}