diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-11-22 00:20:23 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-11-22 00:20:23 +0000 |
commit | 70709e1b3566afd6054c1a63edfa3b053344026e (patch) | |
tree | 60e15e3fb3c412c21407f0a948e515d2f1815c24 /epan/decode_as.h | |
parent | fc5adb9b6681ad5a8026b011187bcdf5b2e55f01 (diff) |
Move common "decode as" preference code to epan.
We presumably want "decode as" behavior to be consistent across UIs so
call load_decode_as_entries() from read_prefs().
svn path=/trunk/; revision=53498
Diffstat (limited to 'epan/decode_as.h')
-rw-r--r-- | epan/decode_as.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/epan/decode_as.h b/epan/decode_as.h index e25df5d41a..9308dda42d 100644 --- a/epan/decode_as.h +++ b/epan/decode_as.h @@ -27,6 +27,9 @@ #include "ws_symbol_export.h" +#include "ftypes/ftypes.h" +#include "packet_info.h" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -35,6 +38,12 @@ extern "C" { */ #define MAX_DECODE_AS_PROMPT_LEN 200 +#define DECODE_AS_ENTRY "decode_as_entry" +/* + * Filename of the "decode as" entry preferences + */ +#define DECODE_AS_ENTRIES_FILE_NAME "decode_as_entries" + /** callback function definition: return formatted label string */ typedef void (*build_label_func)(packet_info *pinfo, gchar* result); @@ -87,6 +96,40 @@ WS_DLL_PUBLIC gboolean decode_as_default_change(const char *name, const gpointer WS_DLL_PUBLIC GList *decode_as_list; +/** Reset the "decode as" entries and reload ones of the current profile. + */ +WS_DLL_PUBLIC void load_decode_as_entries(void); + +/* + * This routine creates one entry in the list of protocol dissector + * that need to be reset. It is called by the g_hash_table_foreach + * routine once for each changed entry in a dissector table. + * Unfortunately it cannot delete the entry immediately as this screws + * up the foreach function, so it builds a list of dissectors to be + * reset once the foreach routine finishes. + * + * @param table_name The table name in which this dissector is found. + * + * @param key A pointer to the key for this entry in the dissector + * hash table. This is generally the numeric selector of the + * protocol, i.e. the ethernet type code, IP port number, TCP port + * number, etc. + * + * @param value A pointer to the value for this entry in the dissector + * hash table. This is an opaque pointer that can only be handed back + * to routine in the file packet.c - but it's unused. + * + * @param user_data Unused. + */ +WS_DLL_PUBLIC void decode_build_reset_list (const gchar *table_name, ftenum_t selector_type, + gpointer key, gpointer value _U_, + gpointer user_data _U_); + +/** Clear all "decode as" settings + */ +WS_DLL_PUBLIC void decode_clear_all(void); + + #ifdef __cplusplus } #endif /* __cplusplus */ |