diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-12-20 05:35:29 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-12-20 05:35:29 +0000 |
commit | a8bc4a0d136d7a68e8f006aec75a8e63191948c9 (patch) | |
tree | 2587cbb5c31f65afc60711d38d5dcc79a5a689e6 /epan/packet.h | |
parent | 7e16ec5b991b12020f7bdc135fd4943858bc3218 (diff) | |
download | wireshark-a8bc4a0d136d7a68e8f006aec75a8e63191948c9.tar.gz wireshark-a8bc4a0d136d7a68e8f006aec75a8e63191948c9.tar.bz2 wireshark-a8bc4a0d136d7a68e8f006aec75a8e63191948c9.zip |
Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys. (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)
svn path=/trunk/; revision=35224
Diffstat (limited to 'epan/packet.h')
-rw-r--r-- | epan/packet.h | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/epan/packet.h b/epan/packet.h index 092741cf3c..9aa604990f 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -86,13 +86,13 @@ typedef enum { extern void packet_init(void); extern void packet_cleanup(void); -/* Handle for dissectors you call directly or register with "dissector_add()". +/* Handle for dissectors you call directly or register with "dissector_add_uint()". This handle is opaque outside of "packet.c". */ struct dissector_handle; typedef struct dissector_handle *dissector_handle_t; -/* Hash table for matching port numbers and dissectors; this is opaque - outside of "packet.c". */ +/* Hash table for matching unsigned integers, or strings, and dissectors; + this is opaque outside of "packet.c". */ struct dissector_table; typedef struct dissector_table *dissector_table_t; @@ -167,38 +167,66 @@ extern ftenum_t get_dissector_table_selector_type(const char *name); extern int get_dissector_table_base(const char *name); /* Add an entry to a uint dissector table. */ -extern void dissector_add(const char *abbrev, const guint32 pattern, +extern void dissector_add_uint(const char *abbrev, const guint32 pattern, dissector_handle_t handle); +/* For old code that hasn't yet been changed. */ +#define dissector_add(abbrev, pattern, handle) \ + dissector_add_uint(abbrev, pattern, handle) + /* Delete the entry for a dissector in a uint dissector table with a particular pattern. */ -extern void dissector_delete(const char *name, const guint32 pattern, +extern void dissector_delete_uint(const char *name, const guint32 pattern, dissector_handle_t handle); +/* For old code that hasn't yet been changed. */ +#define dissector_delete(name, pattern, handle) \ + dissector_delete_uint(name, pattern, handle) + /* Change the entry for a dissector in a uint dissector table with a particular pattern to use a new dissector handle. */ -extern void dissector_change(const char *abbrev, const guint32 pattern, +extern void dissector_change_uint(const char *abbrev, const guint32 pattern, dissector_handle_t handle); +/* For old code that hasn't yet been changed. */ +#define dissector_change(abbrev, pattern, handle) \ + dissector_change_uint(abbrev, pattern, handle) + /* Reset an entry in a uint dissector table to its initial value. */ -extern void dissector_reset(const char *name, const guint32 pattern); +extern void dissector_reset_uint(const char *name, const guint32 pattern); + +/* For old code that hasn't yet been changed. */ +#define dissector_reset(name, pattern) \ + dissector_reset_uint(name, pattern) /* Look for a given value in a given uint dissector table and, if found, call the dissector with the arguments supplied, and return TRUE, otherwise return FALSE. */ -extern gboolean dissector_try_port(dissector_table_t sub_dissectors, - const guint32 port, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +extern gboolean dissector_try_uint(dissector_table_t sub_dissectors, + const guint32 uint_val, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); + +/* For old code that hasn't yet been changed. */ +#define dissector_try_port(sub_dissectors, uint_val, tvb, pinfo, tree) \ + dissector_try_uint(sub_dissectors, uint_val, tvb, pinfo, tree) /* Look for a given value in a given uint dissector table and, if found, call the dissector with the arguments supplied, and return TRUE, otherwise return FALSE. */ -extern gboolean dissector_try_port_new(dissector_table_t sub_dissectors, - const guint32 port, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const gboolean add_proto_name); +extern gboolean dissector_try_uint_new(dissector_table_t sub_dissectors, + const guint32 uint_val, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const gboolean add_proto_name); + +/* For old code that hasn't yet been changed. */ +#define dissector_try_port_new(sub_dissectors, uint_val, tvb, pinfo, tree, add_proto_name) \ + dissector_try_uint_new(sub_dissectors, uint_val, tvb, pinfo, tree, add_proto_name) /* Look for a given value in a given uint dissector table and, if found, return the dissector handle for that value. */ -extern dissector_handle_t dissector_get_port_handle( - dissector_table_t const sub_dissectors, const guint32 port); +extern dissector_handle_t dissector_get_uint_handle( + dissector_table_t const sub_dissectors, const guint32 uint_val); + +/* For old code that hasn't yet been changed. */ +#define dissector_get_port_handle(sub_dissectors, uint_val) \ + dissector_get_uint_handle(sub_dissectors, uint_val) /* Add an entry to a string dissector table. */ extern void dissector_add_string(const char *name, const gchar *pattern, |