aboutsummaryrefslogtreecommitdiffstats
path: root/packet-atalk.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-11-11 09:18:15 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-11-11 09:18:15 +0000
commit56faf3afd37c6fd7d35a3ef96c04e27068a594f6 (patch)
treed23c0f8373a5da901a67795dd81b74af6619f24a /packet-atalk.c
parent0d89c270d92f0fed2f79dba713695b76b8d1bdf9 (diff)
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.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2609 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-atalk.c')
-rw-r--r--packet-atalk.c22
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;