Remove some unnecessary includes and fix some indentation.

svn path=/trunk/; revision=42227
This commit is contained in:
Martin Mathieson 2012-04-25 00:28:19 +00:00
parent 1ec161eab8
commit 56add1934d
3 changed files with 69 additions and 75 deletions

View File

@ -29,7 +29,6 @@
#endif
#include <glib.h>
#include <string.h>
#include <epan/packet.h>
#include <epan/crc32-tvb.h>
@ -323,7 +322,7 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset+=2;
length_remaining-=2;
}
/*extract flow id , 4bytes*/
if (length_remaining >= 4) {
align_offset = ALIGN_OFFSET(offset, 4);
@ -378,37 +377,37 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
/* start a tree going for the various packet times */
if (vw_latency != 0) {
vw_times_ti = proto_tree_add_float_format(common_tree,
hf_ixveriwave_vw_mslatency,
tvb, offset, 4, (float)(vw_latency/1000000.0),
"Frame timestamp values: (latency %.3f msec)",
(float)(vw_latency/1000000.0));
vw_times_tree = proto_item_add_subtree(vw_times_ti, ett_commontap_times);
if (vw_latency != 0) {
vw_times_ti = proto_tree_add_float_format(common_tree,
hf_ixveriwave_vw_mslatency,
tvb, offset, 4, (float)(vw_latency/1000000.0),
"Frame timestamp values: (latency %.3f msec)",
(float)(vw_latency/1000000.0));
vw_times_tree = proto_item_add_subtree(vw_times_ti, ett_commontap_times);
proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_latency,
tvb, offset, 4, vw_latency,
"Frame latency: %u nsec", vw_latency);
}
else
{
vw_times_ti = proto_tree_add_float_format(common_tree,
hf_ixveriwave_vw_mslatency,
tvb, offset, 4, (float)(vw_latency/1000000.0),
"Frame timestamp values:");
vw_times_tree = proto_item_add_subtree(vw_times_ti, ett_commontap_times);
proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_latency,
tvb, offset, 4, vw_latency,
"Frame latency: %u nsec", vw_latency);
}
else
{
vw_times_ti = proto_tree_add_float_format(common_tree,
hf_ixveriwave_vw_mslatency,
tvb, offset, 4, (float)(vw_latency/1000000.0),
"Frame timestamp values:");
vw_times_tree = proto_item_add_subtree(vw_times_ti, ett_commontap_times);
proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_latency,
tvb, offset, 4, vw_latency,
"Frame latency: N/A");
}
proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_latency,
tvb, offset, 4, vw_latency,
"Frame latency: N/A");
}
}
offset+=4;
length_remaining-=4;
}
/*extract signature timestamp, 4 bytes (32 LSBs only, nsec)*/
if (length_remaining >= 4) {
@ -515,13 +514,13 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Doesn't exist, so we need to calculate the value */
if (previous_frame_data.previous_frame_num !=0 && (pinfo->fd->num - previous_frame_data.previous_frame_num == 1))
{
p_ifg_info->ifg = (guint32)(vw_startt - previous_frame_data.previous_end_time);
p_ifg_info->previous_end_time = previous_frame_data.previous_end_time;
p_ifg_info->ifg = (guint32)(vw_startt - previous_frame_data.previous_end_time);
p_ifg_info->previous_end_time = previous_frame_data.previous_end_time;
}
else
{
p_ifg_info->ifg = 0;
p_ifg_info->previous_end_time = 0;
p_ifg_info->ifg = 0;
p_ifg_info->previous_end_time = 0;
}
/* Store current data into the static structure */
@ -601,7 +600,7 @@ ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_t
/*extract info flags , 2bytes*/
if (length_remaining >= 2) {
if (length_remaining >= 2) {
vw_info = tvb_get_letohs(tvb, offset);
if (tap_tree) {
@ -609,18 +608,18 @@ ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_t
tvb, offset, 2, vw_info);
vw_infoFlags_tree = proto_item_add_subtree(vwift, ett_ethernettap_info);
if (vwf_txf == 0) {
/* then it's an rx case */
proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_rx_1_bit8,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_rx_1_bit9,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
} else {
/* it's a tx case */
proto_tree_add_uint_format(vw_infoFlags_tree, hf_ixveriwave_vw_info_retryCount,
tvb, offset, 2, vw_info,
"Retry count: %u ", vw_info);
}
if (vwf_txf == 0) {
/* then it's an rx case */
proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_rx_1_bit8,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_rx_1_bit9,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
} else {
/* it's a tx case */
proto_tree_add_uint_format(vw_infoFlags_tree, hf_ixveriwave_vw_info_retryCount,
tvb, offset, 2, vw_info,
"Retry count: %u ", vw_info);
}
} /*end of if tree */
offset+=2;
@ -634,7 +633,7 @@ ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_t
if (tap_tree) {
vweft = proto_tree_add_uint(tap_tree, hf_ixveriwave_vw_error,
tvb, offset, 4, vw_error);
vw_errorFlags_tree = proto_item_add_subtree(vweft, ett_ethernettap_error);
vw_errorFlags_tree = proto_item_add_subtree(vweft, ett_ethernettap_error);
if (vwf_txf == 0) {
/* then it's an rx case */
@ -759,18 +758,18 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
ht_rate = getHTrate( rate, rflags );
col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f",
ht_rate);
if (tree) {
proto_tree_add_uint_format(tap_tree, hf_radiotap_datarate,
tvb, offset, 1, tvb_get_guint8(tvb, offset),
"Data rate: %.1f (MCS %d)", ht_rate, rate & IEEE80211_PLCP_RATE_MASK);
}
if (tree) {
proto_tree_add_uint_format(tap_tree, hf_radiotap_datarate,
tvb, offset, 1, tvb_get_guint8(tvb, offset),
"Data rate: %.1f (MCS %d)", ht_rate, rate & IEEE80211_PLCP_RATE_MASK);
}
} else {
col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%d.%d",
(rate & IEEE80211_PLCP_RATE_MASK)/ 2, rate & 1 ? 5 : 0);
if (tree) {
proto_tree_add_uint_format(tap_tree, hf_radiotap_datarate,
tvb, offset, 1, tvb_get_guint8(tvb, offset),
"Data rate: %d.%d Mb/s", (rate & IEEE80211_PLCP_RATE_MASK)/ 2,
"Data rate: %d.%d Mb/s", (rate & IEEE80211_PLCP_RATE_MASK)/ 2,
(rate & IEEE80211_PLCP_RATE_MASK) & 1 ? 5 : 0);
}
}

View File

@ -27,14 +27,10 @@
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#define ETHERNET_INTERFACE 1
#define WLAN_INTERFACE 2
@ -1048,7 +1044,7 @@ static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Grab the control word, parse the WaveAgent payload accordingly */
control_word = tvb_get_ntohl(tvb, 28);
paylen = tvb_get_ntohl(tvb, 20);
paylen = tvb_get_ntohl(tvb, 20);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%x)",
val_to_str_const(control_word, control_words, "Unknown"), control_word);
@ -1068,21 +1064,21 @@ static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Need to check for a relay message. If so, parse the extra fields and then parse the WA packet */
if (control_word == 0x3e)
{
proto_tree_add_item(waveagent_tree,
hf_waveagent_relaydestid, tvb, wa_payload_offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(waveagent_tree,
hf_waveagent_relaysrcid, tvb, wa_payload_offset+4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(waveagent_tree,
hf_waveagent_relaydestid, tvb, wa_payload_offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(waveagent_tree,
hf_waveagent_relaysrcid, tvb, wa_payload_offset+4, 4, ENC_BIG_ENDIAN);
/* Parse control_word of the relay message */
control_word = tvb_get_ntohl(tvb, wa_payload_offset+12+28);
rmi = proto_tree_add_none_format(waveagent_tree, hf_waveagent_relaymessagest, tvb, wa_payload_offset+12+28, 0,
"Relayed WaveAgent Message, %s (0x%x)",
val_to_str_const(control_word, control_words, "Unknown"), control_word);
/* Parse control_word of the relay message */
control_word = tvb_get_ntohl(tvb, wa_payload_offset+12+28);
rmi = proto_tree_add_none_format(waveagent_tree, hf_waveagent_relaymessagest, tvb, wa_payload_offset+12+28, 0,
"Relayed WaveAgent Message, %s (0x%x)",
val_to_str_const(control_word, control_words, "Unknown"), control_word);
relay_message_tree = proto_item_add_subtree(rmi, ett_relaymessage);
relay_message_tree = proto_item_add_subtree(rmi, ett_relaymessage);
wa_payload_offset = dissect_wa_header(wa_payload_offset+12, relay_message_tree, tvb, version);
payload_tree = relay_message_tree;
wa_payload_offset = dissect_wa_header(wa_payload_offset+12, relay_message_tree, tvb, version);
payload_tree = relay_message_tree;
}
dissect_wa_payload(wa_payload_offset, payload_tree, tvb, control_word, version);

View File

@ -24,9 +24,10 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include "wtap-int.h"
#include "file_wrappers.h"
#include "buffer.h"
@ -1457,7 +1458,7 @@ static void vwr_read_rec_data_vVW510021(wtap *wth, guint8 *data_ptr, guint8 *rec
er_fields.vw_errors = (guint32)errors;
common_fields.vw_vcid = (guint16)vc_id;
common_fields.vw_msdu_length = (guint16)msdu_length;
er_fields.vw_ht_length = (guint16)ht_len;
@ -1628,17 +1629,15 @@ static void vwr_read_rec_data_ethernet(wtap *wth, guint8 *data_ptr, guint8 *rec,
if (!IS_TX) {
if (sig_ts < s_time) {
latency = (guint32)(s_time - sig_ts);
} else {
} else {
/* Account for the rollover case. Since we cannot use 0x100000000 - l_time + s_time */
/* we look for a large difference between l_time and s_time. */
delta_b = sig_ts - s_time;
if (delta_b > 0x10000000) {
latency = 0;
latency = 0;
} else
latency = (guint32)delta_b;
}
latency = (guint32)delta_b;
}
}
/* fill up the per-packet header (amazingly like a PCAP packet header! ;-) */
/* frames are always wired ethernet with a wired ethernettap header */