forked from osmocom/wireshark
Added dissector_delete_all() to remove all entries from a dissector table.
svn path=/trunk/; revision=51859
This commit is contained in:
parent
e4025f4aba
commit
2b698e5c5f
|
@ -894,6 +894,24 @@ void dissector_delete_uint_range(const char *abbrev, range_t *range,
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
dissector_delete_all_check (gpointer key _U_, gpointer value, gpointer user_data)
|
||||
{
|
||||
dtbl_entry_t *dtbl_entry = value;
|
||||
dissector_handle_t handle = user_data;
|
||||
|
||||
return (proto_get_id (dtbl_entry->current->protocol) == proto_get_id (handle->protocol));
|
||||
}
|
||||
|
||||
/* Delete all entries from a dissector table. */
|
||||
void dissector_delete_all(const char *name, dissector_handle_t handle)
|
||||
{
|
||||
dissector_table_t sub_dissectors = find_dissector_table(name);
|
||||
g_assert (sub_dissectors);
|
||||
|
||||
g_hash_table_foreach_remove (sub_dissectors->hash_table, dissector_delete_all_check, handle);
|
||||
}
|
||||
|
||||
/* Change the entry for a dissector in a uint dissector table
|
||||
with a particular pattern to use a new dissector handle. */
|
||||
void
|
||||
|
|
|
@ -188,6 +188,9 @@ WS_DLL_PUBLIC void dissector_delete_uint(const char *name, const guint32 pattern
|
|||
WS_DLL_PUBLIC void dissector_delete_uint_range(const char *abbrev, range_t *range,
|
||||
dissector_handle_t handle);
|
||||
|
||||
/* Delete all entries from a dissector table. */
|
||||
WS_DLL_PUBLIC void dissector_delete_all(const char *name, dissector_handle_t handle);
|
||||
|
||||
/* Change the entry for a dissector in a uint dissector table
|
||||
with a particular pattern to use a new dissector handle. */
|
||||
WS_DLL_PUBLIC void dissector_change_uint(const char *abbrev, const guint32 pattern,
|
||||
|
|
Loading…
Reference in New Issue