aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2018-02-08 09:31:29 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2018-02-08 09:54:16 +0000
commita2265f73b58ea91c3ae13ed5b863f844936f61d3 (patch)
tree531c87d81739cd4ab7c098bb96246e03105b348e /epan/packet.c
parenta56d9ba30ebeeca4ea12d4ee5f5d45ddec2a450d (diff)
packet: Whitespace cleanup
Change-Id: I47d7994b5670ec6b954444b53aa9572f3ba5a047 Reviewed-on: https://code.wireshark.org/review/25682 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c87
1 files changed, 43 insertions, 44 deletions
diff --git a/epan/packet.c b/epan/packet.c
index e167186b64..1e7ae97708 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -530,7 +530,6 @@ dissect_record(epan_dissect_t *edt, int file_type_subtype,
edt->pi.layers = wmem_list_new(edt->pi.pool);
edt->tvb = tvb;
-
frame_delta_abs_time(edt->session, fd, fd->frame_ref_num, &edt->pi.rel_ts);
/* pkt comment use first user, later from phdr */
@@ -627,7 +626,7 @@ dissect_file(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
}
CATCH2(FragmentBoundsError, ReportedBoundsError) {
proto_tree_add_protocol_format(edt->tree, proto_malformed, edt->tvb, 0, 0,
- "[Malformed Record: Packet Length]" );
+ "[Malformed Record: Packet Length]");
}
ENDTRY;
@@ -900,7 +899,7 @@ struct dtbl_entry {
dissector_table_t
find_dissector_table(const char *name)
{
- return (dissector_table_t)g_hash_table_lookup( dissector_tables, name );
+ return (dissector_table_t)g_hash_table_lookup(dissector_tables, name);
}
/* Find an entry in a uint dissector table. */
@@ -1013,8 +1012,8 @@ dissector_add_uint(const char *name, const guint32 pattern, dissector_handle_t h
dtbl_entry->initial = dtbl_entry->current;
/* do the table insertion */
- g_hash_table_insert( sub_dissectors->hash_table,
- GUINT_TO_POINTER( pattern), (gpointer)dtbl_entry);
+ g_hash_table_insert(sub_dissectors->hash_table,
+ GUINT_TO_POINTER(pattern), (gpointer)dtbl_entry);
/*
* Now, if this table supports "Decode As", add this handle
@@ -1060,7 +1059,7 @@ dissector_add_preference(const char *name, dissector_handle_t handle, guint init
guint* uint_var;
module_t *module;
gchar *description, *title;
- dissector_table_t pref_dissector_table = find_dissector_table( name);
+ dissector_table_t pref_dissector_table = find_dissector_table(name);
int proto_id = proto_get_id(handle->protocol);
uint_var = wmem_new(wmem_epan_scope(), guint);
@@ -1095,7 +1094,7 @@ void dissector_add_uint_range_with_preference(const char *name, const char* rang
range_t** range;
module_t *module;
gchar *description, *title;
- dissector_table_t pref_dissector_table = find_dissector_table( name);
+ dissector_table_t pref_dissector_table = find_dissector_table(name);
int proto_id = proto_get_id(handle->protocol);
guint32 max_value = 0;
@@ -1159,11 +1158,11 @@ void
dissector_delete_uint(const char *name, const guint32 pattern,
dissector_handle_t handle _U_)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry;
/* sanity check */
- g_assert( sub_dissectors);
+ g_assert(sub_dissectors);
/*
* Find the entry.
@@ -1241,11 +1240,11 @@ dissector_delete_from_all_tables(dissector_handle_t handle)
void
dissector_change_uint(const char *name, const guint32 pattern, dissector_handle_t handle)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry;
/* sanity check */
- g_assert( sub_dissectors);
+ g_assert(sub_dissectors);
/*
* See if the entry already exists. If so, reuse it.
@@ -1269,19 +1268,19 @@ dissector_change_uint(const char *name, const guint32 pattern, dissector_handle_
dtbl_entry->current = handle;
/* do the table insertion */
- g_hash_table_insert( sub_dissectors->hash_table,
- GUINT_TO_POINTER( pattern), (gpointer)dtbl_entry);
+ g_hash_table_insert(sub_dissectors->hash_table,
+ GUINT_TO_POINTER(pattern), (gpointer)dtbl_entry);
}
/* Reset an entry in a uint dissector table to its initial value. */
void
dissector_reset_uint(const char *name, const guint32 pattern)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry;
/* sanity check */
- g_assert( sub_dissectors);
+ g_assert(sub_dissectors);
/*
* Find the entry.
@@ -1444,7 +1443,7 @@ void
dissector_add_string(const char *name, const gchar *pattern,
dissector_handle_t handle)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry;
char *key;
@@ -1497,7 +1496,7 @@ dissector_add_string(const char *name, const gchar *pattern,
}
/* do the table insertion */
- g_hash_table_insert( sub_dissectors->hash_table, (gpointer)key,
+ g_hash_table_insert(sub_dissectors->hash_table, (gpointer)key,
(gpointer)dtbl_entry);
/*
@@ -1522,11 +1521,11 @@ void
dissector_delete_string(const char *name, const gchar *pattern,
dissector_handle_t handle _U_)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry;
/* sanity check */
- g_assert( sub_dissectors);
+ g_assert(sub_dissectors);
/*
* Find the entry.
@@ -1547,11 +1546,11 @@ void
dissector_change_string(const char *name, const gchar *pattern,
dissector_handle_t handle)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry;
/* sanity check */
- g_assert( sub_dissectors);
+ g_assert(sub_dissectors);
/*
* See if the entry already exists. If so, reuse it.
@@ -1575,7 +1574,7 @@ dissector_change_string(const char *name, const gchar *pattern,
dtbl_entry->current = handle;
/* do the table insertion */
- g_hash_table_insert( sub_dissectors->hash_table, (gpointer)g_strdup(pattern),
+ g_hash_table_insert(sub_dissectors->hash_table, (gpointer)g_strdup(pattern),
(gpointer)dtbl_entry);
}
@@ -1583,11 +1582,11 @@ dissector_change_string(const char *name, const gchar *pattern,
void
dissector_reset_string(const char *name, const gchar *pattern)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry;
/* sanity check */
- g_assert( sub_dissectors);
+ g_assert(sub_dissectors);
/*
* Find the entry.
@@ -1707,7 +1706,7 @@ dissector_get_default_string_handle(const char *name, const gchar *string)
/* Add an entry to a "custom" dissector table. */
void dissector_add_custom_table_handle(const char *name, void *pattern, dissector_handle_t handle)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
dtbl_entry_t *dtbl_entry;
/*
@@ -1730,7 +1729,7 @@ void dissector_add_custom_table_handle(const char *name, void *pattern, dissecto
dtbl_entry->initial = dtbl_entry->current;
/* do the table insertion */
- g_hash_table_insert( sub_dissectors->hash_table, (gpointer)pattern,
+ g_hash_table_insert(sub_dissectors->hash_table, (gpointer)pattern,
(gpointer)dtbl_entry);
/*
@@ -1788,7 +1787,7 @@ void dissector_add_guid(const char *name, guid_key* guid_val, dissector_handle_t
dtbl_entry->initial = dtbl_entry->current;
/* do the table insertion */
- g_hash_table_insert( sub_dissectors->hash_table,
+ g_hash_table_insert(sub_dissectors->hash_table,
guid_val, (gpointer)dtbl_entry);
/*
@@ -1939,7 +1938,7 @@ dissector_compare_filter_name(gconstpointer dissector_a, gconstpointer dissector
void
dissector_add_for_decode_as(const char *name, dissector_handle_t handle)
{
- dissector_table_t sub_dissectors = find_dissector_table( name);
+ dissector_table_t sub_dissectors = find_dissector_table(name);
GSList *entry;
dissector_handle_t dup_handle;
@@ -2320,7 +2319,7 @@ dissector_all_tables_foreach_list_func (gpointer key, gpointer user_data)
dissector_table_t table;
dissector_foreach_table_info_t *info;
- table = (dissector_table_t)g_hash_table_lookup( dissector_tables, key );
+ table = (dissector_table_t)g_hash_table_lookup(dissector_tables, key);
info = (dissector_foreach_table_info_t *)user_data;
(*info->caller_func)((gchar*)key, table->ui_name, info->caller_data);
}
@@ -2359,7 +2358,7 @@ register_dissector_table(const char *name, const char *ui_name, const int proto,
dissector_table_t sub_dissectors;
/* Make sure the registration is unique */
- if(g_hash_table_lookup( dissector_tables, name )) {
+ if (g_hash_table_lookup(dissector_tables, name)) {
g_error("The dissector table %s (%s) is already registered - are you using a buggy plugin?", name, ui_name);
}
@@ -2377,26 +2376,26 @@ register_dissector_table(const char *name, const char *ui_name, const int proto,
* so we use "g_direct_hash()" and "g_direct_equal()".
*/
sub_dissectors->hash_func = g_direct_hash;
- sub_dissectors->hash_table = g_hash_table_new_full( g_direct_hash,
+ sub_dissectors->hash_table = g_hash_table_new_full(g_direct_hash,
g_direct_equal,
NULL,
- &g_free );
+ &g_free);
break;
case FT_STRING:
case FT_STRINGZ:
case FT_STRINGZPAD:
sub_dissectors->hash_func = g_str_hash;
- sub_dissectors->hash_table = g_hash_table_new_full( g_str_hash,
+ sub_dissectors->hash_table = g_hash_table_new_full(g_str_hash,
g_str_equal,
&g_free,
- &g_free );
+ &g_free);
break;
case FT_GUID:
- sub_dissectors->hash_table = g_hash_table_new_full( uuid_hash,
+ sub_dissectors->hash_table = g_hash_table_new_full(uuid_hash,
uuid_equal,
NULL,
- &g_free );
+ &g_free);
break;
case FT_NONE:
@@ -2404,10 +2403,10 @@ register_dissector_table(const char *name, const char *ui_name, const int proto,
dissectors so this will always be a hash table size of 1 just
to store the single dtbl_entry_t */
sub_dissectors->hash_func = g_direct_hash;
- sub_dissectors->hash_table = g_hash_table_new_full( g_direct_hash,
+ sub_dissectors->hash_table = g_hash_table_new_full(g_direct_hash,
g_direct_equal,
NULL,
- &g_free );
+ &g_free);
break;
default:
@@ -2420,7 +2419,7 @@ register_dissector_table(const char *name, const char *ui_name, const int proto,
sub_dissectors->param = param;
sub_dissectors->protocol = find_protocol_by_id(proto);
sub_dissectors->supports_decode_as = FALSE;
- g_hash_table_insert( dissector_tables, (gpointer)name, (gpointer) sub_dissectors );
+ g_hash_table_insert(dissector_tables, (gpointer)name, (gpointer) sub_dissectors);
return sub_dissectors;
}
@@ -2430,7 +2429,7 @@ dissector_table_t register_custom_dissector_table(const char *name,
dissector_table_t sub_dissectors;
/* Make sure the registration is unique */
- if(g_hash_table_lookup( dissector_tables, name )) {
+ if (g_hash_table_lookup(dissector_tables, name)) {
g_error("The dissector table %s (%s) is already registered - are you using a buggy plugin?", name, ui_name);
}
@@ -2441,7 +2440,7 @@ dissector_table_t register_custom_dissector_table(const char *name,
sub_dissectors->hash_table = g_hash_table_new_full(hash_func,
key_equal_func,
&g_free,
- &g_free );
+ &g_free);
sub_dissectors->dissector_handles = NULL;
sub_dissectors->ui_name = ui_name;
@@ -2449,7 +2448,7 @@ dissector_table_t register_custom_dissector_table(const char *name,
sub_dissectors->param = BASE_NONE;
sub_dissectors->protocol = find_protocol_by_id(proto);
sub_dissectors->supports_decode_as = FALSE;
- g_hash_table_insert( dissector_tables, (gpointer)name, (gpointer) sub_dissectors );
+ g_hash_table_insert(dissector_tables, (gpointer)name, (gpointer) sub_dissectors);
return sub_dissectors;
}
@@ -2584,7 +2583,7 @@ heur_dissector_add(const char *name, heur_dissector_t dissector, const char *dis
static int
-find_matching_heur_dissector( gconstpointer a, gconstpointer b) {
+find_matching_heur_dissector(gconstpointer a, gconstpointer b) {
const heur_dtbl_entry_t *hdtbl_entry_a = (const heur_dtbl_entry_t *) a;
const heur_dtbl_entry_t *hdtbl_entry_b = (const heur_dtbl_entry_t *) b;
@@ -3163,7 +3162,7 @@ void call_heur_dissector_direct(heur_dtbl_entry_t *heur_dtbl_entry, tvbuff_t *tv
pinfo->heur_list_name = heur_dtbl_entry->list_name;
/* call the dissector, in case of failure call data handle (might happen with exported PDUs) */
- if(!(*heur_dtbl_entry->dissector)(tvb, pinfo, tree, data)) {
+ if (!(*heur_dtbl_entry->dissector)(tvb, pinfo, tree, data)) {
call_dissector_work(data_handle, tvb, pinfo, tree, TRUE, NULL);
/*