diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-11-11 09:18:15 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-11-11 09:18:15 +0000 |
commit | 6647ded0011196557b6f28c61689837c5ce36038 (patch) | |
tree | d23c0f8373a5da901a67795dd81b74af6619f24a /packet-atalk.c | |
parent | eaf695bfee7e08fa75af9cc5b39cdd7c43598ba7 (diff) | |
download | wireshark-6647ded0011196557b6f28c61689837c5ce36038.tar.gz wireshark-6647ded0011196557b6f28c61689837c5ce36038.tar.bz2 wireshark-6647ded0011196557b6f28c61689837c5ce36038.zip |
Don't have separate versions of "ddp_hops()" and "ddp_len()" on
big-endian and little-endian platforms; just put "ddp.hops_len" in host
byte order and have one version. (This removes one usage of BIG_ENDIAN
and LITTLE_ENDIAN from Ethereal - our redefining of them causes warnings
on FreeBSD 3.4, so I'd like not to export them to all the dissectors if
possible - and also fixes "ddp_hops()" to work correctly on
little-endian machines, as the little-endian version wasn't
byte-swapping its argument.)
svn path=/trunk/; revision=2609
Diffstat (limited to 'packet-atalk.c')
-rw-r--r-- | packet-atalk.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/packet-atalk.c b/packet-atalk.c index 9ec3359b07..77388a2452 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -1,7 +1,7 @@ /* packet-atalk.c * Routines for Appletalk packet disassembly (DDP, currently). * - * $Id: packet-atalk.c,v 1.40 2000/08/13 14:08:00 deniel Exp $ + * $Id: packet-atalk.c,v 1.41 2000/11/11 09:18:15 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * @@ -81,16 +81,15 @@ static gint ett_pstring = -1; static dissector_table_t ddp_dissector_table; -/* P = Padding, H = Hops, L = Len */ -#if BYTE_ORDER == BIG_ENDIAN - /* PPHHHHLL LLLLLLLL */ -# define ddp_hops(x) ( ( x >> 10) & 0x3C ) -# define ddp_len(x) ( x & 0x03ff ) -#else - /* LLLLLLLL PPHHHHLL*/ -# define ddp_hops(x) ( x & 0x3C ) -# define ddp_len(x) ( ntohs(x) & 0x03ff ) -#endif +/* + * P = Padding, H = Hops, L = Len + * + * PPHHHHLL LLLLLLLL + * + * Assumes the argument is in host byte order. + */ +#define ddp_hops(x) ( ( x >> 10) & 0x3C ) +#define ddp_len(x) ( x & 0x03ff ) typedef struct _e_ddp { guint16 hops_len; /* combines pad, hops, and len */ guint16 sum,dnet,snet; @@ -385,6 +384,7 @@ dissect_ddp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { ddp.dnet=ntohs(ddp.dnet); ddp.snet=ntohs(ddp.snet); ddp.sum=ntohs(ddp.sum); + ddp.hops_len=ntohs(ddp.hops_len); src.net = ddp.snet; src.node = ddp.snode; |