From 8ff944d4ab892521c6a32fe40f6a410640a34d34 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sun, 8 Feb 2015 20:36:03 -0500 Subject: Add fixed length function for address types. This allows for even more cleanup with respect to how address types are handled, including removing address_to_str.c. Most of the functionality was folded into address_types.c, but the remainder was just dispersed because it didn't make sense to keep the file. Change-Id: Id4e9391f0c3c26eff8c27b362e4f7a1970d718b4 Reviewed-on: https://code.wireshark.org/review/7038 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/address_types.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'epan/address_types.h') diff --git a/epan/address_types.h b/epan/address_types.h index ae699c86eb..e2cbe05ab1 100644 --- a/epan/address_types.h +++ b/epan/address_types.h @@ -1,4 +1,5 @@ /* address_types.h + * Definitions for address types * * Wireshark - Network traffic analyzer * By Gerald Combs @@ -30,6 +31,7 @@ extern "C" { typedef gboolean (*AddrValueToString)(const address* addr, gchar *buf, int buf_len); typedef int (*AddrValueToStringLen)(const address* addr); +typedef int (*AddrFixedLen)(void); typedef const char* (*AddrColFilterString)(const address* addr, gboolean src); struct _address_type_t; @@ -37,23 +39,23 @@ typedef struct _address_type_t address_type_t; int address_type_dissector_register(const char* name, const char* pretty_name, AddrValueToString to_str_func, AddrValueToStringLen str_len_func, - AddrColFilterString col_filter_str_func); + AddrColFilterString col_filter_str_func, AddrFixedLen fixed_len_func); void address_types_initialize(void); /* Address type functions used by multiple (dissector) address types */ gboolean none_addr_to_str(const address* addr, gchar *buf, int buf_len); int none_addr_str_len(const address* addr); +int none_addr_len(void); gboolean ether_to_str(const address* addr, gchar *buf, int buf_len); int ether_str_len(const address* addr); +int ether_len(void); /* XXX - Temporary? Here at least until all of the address type handling is finalized * Otherwise should be folded into address_types.c or just be handled with function pointers */ -int address_type_get_length(const address* addr); -void address_type_to_string(const address* addr, gchar *buf, int buf_len); const char* address_type_column_filter_string(const address* addr, gboolean src); -- cgit v1.2.3