diff options
author | Guy Harris <gharris@sonic.net> | 2021-08-09 15:57:29 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-08-09 15:57:29 -0700 |
commit | 4aee4059745f6089e530344289e7ea24d5ec2db4 (patch) | |
tree | 90b11538247e2d1989eeb4092f8519760605b396 /epan | |
parent | 410cfdd7dae2895750d97cfd9e831ed98173a8cb (diff) |
etw: use PACK_FLAGS_DIRECTION() to extract the direction from the flags.
Use PACK_FLAGS_DIRECTION() rather than making with
PACK_FLAGS_DIRECTION_MASK. They happen to be at the bottom of the flags
option, so no shifing is needed, but it's cleaner to use the macro.
Make the packet flags variable local to the code that uses it, and fix
indentation (don't use tabs - they're not used elsewhere), while we're
at it.
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-etw.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-etw.c b/epan/dissectors/packet-etw.c index 097c6f9fa1..dd56f0d886 100644 --- a/epan/dissectors/packet-etw.c +++ b/epan/dissectors/packet-etw.c @@ -67,7 +67,7 @@ dissect_etw(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree _U_, void* data { proto_tree* etw_header, * etw_descriptor, * etw_buffer_context; tvbuff_t* mbim_tvb; - guint32 message_offset, message_length, provider_name_offset, provider_name_length, user_data_offset, user_data_length, pack_flags; + guint32 message_offset, message_length, provider_name_offset, provider_name_length, user_data_offset, user_data_length; e_guid_t provider_id; gint offset = 0; @@ -137,8 +137,10 @@ dissect_etw(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree _U_, void* data col_set_str(pinfo->cinfo, COL_DEF_SRC, "windows"); col_set_str(pinfo->cinfo, COL_DEF_DST, "windows"); if (memcmp(&mbim_net_providerid, &provider_id, sizeof(e_guid_t)) == 0) { - if (WTAP_OPTTYPE_SUCCESS == wtap_block_get_uint32_option_value(pinfo->rec->block, OPT_PKT_FLAGS, &pack_flags)) { - switch(pack_flags & PACK_FLAGS_DIRECTION_MASK) { + guint32 pack_flags; + + if (WTAP_OPTTYPE_SUCCESS == wtap_block_get_uint32_option_value(pinfo->rec->block, OPT_PKT_FLAGS, &pack_flags)) { + switch(PACK_FLAGS_DIRECTION(pack_flags)) { case PACK_FLAGS_DIRECTION_INBOUND: col_set_str(pinfo->cinfo, COL_DEF_SRC, "device"); col_set_str(pinfo->cinfo, COL_DEF_DST, "host"); |