Ethereal-dev: Re: [Ethereal-dev] pppdump patch

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

From: Irfan Khan <ikhan@xxxxxxxxxxxx>
Date: Mon, 17 Dec 2001 15:12:20 -0700
Yes. Reference the pppdump record format at the beginning of the pppdump.c file.

Also the very first timestamp is treated correct on line 199 of pppdump.c:

        state->timestamp = pntohl(&buffer[1]);

Irfan

At 03:01 PM 12/17/2001, Guy Harris wrote:
> 2)  A time stamp bug where the reset and long time records are treated
> incorrectly.

        ...


> -                     case PPPD_TIME_STEP_LONG:
> +                     case PPPD_RESET_TIME:
> wtap_file_read_unknown_bytes(&time_long, sizeof(guint32), fh, err);
>                               state->offset += sizeof(guint32);
> -                             state->timestamp = time_long;
> +                             state->timestamp = pntohl(&time_long);
>                               state->tenths = 0;
>                               break;
>
> -                     case PPPD_RESET_TIME:
> +                     case PPPD_TIME_STEP_LONG:
> wtap_file_read_unknown_bytes(&time_long, sizeof(guint32), fh, err);
>                               state->offset += sizeof(guint32);
> -                             state->tenths += time_long;
> +                             state->tenths += pntohl(&time_long);
>
>                               if (state->tenths >= 10) {
> state->timestamp += state->tenths / 10;

So they're guaranteed to be big-endian?