diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-10-29 21:56:50 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-10-29 21:56:50 +0000 |
commit | 62d224011d6315fedb5d66810692e54697f031d9 (patch) | |
tree | f845fe3e32eeff95a9e4dfbfc6224de31b41267b /packet-bootp.c | |
parent | d850e01b43e0bab9b0278c788e4005b61e3bc5a4 (diff) |
Stop using "tvb_get_ntohll()" and "%llX" in the BOOTP dissector, as the
former depends on having "guint64" and the latter depends on
"%ll[douxX]" being what's used to print 64-bit integers, and there are
platforms on which Etheeal runs that don't have "guint64" or that don't
use "%ll[douxX]" to print 64-bit integers.
Get rid of the routines to extract 64-bit integers into "gint64"s and
"guint64"s, as per Ronnie Sahlberg's suggestion, to discourage people
from writing code that won't work on all platforms; they should be using
FT_UINT64, or the routines in "int-64bit.c", instead.
svn path=/trunk/; revision=4102
Diffstat (limited to 'packet-bootp.c')
-rw-r--r-- | packet-bootp.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/packet-bootp.c b/packet-bootp.c index 74d123954b..f46362efa6 100644 --- a/packet-bootp.c +++ b/packet-bootp.c @@ -2,7 +2,7 @@ * Routines for BOOTP/DHCP packet disassembly * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-bootp.c,v 1.54 2001/06/18 02:17:45 guy Exp $ + * $Id: packet-bootp.c,v 1.55 2001/10/29 21:56:47 guy Exp $ * * The information used comes from: * RFC 951: Bootstrap Protocol @@ -15,9 +15,8 @@ * http://www.isi.edu/in-notes/iana/assignments/bootp-dhcp-parameters * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -44,6 +43,7 @@ #include <string.h> #include <glib.h> +#include "int-64bit.h" #include "packet.h" #include "packet-arp.h" @@ -587,26 +587,8 @@ bootp_option(tvbuff_t *tvb, proto_tree *bp_tree, int voff, int eoff, tvb_get_guint8(tvb, voff+3)); proto_tree_add_text(v_tree, tvb, voff+4, 1, "Replay Detection Method: %d", tvb_get_guint8(tvb, voff+4)); - /* - * XXX: - * - * 1) this won't compile if you have a compiler that - * doesn't support 64-bit integral quantities; - * - * 2) there is no standard for the printf format to - * be used for 64-bit integral quantities, so - * this may not display correctly. - * - * We need to figure out how to handle 64-bit integral - * quantities portably, with some form of fallback if - * the compiler doesn't support it, and some way of - * handling "%ll{d,o,x}" (most platforms) vs. "%q{d,o.x}" - * (FreeBSD, perhaps some versions of other BSDs) vs. - * "sorry, we're an LP64 platform, %l{d,o,x} is good enough - * for you" (Digital UNIX). - */ - proto_tree_add_text(v_tree, tvb, voff+5, 8, "Replay Detection Value: %0llX", - tvb_get_ntohll(tvb, voff+5)); + proto_tree_add_text(v_tree, tvb, voff+5, 8, "Replay Detection Value: %s", + u64toh(tvb_get_ptr(tvb, voff+5, 8))); if (vlen > 11) { proto_tree_add_text(v_tree, tvb, voff+13, 4, "Secret ID: %0X", tvb_get_ntohl(tvb, voff+13)); |