Ethereal

Re: [ethereal-dev] patch including packet-yhoo.c - yahoo messenger/pager protocol
Google
 
Web Ethereal.com

Home | Introduction | Documentation | Lists | FAQ | Development | Wiki | Bugs

Ethereal-dev: October 1999


> 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.


Powered by MHonArc 2.6.10