Ethereal-dev: Re: [ethereal-dev] patch including packet-yhoo.c - yahoo messenger/pager protoco

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Wed, 13 Oct 1999 18:46:14 -0700 (PDT)
> I'm new to ethereal, but here's a quickly puttogether dissector for
> yahoo messenger/yahoo pager protocol, and the patch to add it.

Checked in.

> static unsigned int yahoo_makeint(unsigned char *data)
> {
>     if (data)
>     {
>         return ((data[3] << 24) + (data[2] << 16) + (data[1] << 8) + (data[0]));
>     }
>     return 0;
> }

There're already macros to take an "unsigned char *" ("guint8 *", but
that's just "unsigned char *") that points to a two-byte or four-byte
little-endian integral quantity, and extract that integral quantity -
see "pletohs()" and "pletohl()" in "packet.h".

"pntohs()" and "pntohl()" are the equivalent macros for big-endian
quantities.