diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-10-30 21:35:09 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-10-30 21:35:09 +0000 |
commit | 36facef28648359a86cab5f5e4aa81b39c072e0a (patch) | |
tree | 5936a077d4886dc02af532f826d806f204ad898a /doc | |
parent | c31d8f839e0b2595de5cde7bf9bac1ffbd8ffd3c (diff) |
Put in a note telling people NOT to use "tvb_get_ntohl()" or
"tvb_get_letohl()" to fetch IPv4 addresses.
svn path=/trunk/; revision=4110
Diffstat (limited to 'doc')
-rw-r--r-- | doc/README.developer | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/doc/README.developer b/doc/README.developer index 31a4b171e9..9c369a3053 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -1,4 +1,4 @@ -$Id: README.developer,v 1.37 2001/10/16 01:57:12 gerald Exp $ +$Id: README.developer,v 1.38 2001/10/30 21:35:09 guy Exp $ This file is a HOWTO for Ethereal developers. It describes how to start coding a Ethereal protocol dissector and the use some of the important functions and @@ -85,7 +85,7 @@ code inside is needed only if you are using the "snprintf()" function. -The "$Id: README.developer,v 1.37 2001/10/16 01:57:12 gerald Exp $" +The "$Id: README.developer,v 1.38 2001/10/30 21:35:09 guy Exp $" in the comment will be updated by CVS when the file is checked in; it will allow the RCS "ident" command to report which version of the file is currently checked out. @@ -95,7 +95,7 @@ version of the file is currently checked out. * Routines for PROTONAME dissection * Copyright 2000, YOUR_NAME <YOUR_EMAIL_ADDRESS> * - * $Id: README.developer,v 1.37 2001/10/16 01:57:12 gerald Exp $ + * $Id: README.developer,v 1.38 2001/10/30 21:35:09 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -347,6 +347,14 @@ guint16 tvb_get_letohs(tvbuff_t*, gint offset); guint32 tvb_get_letohl(tvbuff_t*, gint offset); guint32 tvb_get_letoh24(tvbuff_t*, gint offset); +NOTE: IPv4 addresses are not to be converted to host byte order before +being passed to "proto_tree_add_ipv4()". You should use "tvb_memcpy()" +to fetch them, not "tvb_get_ntohl()" *OR* "tvb_get_letohl()" - don't, +for example, try to use "tvb_get_ntohl()", find that it gives you the +wrong answer on the PC on which you're doing development, and try +"tvb_get_letohl()" instead, as "tvb_get_letohl()" will give the wrong +answer on big-endian machines. + Copying memory: guint8* tvb_memcpy(tvbuff_t*, guint8* target, gint offset, gint length); guint8* tvb_memdup(tvbuff_t*, gint offset, gint length); |